How to reset DNS Zone of a cPanel server by CLI? Print

  • 0

There's a regular way to reset the DNS zone of each domain name from the WHM interface. But, it is too hard to reset the DNS zone for the whole server one by one from the WHM interface. So, we recommend you run the following command to do the job easily. But. first of all, make sure "screen" is already installed on your server. If it is not installed, you can install the screen by running the command: yum install screen -y

Once, it installs on your cPanel server, start a screen (so that you won't loss the session), and run the following command:

for i in $(cat /etc/trueuserdomains | cut -d: -f1); do whmapi1 resetzone domain=$i; done

Was this answer helpful?

« Back

Send Message