Saturday, January 31, 2009

MaraDNS snapshot update: IPs for non-existent hosts now work

I have released a snapshot of MaraDNS today. The feature sponsored by XenoBank now works; it is now possible to configure MaraDNS to give someone an IP instead of a SOA answer.

This hasn't been documented yet, but doing it is very easy. To try it out, download the 20090131 snapshot of MaraDNS then extract and compile the source code.

Next, use this version of MaraDNS to ask for a nonexistent hostname like "fooz.example.com":

dig @127.0.0.1 fooz.example.com.

You will get a standard "this host does not exist" answer (a SOA in the NS section of the answer).

Next, add a line like this to your mararc file:

notthere_ip = "10.11.12.13"

Now, restart MaraDNS and look up "fooz.example.com" again with dig.

This time, you will get a 0-ttl answer with the IP 10.11.12.13.

So, it works.

This doesn't mean we're ready to release 1.3.13 with this feature implemented. There is a lot to be done:
  • Should we also have the option to create a bogus IP like this when there is no reply from a remote server?
  • Are there cases where we will get this bogus IP right now when getting no reply
  • I need to make a SQA test case that verifies this feature works
  • I don't think the code leaks memory, but make sure it doesn't
  • The bogus IP reply doesn't use DNS compression for the answer; since it's just a copy of the query, this is easily enough fixed (just add the 2-byte compression pointer and type of 1 instead of copying the query again), Should this be done?
  • Document how to do this
Also, since I am devoting more work to MaraDNS in 2009 than I originally planned to, I am restructuring the snapshot directories of MaraDNS 1.3 to have a different directory each month. The "2009" link is now just a symlink to the 200901 (January of 2009) directory, so old links posted on this blog continue to work. Starting tomorrow, I will make a "200902" directory and put February snapshots in that directory.

Again, the new snapshot can be downloaded by clicking on this link and selecting the 20090131 version of MaraDNS (maradns-Q-20090131-1.tar.bz2).