On Thu, 22 Jul 2010 11:44:55 -0400, "Atkins, Brian (GD/VA-NSOC)" <brian.atki...@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@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users