Update all domain zones at once

If you've updated Plesk DNS stuff directly from the database you'll want to rebuild the DNS zones so that your changes get applied to the "real" DNS.

I've found this very useful shell script in the SWSoft forums:

#!/bin/sh

ADMIN_PASS=`cat /etc/psa/.psa.shadow`
MYSQL_BIN_D=`grep MYSQL_BIN_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"
    /usr/local/psa/admin/sbin/dnsmng update $i
done

Don't forget to add execution permission to it.

Leave a comment
Name
Email (optional)
Your email will only be used to show your Gravatar and to send you replies to this article (if you opt to receive them). You won't get ANY other messages at all!
Comment
No HTML allowed
Notify me via email
 
 
Share

Valid HTML 4.01 Strict