Skip to main content

DNS ZONE / CPANEL ACCOUNTS

Comments

4 comments

  • Quintanilha-RJ

    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
  • cPRex Jurassic Moderator

    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: 1
    0
  • Quintanilha-RJ


    It worked a lot thank you

    Can you also help me with how I can remove the suspension from all whm accounts at once too!

    0
  • cPRex Jurassic Moderator

    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.