DNS ZONE / CPANEL ACCOUNTS
Good afternoon, I wanted to know if there is an option to reset all DNS zones to the cpanel default in just one go, an ssh command or something like that?
-
How do I use this command to reset all DNS zones for all cpanel accounts on my whm panel
whmapi1 resetzone domain=example.com
0 -
Hey there! You'd have to make a custom for loop to do something like that. Getting every domain on the system is often the hardest part, but we have a "listzones" API call we can use to help.
Something like this will work well, but *please* create a backup before executing any commands on your server:
for i in `whmapi1 listzones | grep domain | awk {'print $2'}`; do whmapi1 resetzone domain=$i ; done
If this works well, you should see output scrolling by that looks similar to this as each zone resets:
metadata:
command: resetzone
reason: OK
result: 1
version: 1
---
metadata:
command: resetzone
reason: OK
result: 1
version: 10 -
It worked a lot thank youCan you also help me with how I can remove the suspension from all whm accounts at once too!
0 -
The best option would be to use a for loop with this tool:
https://docs.cpanel.net/whm/scripts/the-unsuspendacct-script/
I tested this and it works well:
for i in `cat /etc/trueuserdomains | awk {'print $2'}`; do /usr/local/cpanel/scripts/unsuspendacct $i; done
0
Please sign in to leave a comment.
Comments
4 comments