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
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).