From which dynasty did Viet Nam not belong to China?

Before the Tang Dynasty, Vietnam was directly ruled by China.

/kloc-In the late 20th century, France colonized Vietnam, and the Qing Dynasty sent troops to resist. 1885, the Qing government signed the Sino-French New Testament with France and was forced to recognize Vietnam's independence.

From then on, Viet Nam became completely independent from the territory of China and became a French colony.