DNS root record hardcoded then why it has ttl

domain-name-systemnameserverns-record

I host a recursive name server locally so I don't need my service provider or another public DNS server for name resolution. Although the root name server IP-addresses are hardcoded in the config file (in the Bind /etc/bind/db.root file), when I run several consecutive nslookup commands for the root name server for . , then the TTL field still decreases.

Why would the TTL decrease, when it is harcoded in config file?
And why would a TTL at root level be needed in the first place when it is harcoded?

Best Answer

Typically you would explicitly configure the DNS root servers similar to the snippet below:

zone "." {
  type hint;
  file "/etc/bind/db.root";
};

Where you observe that zone type is not the common master nor slave but a special zone type called hint.

When the name server starts up, it only uses the root hints to find a responding root name server and will then get the current list of root name servers from there. Those are the root servers that will be actually be used during operation.

Since those are cached they will need a TTL and as you have observed: that TTL will decrease like any other cached DNS record.

If no hint zone is specified for class IN, the server uses a compiled-in default set of root servers hints. Source: the Bind Administrator Reference Manual.

As Brian explained in his answer the root zone does change, and as long as at least one name server remains valid the hint zone allows for such changes in the root name servers without requiring all existing name servers to update their static configuration files.

Related Topic