DNS caching

from Wikipedia, the free encyclopedia
Windows 7 DNS cache, retrieved with ipconfig . You can see the entry wikipedia.de , the associated name server and the negative entry wipieda.de

DNS caching keeps the result of a recursive DNS - Name resolution for some time in the local long cache prior to another identical DNS queries to answer immediately, without having to ask again in the name servers. The aim is to relieve the responsible name server and save time, since a request can be answered more quickly from the cache than by making another request to the responsible name server. The length of time for which an entry in the cache is valid is by its TTL value (Engl .: Time to live ; dt .: living time determined). The TTL value is set by the authoritative name server of the relevant zone that answered the original request.

DNS caching is used for components in computer networks that send requests to resolve domains and, accordingly, can temporarily store the response. These include, for example, the resolver of the operating system, the name server of the Internet access provider and some applications such as web browsers.

Exactly one TTL value is assigned to each DNS entry . This comprises 32 bits and can therefore assume very large values ​​(several decades). The value is given in seconds. A TTL of 3600 corresponds to one hour. 0 means: This resource record must not be stored in the cache. The content of the cache is usually only in volatile memory and does not survive the restart of the component. The possibility of setting a period of several weeks or even longer is therefore of no practical relevance.

Negative caching

The original DNS specification does not provide for caching an NXDOMAIN response, i.e. the information that no entry is assigned to a requested domain name. To further relieve the responsible name servers, this behavior was subsequently specified as negative caching ( RFC 2308 ). Similar to standard caching, it is noted in the cache that the name of the responsible name server was unknown. In the case of repeated requests, the corresponding negative response can be made from the cache.

Since there is no time to live for a name that does not exist, the period of time for which a negative entry is kept in the cache must be determined in another way. For this purpose, the meaning of the MINIMUM field in the SOA resource record has been changed. The original meaning as the minimum TTL of all entries in a zone was not used in practice anyway. The new meaning is the TTL of all negative responses for a zone. In order to inform the inquirer of the negative caching duration, the SOA entry of the corresponding zone is sent with every negative response.

In cases where the name resolution fails for other reasons, such as incorrectly configured zone responsibilities or network failures, the requesting party is free to also save the result in the cache. Since the TTL cannot be reliably determined here, a freely selectable period of up to 5 minutes is permitted.