Script for verifying zone files

urs-t.bolliger at ubs.com urs-t.bolliger at ubs.com
Thu Jul 22 17:08:20 UTC 2010


Hi Brian,

Why don't you load the zonefile you changed into a test dns server and
then compare the queries against prod and your test system? Might be
easier than parsing the file in my opinion.

Regards,

Adrian

-----Original Message-----
From: bind-users-bounces+urs-t.bolliger=ubs.com at lists.isc.org
[mailto:bind-users-bounces+urs-t.bolliger=ubs.com at lists.isc.org] On
Behalf Of Atkins, Brian (GD/VA-NSOC)
Sent: Donnerstag, 22. Juli 2010 19:02
To: bind-users at lists.isc.org
Subject: RE: Script for verifying zone files

Thanks, Bill. That's more what I'm looking for.

Several people suggested looking at named-checkzone, but my goal is to
compare an edited version of the zone file against the active zone file.
The named-checkzone program, to my understanding, merely checks for
syntax and doesn't do anything with actual verification of the records.

Brian 


-----Original Message-----
From: wllarso [mailto:wllarso at swcp.com] 
Sent: Thursday, July 22, 2010 12:45 PM
To: Atkins, Brian (GD/VA-NSOC)
Cc: bind-users at lists.isc.org
Subject: Re: Script for verifying zone files

On Thu, 22 Jul 2010 11:44:55 -0400, "Atkins, Brian (GD/VA-NSOC)"
<Brian.Atkins2 at va.gov> wrote:
> Does anyone know of an existing script or program that can parse a
zone
> file and verify records against an active server?
> 

Oh, a challenge.  Thanks

> I'm attempting to clean up some large zone files and want to ensure
that
> none of the changes will break DNS when I implement it. Later, I'd
like
> to use it to verify that the records point to active hosts, but that's
> later.
> 
> I started putting together a bash script, but I'm having issues where
a
> record exists on multiple lines. For example:

Since, in a zone file, any line that begins with white space (tab or
space
character) will use the same left hand side name as the previous line.
So,
using AWK, you could do something like:

    awk 'BEGIN{LHS=""}/^[WS]/{print LHS,$0;next}{print $0;LHS=$1}'

(Guaranteed NOT to work without lots of tweeks and testing.  Use at your
own risk!)

Now, as to checking that "the records point to active hosts", well, I
won't even try for that.  What do you mean by "active"?

But, as someone else said, look at "named-checkzone".

Bill
_______________________________________________
bind-users mailing list
bind-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users
Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.
	
E-mails are not encrypted and cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses.  The sender 
therefore does not accept liability for any errors or omissions in the 
contents of this message which arise as a result of e-mail transmission.  
If verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities 
or related financial instruments.

 
UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.



More information about the bind-users mailing list