Introduction
Sometimes you want this information when a large number of domains are being moved and you want to know which need manual updates and which do not. You can loop through all the domains or all users and domains to get that information.
Procedure
The simple dig method:
cat /etc/{local,remote}domains | while read dom ; do echo "NS records for $dom"; dig +short NS $dom; echo "-------"; done
This will produce output like the following through all domains:
NS records for siteone.com
ns1.siteone.com.
ns2.siteone.com.
-------
NS records for sitetwo.com
-------
NS records for tasteofasialaverne.com
ns1.someremote.com.
ns2.someremote.com.
-------
The second is to use a cPanel uapi that will provide much more information:
awk -F ": " '{print "domain="$1 " --user="$2}' /etc/userdomains|grep -v nobody | while read x; do uapi DNS has_local_authority $x; done
The API used is documented at: Return whether local DNS server is authoritative
Please note the above one-liners are provided as-is and as examples. cPanel doesn't write custom scripts or code. Anything further would need to be adjusted by a qualified system administrator obtained.
Comments
0 comments
Article is closed for comments.