• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

FIX: named fails to start with: zone xx.tld/IN: NS 'ns.xx.tld' has no address records

StéphanS

Regular Pleskian
After migrating an old Plesk 8.6 to Plesk 11.5, I came across this annoying named limitation:


Code:
zone xx.tld/IN: NS 'ns.xx.tld' has no address records (A or AAAA)
zone xx.tld/IN: not loaded due to errors.
_default/xx.tld/IN: bad zone
                                                           [FAILED]

Which means that I have NS records that point to a host name that doesn't exist in the same zone.


You can list all of these failed zones with:

Code:
service named restart | grep "bad zone"


There were only 16 of these failed DNS zones for me, so I could have just fixed them by hand via Plesk.
But I'm in the process of migrating another 15 Plesk servers, so I decided to invest some time into fixing this via the DB.

I came across http://kb.parallels.com/en/113119 which doesn't solve the problem, but had far better SQL than I had.
So I merged my first piece of code with some of the code in the article.

This is my result:

Code:
# Fix any broken DNS entries

 # Inspect first
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -Nse "SELECT * FROM dns_recs AS DR, dns_zone AS DZ WHERE DZ.status=0 AND DZ.id=DR.dns_zone_id AND DR.type='NS' AND DR.val = CONCAT('ns.',DZ.name,'.') AND DR.val NOT IN (SELECT host FROM dns_recs);"


 # Delete all bad records and regenerate the bad zones
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -Nse "SELECT DR.id, DZ.name FROM dns_recs AS DR, dns_zone AS DZ WHERE DZ.status=0 AND DZ.id=DR.dns_zone_id AND DR.type='NS' AND DR.val = CONCAT('ns.',DZ.name,'.') AND DR.val NOT IN (SELECT host FROM dns_recs);" | while read record domain; do mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -Nse "DELETE FROM dns_recs WHERE dns_recs.id=$record"; plesk sbin dnsmng --update $domain; done
service named restart


Now if only
Code:
plesk bin repair --run
could do this for me, I would be so much happier :)
 
Back
Top