Reese Knowledgebase

How to Rebuild named configuration / DNS zones

View Kristian Reese's profile on LinkedIn


If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 82
by: Reese K.
Posted: 07 Jan, 2013
Last updated: 07 Jan, 2013
Views: 2255

How to Rebuild named configuration / DNS zones and records within Plesk

Sometimes while attempting to restart the named service, you may be met with messages like:

zone mysite.com/IN: has no NS records
_default/myothersite.com/IN: bad zone

Instead of trying to sift through the named config, zones/records can be rebuilt with the following script, provided from parallels:

#!/bin/sh

ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
PRODUCT_ROOT_D=`grep PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'`
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa"

query="select name from domains;"
domains=`echo $query | $mysql `

for i in ${domains}; do
    echo "echo $i"
    $PRODUCT_ROOT_D/admin/sbin/dnsmng update $i
done

I've come across errors while attempting to use this script and have had to manually create a corresponding NS and/or A record to get the script to run.  In particular:

dnsmng: Warning: unable to resolve ns.mysite.com.

System error 11: Resource temporarily unavailable
dnsmng: Warning: unable to resolve ns.mysite.com.

In plesk, I looked at the DNS Records for the domain in question and found a missing A record for ns.mysite.com.  After creating it, the script ran successfully.

This article was:   Helpful | Not Helpful
Prev   Next
SWKeyExFatalError : Repository is not opened     Installing and configuring Clam AntiVirus for Linux

RSS