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.

identifying non-authoritative DNS zone files

Discussion in 'Bind / DNS / Nameserver Issues' started by spaceman, Oct 31, 2006.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    My understanding is that if a zone file exists on my server for a domain where that domain is delegated to nameservers other than my own, then this zone file on my server is 100% redundant and may be deleted.

    If this is the case (anyone disagree?) then does anyone know of a script that can read through the list of zone files on a server and identify whether they are authoritative or non-authoritative?

    Long shot, but if you don't ask...
     
  2. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    You could try the following:

    loop through the list of domains on your server (active clients?), and compare this list with the DNS zones. As an added measure, you could probably "dig" each suspected domain to make sure it's not meant to be on one of your servers, and then remove it.

    But doesn't cPanel automatically remove such domains if you terminate the account?
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It does delete them, but the OP may be hosting domains for which they aren't authoratitive.

    Yes, you can and indeed should delete zones that you aren't authoratitive for. I don't know of a script that will do that for you, but as SoftDux suggests, it should be a fairly simple thing to do, especially if you know perl.
     
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Yup. Only yesterday I took ages to work out why emails sent by client A weren't being received by client B (and client A wasn't getting any bounced failure messages back). Answer: the small local ISP of client A used to host the domain of client B, and had never fully purged the zone file for this domain - so emails from A to be were accumulating on the ISPs server.

    Therein lies my problem! If anyone wants to give me a quote to knock up such a script...

    The script should return a list of zone files on the target server that do not appear to be authoritative and with the option to purge them all. This same script might also be in a position to clean up redundant (although probably harmless) entries in /etc/localdomains and /etc/remotedomains?
     
  5. web12

    web12 Well-Known Member

    Joined:
    Nov 20, 2002
    Messages:
    240
    Likes Received:
    0
    Trophy Points:
    16
    Hi Guys

    Did you ever come across a script for doing this? Ive recently removed a server from a cluster and would like to remove all the redundant zone files and leave just the zone files that should be there... ie the ones listed in /etc/localdomains.

    Any pointers?
     
Loading...

Share This Page