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

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
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Install Let's Encrypt SSL in cPanel/WHM

Let's Encrypt, a valid, open-source license that offers free SSL for your domains. The Let's...

Fix Email Issue on a server using the MSFE

To solve the problem of not sending/receiving email on a server using the MSFE / Mailscanner...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...