In this way, the Han Dynasty was the longest dynasty from 206 to 220 years ago, a period of 425 years.
If calculated separately, it is the Tang Dynasty (6 18-904), followed by the Ming Dynasty (1368- 1644).
If you count the dynasties before the Qin dynasty (generally not so)
The longest is the Zhou Dynasty, which existed for about 800 years.