Resolver caching

In the context of resolvers, caching is defined as saving and storing information from resolved DNS queries so that the information can be reused. A cache is the area of memory where the information is kept. The primary advantage of caching is the improved performance that is obtained by the elimination of repetitive queries to the name servers.

For example, in the configuration shown in Figure 1, a local caching-only DNS name server is defined to provide some level of resource caching.

Figure 1. Local caching-only name server example
Local name server recursive query process with caching of the referrals and answer

In the caching-only name server model depicted in Figure 1, when a request for host.raleigh.ibm.com is received, the resolver contacts the local name server (see arrow 1). The local name server then must perform standard name-server processing to locate the resource, which might include contacting one or more name servers (see arrows 2 through 9). When the name server that can provide an authoritative response for the queried host name is found and the response is returned to the local name server, the local name server caches the information and forwards it back to the resolver (arrow 10).

However, in the caching-only name server model depicted in Figure 1, subsequent requests to the resolver for information about host.raleigh.ibm.com still require that a DNS query be created and forwarded to the local name server to obtain the cached results. This DNS query can be eliminated if the resolver itself caches the information, as shown in Figure 2.

Figure 2. Resolver caching example
Resolver caching of name server answers

In the resolver caching model, when the initial query of the resolver cache (arrow 1) does not return any host name information, the DNS query is sent to the network name server (arrow 2), which might or might not already have information cached about host.raleigh.ibm.com. When the response is received (arrow 3), the information is cached by the resolver (arrow 4), and subsequent requests for host.raleigh.ibm.com can be satisfied without a DNS query (arrow 4).

Resolver caching is advantageous for the following reasons:

If you have been using a caching-only name server and you want to use resolver caching, see Migrating from a local caching-only name server to resolver caching.

You can disable resolver caching for selected applications; for more information, see Steps for disabling caching for selected applications.