Tuesday, April 10, 2007

MaraDNS update: TTLs are messy



TTLs are very messy in BIND zone files. Sunday afternoon, I worked on the bind2csv2 script to handle BIND's somewhat unusual handling of TTLs when the SOA record has a TTL (see previous blog entires for the gory details). Well, when I was doing TTL testing Sunday, I realized BIND has another wrinkle with TTL setting:
  • All NS records have the same TTL
  • This TTL is determined by the TTL of the last record in the zone
So now I have to kludge in some code to set all of the TTLs for NS records to have but one TTL: The TTL of the last record. Now, why BIND uses the TTL of the last record in the zone file instead of the first record is a mystery to me, but it makes writing the script more difficult.

I'll probably have to kludge the TTLs when people put delegation TTLs in BIND zone files.

Come to think of it, I see no reason to implement this for the moment. People should use the same TTL for all NS records; if they don't, well, they should fix their zones.

So, yes, this is a known "bug", but I think it's more important to handle BIND's handling of backslashes in TXT records. Another issue: I should add support for the NAPTR record type (someone asked for this late last year)

Anyway, the snapshot has been updated. Check it out
- Sam