In need of script to compare A records and PTR records

Barry Finkel b19141 at achilles.ctd.anl.gov
Wed Aug 3 14:27:53 UTC 2005


bob_a_booie" <bob_a_booie at excite.com> wrote:

>Can anybody in the comp.protocols.dns.bind recommend a
>shell script or Perl script that compares
>the A records for a zone
>with the PTR records from the corresponding reverse lookup zone
>and reports mismatches or missing entires ?

I wrote some scripts (c-shell and awk) that

     1) Extract all zone names/filenames from a BIND master config
        file.

     2) Extract the "A" and "PTR" records from those files.

     3) Create a master forward file with "nodename IP-address"
   
     4) Create a master reverse file with "IP-address nodename"
        The tricky part is remembering the $ORIGIN to add the prefix
        to the IP address (usually last octet), to form a full
        IP address.

     5) Reverse the order of the two fields in the 4) file.
   
     6) Compare 3) with 5) and report the differences.

They were not complicated to write, and I am sure that I could do a
better job with the scripts.  I am not sure that my scripts would work
in a general situation.
----------------------------------------------------------------------
Barry S. Finkel
Computing and Information Systems Division
Argonne National Laboratory          Phone:    +1 (630) 252-7277
9700 South Cass Avenue               Facsimile:+1 (630) 252-4601
Building 222, Room D209              Internet: BSFinkel at anl.gov
Argonne, IL   60439-4828             IBMMAIL:  I1004994



More information about the bind-users mailing list