[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DNS servers



Sanders writes:
> the alleged documentation for tinydns-data is atrocious too, it's ALL
> done by example, no syntax definition, no overview.

In fact, http://cr.yp.to/djbdns/tinydns-data.html contains the syntax
definition, a bunch of examples, and a link to a tutorial page.

  [ the tinydns data syntax is ``bizarre and broken'' because ]
> the PTR record is automagically created when you create the A record

In fact, you're perfectly free to create just an A record (+fqdn:ip),
just a PTR record (^blah.arpa:fqdn), just an MX record (@fqdn::mx), just
an NS record (&fqdn::ns), just an SOA record (Z...), etc. You can play
with TTLs, serial numbers, and so on, in as much detail as with BIND.

Or you can work with slightly higher-level concepts such as hosts
(=fqdn:ip, creating A+PTR), mail exchangers (@fqdn:ip, creating MX+A),
and name servers (.fqdn:ip, creating SOA+NS+A)---concepts that BIND
doesn't support because they can involve more than one zone.

> get this, it really takes the cake, either or both of the A & PTR
> records are completely ignored unless there are appropriately
> corresponding NS records somewhere in the file.

In fact, the text you're talking about---``Remember to specify name
servers for some suffix of fqdn; otherwise tinydns will not respond to
queries about fqdn''---refers to a basic part of the DNS architecture.
The equivalent BIND rule is that every record needs to be in a zone.

> you can't find the A records for a given hostname just by searching
> for the "=" lines, you also have to parse every other line in case an
> A record is automagically defined elsewhere, e.g. in "&" or "." or "@"
> lines.

If you want a program to work with A records rather than higher-level
concepts, you can use tinydns-get to do a particular address lookup, or
you can use the following script to print out every address and name:

   #!/bin/sh
   sed 's/[ 	]*$//' /service/tinydns/root/data | awk -F: '
     function printx(type) { 
       if (!match($3,/\./)) $3 = $3 "." type "." substr($1,2)
       sub(/^\./,"",$3)
       print $2,$3
     }
     /^@/     { if ($2) printx("mx") }
     /^[\.&]/ { if ($2) printx("ns") }
     /^[=+]/  { if ($2) print $2,substr($1,2) }
   '

This is another example of how easy it is to parse the tinydns
configuration syntax. Can you show me a script for BIND that reliably
does the same thing? Parse named.conf to figure out the active zone
files; parse the zone files; don't forget to deal with $ORIGIN and
$INCLUDE and $GENERATE ...

Of course, the above script can easily be modified to change a selected
IP address, or to start your editor on the appropriate line in the data
file, or to adjust TTLs, etc.

---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago



Reply to: