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.

Clean up DNS mess.

Discussion in 'Bind / DNS / Nameserver Issues' started by billy79, Dec 21, 2008.

  1. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Okay I have a bit of a DNS mess on my hands. i am hoping there is a simple solution out there and maybe someone here can point me in that direction.

    Here's a quick synopsis of how we got into this mess.

    Years ago we ran our servers with clustered DNS and we did so using the Round Robin set up, so all dns zones were synced between all servers.

    After about 6 months of that we launched a DNS Only box and synced to that as well as syncing to one other server that we use for a couple corporate websites and as our other DNS server.

    Everything worked great, as we made changes (such as moving accounts between servers which we did) the updated zones were synced to the DNS servers and life was good.

    However I never cleaned up the zones off the old servers. Since they were once running in round robin we still had zones for all domains on all servers stored on almost all servers.

    Skip ahead another 2 years and we moved all of our servers into our own IP space. When I ran the scripts to update the DNS Zones to the new IP's they updated all the zones, including the old zones that were meant for other servers that were still laying around due to the old Round Robin days.

    So when we synced with the DNS server it made a mess, zones were all overwriting each other, etc.

    We quickly killed syncing and manually moved whatever zones around to the DNS servers that we had to so that everything pointed to the correct place.

    I still have not re-enabled syncing, so everytime a domain is added I am manually syncing the DNS zones from whatever server they are added on to the DNS server.

    I really want to fix this mess.

    I know what needs to be done, I need to get it so that each server only has a copy of the DNS records that are used on that particular server and all the other unused zones are removed. Then I will launch a new DNS server and sync one server at a time to that new machine.

    So the big thing is, what is the easiest way to clean out the old unused DNS records off each box?

    I see there is a script /scripts/cleandns8 but I am not sure if that will do what I want

    I guess I need a script that compares the zones in named.conf to the apache entries in httpd.conf and if there is a zone without a site it will remove it from named.conf and nuke the zone.

    Does the cleandns8 script do that? If not is there one that does?

    Does anyone else see a different solution I should be looking for?

    Thanks in advance for your help.
     
  2. yolau

    yolau Active Member

    Joined:
    Sep 1, 2008
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    I believe that /scripts/rebuilddnsconfig is what you are looking for.
     
  3. billy79

    billy79 Active Member

    Joined:
    Dec 15, 2004
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    I was just turning down a box that was part of this mess, so I figured it would be a perfect test subject.

    The box only has about 10 domains on it but due to the sync issue described in my first post there are a few hundred DNS records on the server.

    I ran the /scripts/rebuilddnsconfig and there are still all of those extraneous DNS records on the box.

    Is there a different script that does a better job of cleaning this up?
     
  4. wwwcad

    wwwcad Member

    Joined:
    Oct 4, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page