Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Reset ALL DNS Zones

Discussion in 'Bind/DNS/Nameserver' started by Shawn Paul, Apr 17, 2017.

Tags:
  1. Shawn Paul

    Shawn Paul Member

    Joined:
    Apr 17, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nairobi
    cPanel Access Level:
    Root Administrator
    I've tried to follow the guidelines at;DNS Zone Reset ALL

    However, I get an error when trying to add the dns after deleting. I'm logged in as root;

    root@root [~]# /scripts/killdns abccc1111.org
    abccc1111.org => deleted from root.
    abccc1111.org => deleted from root.
    abccc1111.org => deleted from svr.

    root@root [~]# /scripts/add_dns --domain=abccc1111.org
    No valid IP specified. Using 111.1111.111.1111
    Sorry, the domain abccc1111.org is owned by another user (abccc11)

    I'm able to delete and add via WHM but after selecting the associated domain in the 'Domain Owner information' section. My problem is there are hundreds of accounts to reset DNS to default and manually changing for each domain will take a long time.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Are you sure the domain name in-question isn't added to an existing account as the primary domain name, or an alias/add-on domain name? You can check with a command such as:

    Code:
    grep $domain /etc/userdomains
    If so, you'd need to first remove the domain name from the existing account before adding it to a new one.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Shawn Paul

    Shawn Paul Member

    Joined:
    Apr 17, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nairobi
    cPanel Access Level:
    Root Administrator
    Hello,

    Thanks for the quick reply.
    The domain 'abccc1111.org' is rightfully owned by cpanel user 'abccc11'. What I wanted was to delete and re-add the DNS zone while logged in as root user.

    I was trying for one user and if it worked then I would have used the following to reset for all cpanel users on the server:

    #############
    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
    #############

    Is there a different [or better] way of resetting the DNS zones of all cPanel Accounts via SSH? I have a server which was recently migrated and some domains' A records are still pointing to the old server IP. Resetting DNS, or deleting and adding DNS for each domain in the new server is resolving the issue. Problems is that the server has hundreds of cpanel users. I wanted a way of resetting all DNS zones [for all cPanel users on the server] to default.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    There are no native features that will allow you to reset the zone for multiple DNS zones at the same time, however I encourage you to vote and add feedback to the existing feature request for this functionality at:

    Multiple Domain (DNS Zone) Reset/Update

    As a workaround, you could use the instructions on the following thread to replace the "A" record from one IP address to a different one:

    Bulk DNS Zone Update

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Shawn Paul

    Shawn Paul Member

    Joined:
    Apr 17, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nairobi
    cPanel Access Level:
    Root Administrator
    This is noted with thanks.
    I already used the guide at Bulk DNS Zone Update to successfully replace name servers on a different server yesterday.
    For this server I've found that ns1 and ns2 are correct. Now I just need to ensure that the A record for all cpanel accounts points to the new server IP and not the old server IP. Is there a way of doing so via command line?
     
  6. Shawn Paul

    Shawn Paul Member

    Joined:
    Apr 17, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nairobi
    cPanel Access Level:
    Root Administrator
    Sorry, the issue of replacing A record seems mentioned in the thread you pointed to. It's just not very clear to me. I need a command to replace the old server IP with the new server IP in the A records.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice