1

In an iterative DNS query, requests made by the local DNS server to the root, TLD and authoritative servers can be cached inside the local DNS. Whereas in the recursive query, only the specific hostname to IP address can be cached in local DNS server. Does this mean that iterative DNS queries are faster since it contains more entries cached in the local DNS server ?

If that is not the case would there be a difference between the two methods.

1 Answer 1

2

In recursive DNS query, the client only sends the query to the first DNS server. The server, if it cannot answer, will send the request to next server and so on, until the query is resolved. Here the DNS client requires that the DNS server respond to the query, so the burden is on Server to resolve the query.

In iterative DNS query, the client is responsible for sending the query to successive servers, until the query is resolved by hitting a server that is authorized for the domain name (or until an error or time-out). Here the burden is on the client to resolve the query.

I don't think that there is a big difference in speed between the two, except that a DNS server that is high enough in the hierarchy will likely have available a faster Internet connection than the client.

For the iterative DNS query, the client will end up with having the successive intermediate DNS servers in its cache, but I don't see how it may use this to advantage.

In more detail, these are the four most common answers a DNS server can provide:

  • Authoritative - a positive answer returned to the client with the Authoritative Answer (AA) bit set in the response.
  • Positive - an answer that contains the resource record (RR) or list of RRs that match the query.
  • Referral - an answer that contains a list of alternate servers the client can use to resolve the name. This type of answer is given if Recursion is not supported.
  • Negative - this answer indicates that an Authoritative server reported that the name (or record type) does not exist in the DNS name space.

In the Iterative query, the client sends a query to the server. If recursion is disabled, and the server cannot answer the query, the server will respond with a Referral answer. The client will then use that information to query another DNS server. This process will continue until a server responds with an Authoritative or Negative response, or until the client runs out of time.

2
  • I see would the local DNS server in the iterative version contain more intermediate DNS entries leading which allows the DNS to bypass root servers for example ?
    – calveeen
    Nov 20, 2018 at 14:27
  • As far as I know, clients may keep caches of results but not of DNS servers. I don't know of any client that caches DNS servers, and it seems to me that a client will always start with a query to the defined network DNS server and will not try itself to function as a DNS server.
    – harrymc
    Nov 20, 2018 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.