Posting to Newsgroup

Brian Wellington Brian.Wellington at nominum.com
Tue Jul 10 04:15:10 UTC 2001


On Mon, 9 Jul 2001, Kevin Darcy wrote:

> > I am trying to get down as far as I can go, perhaps I will be able to have a
> > go at the actual BIND source code someday.
>
> A word of advice: don't bother with the BIND 8 source code if you're eventually
> planning on working with BIND 9. When they say "complete rewrite", they mean
> it! There's really *no* similarity at all between the two code bases. Obviously
> the rewrite is a good thing in the long run. But the learning/familiarization
> curve for BIND 9 is much steeper. At least, that's my experience so far.

I'm not sure if the learning curve is steeper.  BIND 9 is a lot more
modular, which should make the code easier to understand.  The split
between generic dns code and server code is done better, although probably
not perfect, and the library code is (usually) documented.  Some of the
code (query.c, for example) is hard to follow, but the ns_req/ns_resp
mess from BIND 8 wasn't any better.

> > For now I just want to create and
> > parse resolver packets and resource records, to have a fine grained control
> > over my servers and incidentally understand more about DNS as a whole. ( If
> > IPv6 became current tomorrow, I would have to return to grade school).
> >
> > For now, I need a programming API that can do the basic stuff. Perl is fine,
> > but C, assembly (really!) or other languages (C++, Java, Python?) have the
> > low-level capabilities I'm looking for. Particularly C or similar languages.
> > Maybe even Forth.
>
> How low-level do you need to go? I've been using the Net::DNS Perl module
> lately, and it gives you access at the RR level, differentiated by section, and
> all of the relevant bits of the header. You can even do Dynamic Update with it,
> theoretically (although I haven't used that part yet). About the only thing it's
> missing is the newer A6 and DNSSEC stuff. What's more, since it's Perl, you
> don't have to fart around with defining your own data structures; you can use
> Perl's lists, hashes, references, etc., and you don't have to compile anything
> or worry about version- or platform-compatibility. Also, if you're doing
> DNS stuff in conjunction with some other API (e.g. most of my Net::DNS stuff
> lately has consisted of cute little CGI scripts), you can just pull in some
> other module (e.g. the CGI module, LDAP module, mysql module or whatever) and do
> what you need with that module from the same script, without having to deal with
> some blecherous, over-engineered "C" API and link with a zillion bloated
> libraries.

I could plug dnsjava (http://www.xbill.org/dnsjava), which supports all of
the common (and more) RR types, and is being used by a number of programs.
It does handle A6 and DNSSEC.

adns (http://www.chiark.greenend.org.uk/~ian/adns/) looks like a useful C
library, but I've never used it.

I'd definitely stay away from libresolv if possible, because it's very low
level and forces the caller to do too much work.

The BIND 9 lightweight resolver (lwres) is probably not what you're
looking for.  It's designed to be linked into client applications that
aren't DNS aware - it uses a different protocol than DNS, so doesn't
contain code to help parse DNS packets.  It will, at some point, contain
routines for parsing the results of getrrsetbyname(), but doesn't yet.

Brian



More information about the bind-users mailing list