Symptoms
1. Domain name DNS zone file record in Plesk Windows suddenly not working.
2. DNS zone file missing at Plesk DNS zone folder(C:\Program Files (x86)\Parallels\Plesk\dns\var).
3. Login to Plesk, restore default also not working.
Reason
The issue is caused by incorrect dns details in Plesk database.
Solution
Steps to recreate dns records
1. Search invalid dns records in Plesk database
cd C:\Program Files (x86)\Parallels\Plesk\admin\bin> |
"%plesk_bin%\dbclient" --direct-sql --sql="select id,name from dns_zone where id not in (select dns_zone_id from domains) and id not in (select dns_zone_id from domain_aliases) and id <> (select val from misc where param = 'default_dns_zone_id')" |
2. Remove invalid dns records
cd %plesk_dir%\Mysql\bin |
Login plesk mysql:
mysql -uadmin -p -P 8306 psa |
Delete records: delete from dns_zone where id not in (select dns_zone_id from domains) and id not in (select dns_zone_id from domain_aliases) and id <> (select val from misc where param = ‘default_dns_zone_id’);
delete * from dns_zone where id=101; |
Exit mysql
3. Update dns recods
cd C:\Program Files (x86)\Parallels\Plesk\admin\bin> |
DNSMng.exe Update * |
Login Plesk panel, use Restore Defaults to restore default dns records
Open DNS manager on server to check if correct dns records are created.