[41031] in North American Network Operators' Group
Re: DNS Parser
daemon@ATHENA.MIT.EDU (Greg A. Woods)
Tue Aug 28 14:24:25 2001
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: woods@weird.com (Greg A. Woods)
To: nanog@merit.edu (North America Network Operators Group Mailing List)
In-Reply-To: <g3k7zogjk2.fsf@as.vix.com>
Reply-To: nanog@merit.edu (North America Network Operators Group Mailing List)
Message-Id: <20010828181615.77521E8@proven.weird.com>
Date: Tue, 28 Aug 2001 14:16:15 -0400 (EDT)
Errors-To: owner-nanog-outgoing@merit.edu
[ 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 <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>