identifying non-authoritative DNS zone files

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
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...
 

SoftDux

Well-Known Member
May 27, 2006
1,024
5
168
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?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
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.
 

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
Yes, you can and indeed should delete zones that you aren't authoratitive for.
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.

... should be a fairly simple thing to do, especially if you know perl.
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?
 

web12

Well-Known Member
Nov 20, 2002
240
0
166
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?
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?