If you make use of cPanel’s DNS cluster or cPanel DNS Only then you might find this of use.
Typical example where you would use this is scripting, and you want to synchronise your DNS zone files with other servers in the cluster. For example, you may want to automate the deployment of new servers in the DNS cluster. In your script, you want to have the zone files synchronised.
A second scenario – you have a domain where records are added and removed automatically by a front end system. The system makes modifications to the zone file directly and synchronised changes in a cron every 5 minutes.
The script and path is as follows. Usage is included for your convenience.
$ /scripts/dnscluster Usage: dnscluster <action> <zone> --help Actions: syncall - make sure all dns zones are in sync within the cluster. If the zones are out out of sync, the one with the largest serial number will be copied to all servers. syncalllocal - make sure all dns zones are in sync within the cluster. If the zones are out out of sync, the one with the largest serial number will be copied to all servers. Only the local server's zone database will be updated. synczone <zone> - sync one zone If the zone is out out of sync, the one with the largest serial number will be copied to all servers. synczonelocal <zone> - sync one zone If the zone is out out of sync, the one with the largest serial number will be copied to the local server. '--help' or no args at all will give usage
In the first example I mentioned (sync all zones), the following command would be used:
$ /scripts/dnscluster syncall
For the second example (just a single DNS zone to remote server) you would use:
$ /scripts/dnscluster synczone sysadminspot.com
Note that cPanel DNS synchronisation works on the zone serial. If you’re making direct modifications to the DNS zone file then you must update the serial number to a larger number than the previous. Typically the ten (10) digit serials are the format of YYYYMMDDNN. That is:
- YYYY = Year in full (2009)
- MM = Month in full (09)
- DD = Day in full (26)
- NN = Version number for that day. Start at 01 and increment. When a new date starts, return to 01.
So if your DNS is not syncing correctly, it’s likely because you are not updating your serials correctly OR your DNS clustering (sync directions, etc) are not setup correctly in cPanel. Login to WHM and setup under Cluster Setup.
For more information on cPanel DNS Only and DNS clustering, check out Understanding cPanel clustered DNS and Setup.
- Find What IP Address cPanel Site Is Using via Command Line
- Understanding cPanel clustered DNS and Setup
- Moving From No Control Panel Servers to a cPanel Server
- Installing WordPress via SSH Command Line
- Modifying cPanel Mailbox Quota Errors “invalid maildirsize file”
- Emails Not Sending – defer (111): Connection refused (Exim) and SMTP Tweak
- Locking down and securing SSH access to your server
- Error message “The file is either corrupted or does not have the latest credentials associated with recovery service. (ID: 34513) “