North American Network Operators Group

Date Prev | Date Next | Date Index | Thread Index | Author Index | Historical

Re: DNS Parser

  • From: Andrew Brown
  • Date: Mon Aug 27 17:33:44 2001

>Does anyone know of a simple script that will go through a list of BIND
>primary files, or more and output a list of output like this:
>secondlevel.domain --> address
>thirdlevel.secondlevel.domain --> address
>and so on for several thousand domain files.
>We acquired a company that never kept their reverses up to date and need a
>simple way of building them to keep track of their IP utilizations.
>There is probably one written in perl out there somewhere, I'd appreciate a

it would probably be easy enough to throw one together, however, i'd
suggest sucking all the zones directly out of bind via axfr instead of
reading the zone files directly.  that "normalizes" the output to
something you can pass through grep rather easily.  ex:

   % dig axfr @ | grep '\<IN.A\>'
   home                    5M IN A
   localhost               1D IN A
   www                     5M IN A
   wombat                  5M IN A

from there it's only a short hop to reversing the information.

|-----< "CODE WARRIOR" >-----|
[email protected]             * "ah!  i see you have the internet
[email protected] (Andrew Brown)                that goes *ping*!"
[email protected]       * "information is power -- share the wealth."