North American Network Operators Group

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

Re: DNS Parser

  • From: Greg A. Woods
  • Date: Tue Aug 28 14:26:28 2001

[ On , August 28, 2001 at 10:50:53 (-0700), Paul Vixie wrote: ]
> Subject: Re: DNS Parser
>
> output.  Much as it pains me to recommend the use of "nslookup" by anybody for
> anything, it has a reasonable way of doing this:
> 
> 	nslookup <<EOF | awk yada yada
> 	server $MASTER
> 	ls -t A $ZONE
> 	EOF

The new version of host (i.e. the one that's usually only slightly out
of date in the BIND contrib directory, NOT the junky old useless one in
the main BIND src/bin directory) is much less painful to recommend (and
has equally regular and predictable output):

	host -a -l $ZONE $SERVER | awk 'blah'

You can of course have 'host' do the filtering for only specific types
of records too.  For example to display only 'A' records:

	host -t a -l $ZONE $SERVER | awk 'blah'

You can even omit the $SERVER parameter and 'host' will try all the
authoritative servers until it succeeds.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <[email protected]>     <[email protected]>
Planix, Inc. <[email protected]>;   Secrets of the Weird <[email protected]>