SOLVED How to synchronize one zone to all servers on command line?

Operating System & Version
centos 7.9.2009
cPanel & WHM Version
102.0.8

tui

Well-Known Member
Jun 15, 2007
139
39
78
Mexico
cPanel Access Level
Root Administrator
For some reason, in whm on Synchronize DNS Records, the "Synchronize all zones to all servers" option does not work, it does not synchronize any of the zones , in order to Synchronize zones to all servers you need to do one by one using the " Synchronize one zone to all servers " and fill the zone domain input one by one, but is tedious using it one by one.

What is the command to use that option on terminal? I would like to write a script to sync all my zones one by one
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,441
1,635
363
cPanel Access Level
Root Administrator
Hey hey! This is the one:

Code:
# /scripts/dnscluster
Usage: dnscluster [ACTION] [OPTIONS]...

Examples:
   /usr/local/cpanel/scripts/dnscluster syncall --full               # Sync all zones (even ones not in /etc/userdomains)
   /usr/local/cpanel/scripts/dnscluster synczonelocal mydomain.org   # Sync mydomain.org to the local machine

Actions:
    syncall [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files
       are out out of sync, the ones with the largest
       serial numbers will be copied to all servers.

    syncalllocal [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files are
       out out of sync, the ones with the largest serial
       numbers will be copied to the local server only.

    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.

Operation modifiers:
    -F, --full
       If the --full flag is specified then zones that are not
       local to this server (in /etc/userdomains) will be pulled
       in as well.  This was the default behavior prior to 11.24.5

Help:
    -H, --help (or no arguments)
       This will show this screen.
 
  • Like
Reactions: tui

tui

Well-Known Member
Jun 15, 2007
139
39
78
Mexico
cPanel Access Level
Root Administrator
Hey hey! This is the one:

Code:
# /scripts/dnscluster
Usage: dnscluster [ACTION] [OPTIONS]...

Examples:
   /usr/local/cpanel/scripts/dnscluster syncall --full               # Sync all zones (even ones not in /etc/userdomains)
   /usr/local/cpanel/scripts/dnscluster synczonelocal mydomain.org   # Sync mydomain.org to the local machine

Actions:
    syncall [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files
       are out out of sync, the ones with the largest
       serial numbers will be copied to all servers.

    syncalllocal [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files are
       out out of sync, the ones with the largest serial
       numbers will be copied to the local server only.

    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.

Operation modifiers:
    -F, --full
       If the --full flag is specified then zones that are not
       local to this server (in /etc/userdomains) will be pulled
       in as well.  This was the default behavior prior to 11.24.5

Help:
    -H, --help (or no arguments)
       This will show this screen.
Thats it! THanks!
 
  • Like
Reactions: cPRex