Vietnam told tens of thousands of people who visited a central city to report to disease control centres on Thursday, as nine new coronavirus cases were confirmed and the country scrambled to contain its first outbreak in over three months.

The health ministry sent text messages to all mobile phone users among the country's 95 million people urging anyone who visited Danang from July 1 to come forward, after a new wave of the virus spread to at least six cities and provinces in six days, all linked to Danang.

Hanoi's ruling body on Thursday said mass testing would be carried out until Saturday among thousands of residents who recently returned from Danang, a popular holiday getaway that has been a big draw since restrictions were eased.

The response to the Danang outbreak is in line with a centralised quarantine programme and aggressive contact-tracing system that has seen Vietnam lauded for keeping its coronavirus tally to just a few hundred cases, with no fatalities.

Hanoi banned large gatherings and ordered bars closed from midnight Wednesday and its chairman Nguyen Duc Chung declared the city must "act now and act fast".

"We have to use full force to test all 21,063 returnees," Chung said on Thursday.

"All must be done in three days."

Nine new cases were reported on Thursday, taking total infections to 42 since the virus resurfaced at the weekend, ending a run of 99 days without community transmission. Vietnam has recorded 459 cases overall.

Prime Minister Nguyen Xuan Phuc has told tourist areas to step up vigilance and imposed a strict lockdown in Danang, where flights have been halted for 15 days.

The coastal city has been inundated with visitors taking advantage of promotions to revitalise a tourism sector hurt by border closures and international flight bans designed to keep the virus out.

The current wave is traced to Danang, but the source is unclear. The health ministry said one case, an American, had reported symptoms as far back as June 26.