The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DNS Zone Reset ALL

Discussion in 'Bind / DNS / Nameserver Issues' started by romacities, Aug 26, 2011.

  1. romacities

    romacities Member

    Joined:
    Sep 10, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Denver, CO
    cPanel Access Level:
    Root Administrator
    Under:
    Main >> DNS Functions >> Reset a DNS Zone
    There's a list of domains which I can click and reset to default current DNS settings.

    Is there an automated way to reset all domains at once?

    thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There are no tools or scripts included with cPanel that will automatically reset all DNS Zones on a server. I encourage you to open a feature request for such an option via:

    Feature Requests for cPanel and WHM

    Thank you.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    This could be done with two commands in command line. One to kill the DNS zones and one to add the DNS zones. I'm only selecting the domains in /etc/trueuserdomains, which are the main domains. The issue here is going to be that subdomains will be yanked when doing this. You might change to grabbing the list from /etc/localdomains instead without the cut portion. Before doing this, a backup must be made of /var/named and /etc/named.conf:

    Code:
    cp -R /var/named /var/named.bak110826
    cp -R /etc/named.conf /etc/named.conf.bak110826
    The commands would then be to remove and readd the zones:

    Code:
    for i in `cat /etc/trueuserdomains | cut -d: -f1` ;do /scripts/killdns $i ;done
    for i in `cat /etc/trueuserdomains | cut -d: -f1` ;do /scripts/add_dns --domain=$i ;done
    I would highly suggest first running "/scripts/killdns domain.com" for one account, then "/scripts/add_dns --domain=domain.com" for that same account to see the results to ensure they are what you want before proceeding.

    Please note that you could load the list from a precompiled list of domains instead also, then use `cat /root/domainlist` instead of reading from /etc/trueuserdomains. This way you can control what domains are being touched.
     
Loading...

Share This Page