• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

How to DNS Template Apply all domains single command

ghacvbbngff

New Pleskian
Hi, I have more than 100 domains on my vps server and I want to change all of them new dns template that I fixed new nameservers. How can I do that?

Thanks.
 
Try to use following method:

1. Remove old NS record from all domain's DNS zones:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/dns --del $i -ns '' -nameserver ns2.test.tld; done


2. Add new NS record for all domains:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/dns --add $i -ns '' -nameserver ns.test.tld; done

3. Update and reload new zones:
# # for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/admin/sbin/dnsmng -update $i; done

Note, it is just example. Modify it as you need.
 
Back
Top