• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.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