An iterative DNS query asks a DNS server to resolve a name but permits either a definite answer or a referral to another DNS server. The querying recursive resolver follows those referrals through the DNS hierarchy until it reaches an authoritative answer. section 3.1.4 section 3.3
A typical lookup proceeds as follows:
- The recursive resolver sends an iterative query to a root DNS server for the requested domain. section 3.1.4
- The root server refers the resolver to the appropriate TLD server, such as a server responsible for the com TLD. section 3.1.4
- The TLD server refers the resolver to the authoritative DNS server for the domain. section 3.1.4
- The authoritative server returns the domain's definitive record, and the recursive resolver replies to the client. section 3.3
- Caching can terminate the process earlier when the resolver already has a valid entry. section 3.1.4
Resolving mail.google.com
When 8.8.8.8 lacks a cached entry for mail.google.com, it queries a root server, follows a referral to the com TLD server, follows another referral to Google's authoritative DNS server, and receives the answer. PC1's exchanges with 8.8.8.8 are recursive; the exchanges between 8.8.8.8 and hierarchy servers are iterative. section 3.1.4
A Cisco router can act as a DNS server for local clients, but its client-facing queries and upstream queries may be recursive. The upstream resolver, such as 8.8.8.8, performs the iterative work and returns the result for caching and delivery to the client. section 3.2.2
