We run a latency-sensitive system. We found one significant cause of latency: some processes were making blocking DNS lookups to remote nameservers. To mitigate this, we have installed a local caching DNS resolver, specially dnsmasq
.
But we still see occasional significant pauses where queries to the local DNS cache (dnsmasq
) can take a long time. These are caused by TTL expiry; in these cases dnsmasq
queries its upstream server before responding to the local process.
We would like to eliminate these pauses, too. I would like our local DNS cache to always respond immediately, even if the response is stale. The cache should query its upstream server asynchronously. For example, if the cache serves a stale response, it could refresh this asynchronously. Or a more sophisticated policy would be to refresh the cache asynchronously shortly before the TTL expires.
But I can't find any such setting for dnsmasq
, or for any other caching DNS servers I've looked at. Are any DNS servers designed to run in this configuration?