Hanoi has had many names throughout history, all of them of Sino-Vietnamese origin. During the Chinese domination of Vietnam, it was known first as Long Biên, then Tống Bình (Chinese: 宋平, Sòngpíng, "Song Peace") and Long Đỗ (Chinese: 龍肚, Lóngdù, "Dragonbelly"). In 866, it was turned into a citadel and named Đại La (Chinese: 大羅, Dàluó, "Big Net").
In 1010, Ly Thai To, the first ruler of the Lý Dynasty, moved the capital of Đại Việt to the site of the Đại La Citadel. Claiming to have seen a dragon ascending the Red River, he renamed the site Thăng Long (昇龍, "Rising Dragon") - a name still used poetically to this day. Thăng Long remained the capital of Đại Việt until 1397, when it was moved to Thanh Hóa, then known as Tây Đô (西都
, the "Western Capital". Thăng Long then became Đông Đô (東都
, the "Eastern Capital."
In 1408, the Chinese Ming Dynasty attacked and occupied Vietnam, changing Đông Đô's name to "Eastern Gateway" (Chinese: 東關, Dōngguān), Đông Quan in Vietnamese. In 1428, the Vietnamese overthrew the Chinese under the leadership of Lê Lợi, who later founded the Lê Dynasty and renamed Đông Quan Đông Kinh (東京, "Eastern Capital") or Tonkin. Right after the end of the Tây Sơn Dynasty, it was named Bắc Thành (北城, "Northern Citadel").
-- China did own your capital city for a couple of times. Who knows whether its name will change again in future?