2
2
So a DNS zone file contains an SOA record specifying the authoritative name server, along with some other information such as a "serial number".
I'm trying to understand the purpose of the serial number. Googling around for answers, I found the following explanation:
Serial numbers in DNS zone files provide a way for the server to verify that the contents of a particular zone file are up-to-date. If the serial number in a zone file hasn't changed since that zone was last loaded, named figures that it can ignore the file. This means that sysadmins have to remember to update the serial number every time they make a change to a zone file -- otherwise, their changes won't be picked up and published.
I don't understand this explanation, and the fact that this requires sysadmins to remember to manually update the serial number seems insane.
So, what's the purpose of the serial number? It can't be for other DNS servers to verify if a particular record is out-of-date, because that's what the TTL is for.
So, why is it important to have a serial-number? Why not just have the DNS server re-read the zone file when a change is made?
1Any reasonable zonefile editor will increase the serial number automagically. Also, the serial number is a useful debugging tool for the DNS admin, by comparing the number retrieved from a resolver with the number in the zonefile, the admin can rule out (or find) DNS caching as source of a problem. The zone file format depends on the DNS server though: PowerDNS e.g. natively uses SQL-based databases, while the dominant text-file format you are probably referring to is the BIND format. – Jonas Schäfer – 2014-10-15T14:38:24.433
1@JonasWielicki I've seen three types in the wild; the YYYYMMDDNN format mentioned (ISO 8601 date plus two-digit sequential integer will "always" fit within 32 bits, for any reasonable definition of "always", for reasonable definitions of "reasonable", ...), a simple sequential integer, and what looks suspiciously like Unix 1970-epoch timestamps. The only real requirement is that when encoded as a 32-bit integer, the SOA RR serial number field must be incremented when you want slave servers to initiate a zone transfer following either refresh SOA queries or NOTIFY messages from the master. – a CVn – 2014-10-15T14:45:36.987