Tang, Song, Yuan, Ming and Qing dynasties need not be distinguished by surnames.
Tang: Li Yuan succeeded Tang Guogong. So take Tang as the country name.
Song Dynasty: After Zhao Kuangyin was appointed as China's ambassador to Germany in Songzhou, he took the word "Song" in Songzhou as his country name.
Ming: From Zoroastrianism.