Hanoi has been the capital of the Chinese Tonkin since the 7th century, when it was called Dongjing (東京), meaning "Eastern Capital." "Tonkin" is the Vietnamese pronunciation of "Dongjing." (The same characterss are used to write the name of the city of Tokyo.)
France assumed sovereignty over Annam and Tonkin after the Franco-Chinese War (1884-1885). The French used the name of the capital for the entire region under its jurisdiction. The third part of Vietnam were was Cochin China at the south.
The Latin adjective tonkinensis is a specific epithet, part of the binomial nomenclature, used to describe species, mostly trees, found in Tonkin. For example, Cornus hongkongensis subsp. tonkinensis  is a subspecies of an evergreen tree or shrub of the dogwood family that is usually found in Hong Kong, but this particularly subpecies have been located in Tonkin.