Glossary · ENCheck a domain

DNS cache

A DNS cache is temporary storage for answers to previous DNS lookups. A DNS lookup service called a recursive resolver, a device, or software may keep a result so the next request does not have to repeat the full lookup. Caching can make name lookups faster and reduce repeated requests to the nameservers that publish the DNS information.

How does a DNS cache affect an answer?

Each DNS record has a TTL, or time to live, that says how long a resolver may reuse the answer before checking again. If www.example.com was looked up and its address is cached for one hour, a change made to the authoritative DNS data a few minutes later may not be seen by that resolver immediately. Once its cached answer expires, it can ask again and receive the current data.

Different resolvers may have different cached answers because they received them at different times. Some resolvers can also return expired information for a limited time during an outage to improve reliability. Therefore, seeing an old answer in one network does not by itself prove that the DNS change was entered incorrectly; compare the authoritative data and the relevant resolver's cache.

Can a cache store that a name does not exist?

Yes. DNS resolvers can also cache certain negative answers, such as a response that a name or record does not exist. This helps avoid repeating the same unsuccessful lookup. If someone creates the missing record shortly after a resolver cached a negative answer, that resolver may continue to report the earlier result until the negative cache entry expires.

For example, a site owner adds new.example.com but an office resolver had recently cached that the name was missing. The owner may be able to see the new answer using another resolver while office users still receive the cached negative result. Negative caching has its own timing rules and is not necessarily the same TTL shown beside an existing A or TXT record.

Related terms