Linux dnsmasq: how to increase the ttl


Is it possible to dictate the TTL of resolved entries? In other words, is it possible to override the received TTL for resolved entries and make those higher?

Reason: I find that dnsmasq tries to resolve too often for my taste.

Best Answer

I don't think you can, not easily. The TTL is set by Google's nameservers and they like it low for loadbalancing purposes.

It's possible that increasing the cache size could help, but for super-short TTLs like Google's it probably won't.

Unofficially, there are a couple of patches to provide a TTL-override functionality. I found these on the dnsmasq-discuss mailing list, so if you feel like rolling your own, try them out (you might check the mailing list archives for patches against more recent versions):