History Hanoi has been the capital of Vietnam since 1010, when it became the capital of the Ly dynasty. It remained the main capital until 1802, when the Nguyen dynasty moved the capital to Hue. Hanoi became an important administrative center during French rule