Linux – Is it possible to setup a DNS resolver that ignores the TTL

domain-name-systemlinux

Is it possible to setup Unbound (or maybe BIND) to be a resolver that increases the TTL on records it resolves?

Basically, I am having trouble with a DNS server that has very low TTL (60 minutes) on its records that is apparently being rebooted. I am getting some random "unknown host names" when apparently it is being rebooted. If I could setup a resolver to cache the entires and possibly increase the TTL locally or fail over to last entry. Is that even possible?

Best Answer

IMHO unreliability of the server is not a problem for the clients to solve! DNS has sufficient built-in provisions for redundancy, back-up name servers etc.

The hostmaster sets the TTL, which is an instruction that you may cache this record at most TTL seconds.

If you're allowed to do a zone transfer you may run as slave of that faulty zone, which may have a longer expiry then the TTL of the records in that zone.

Caching records longer then their TTL is generally considered a bad idea. Caching records shorter then their TTL allows is according to standards, therefore bind has a max-cache-ttl option and not the reverse.

Unbound does though:

cache-min-ttl:

          Time  to  live  minimum  for  RRsets  and messages in the cache.
          Default is 0.  If the the minimum kicks in, the data  is  cached
          for longer than the domain owner intended, and thus less queries
          are made to look up the data.  Zero makes sure the data  in  the
          cache is as the domain owner intended, higher values, especially
          more than an hour or so, can lead to trouble as the data in  the
          cache does not match up with the actual data any more.
Related Topic