North American Network Operators Group

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

Re: djbdns: An alternative to BIND

  • From: Paul Vixie
  • Date: Fri Apr 08 23:50:17 2005

oddly enough, i still consider this on-topic, even though it has more to
do with sysadmin than netops.

[email protected] (Adam McKenna) writes:

> Try writing a script to parse BIND zone files.

why on earth would i want to do that?  BIND might be storing it in SQL or
BerkeleyDB or some other DB/SDB/DBZ container.  or the server might not be
BIND at all.  the right way to do this is in Perl if you've got it:

        our $zones = { };
        $res->nameservers($ns);
        my @zone = $res->axfr($mz);
        foreach my $rr (@zone) {
               next unless $rr->type eq 'TXT';
               my ($name, @words) = ($rr->name, $rr->char_str_list());
               my ($attr, $value) = @words;
               $name =~ s/$mzp//;
               $zones->{$name}->{$attr} = $value;
        }

as operators we should all strive to make our tools as robust and as
independent as possible.  i'm very glad that nothing i've written depends
on the format of zone files.

if you don't have perl, just use "dig", pipe it to awk or sed or cut or
whatever, and once again you'll have a server-independent format.  AXFR
is your friend, don't ignore it.

> > (not that I dislike djbdns, i just don't understand why things have to be
> > 'different' so very much... and if bind works, why use djbdns?)
> 
> A Honda Civic will get you to work and back, so why buy an M3?

because there might be a hill.

> As with many other things in the IT world, this decision boils down to
> several factors.  Who wrote it, or how popular it is, if you are a true
> techie, should be close to the bottom of that list.

amen.
-- 
Paul Vixie