Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can any caching DNS servers refresh their cache asynchronously?

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?

like image 433
jameshfisher Avatar asked Feb 14 '18 12:02

jameshfisher


People also ask

How do you refresh the DNS cache on a server?

Open the DNS Management snap-in. Right-click on DNS in the left pane and select Connect to DNS Server. Enter the server you want to connect to and click Enter. Right-click on the server and select Clear Cache.

How often does the DNS cache refresh?

When a DNS client creates a record, it is assigned a timestamp. The DNS client attempts to refresh this record every 24 hours. Unless the record is changed (for example, the client receives a new IP address), the timestamp cannot be refreshed for a default period of seven days.

What is caching DNS Server?

DNS caching allows any DNS server or client to locally store the DNS records and re-use them in the future – eliminating the need for new DNS queries. The Domain Name System implements a time-to-live (TTL) on every DNS record.

Do DNS servers have a cache?

The DNS cache (also known as DNS resolver cache) is a temporary DNS storage on a device (your computer, smartphone, server, etc.) that contains DNS records of already visited domain names (A records for IPv4 addresses, AAAA records for IPv6, etc.). It keeps those records, depending on their time-to-live (TTL).


1 Answers

Knot resolver with configuration modules = { 'predict' } will start asynchronous refresh of records that are put into answer at a moment when their TTL is close to expiration.

Note that version 2.0.0 has a bug that defeats this refresh for records without DNSSEC signatures (will be fixed in the next release).

like image 159
Vladimír Čunát Avatar answered Sep 22 '22 00:09

Vladimír Čunát