Course contentsShow
← Computer Science
Lesson 1508 of 2,87235. Application Layer ProtocolsFree lesson

DNS Resolution Process: Iterative Queries

Understanding iterative queries where nameservers return referrals, requiring the client to make successive queries up the hierarchy.

DNS Resolution Process: Iterative Queries

You'll learn how DNS resolvers navigate the hierarchy step-by-step when nameservers provide referrals instead of final answers.

What Are Iterative Queries?

In an iterative query, the DNS resolver does all the work of walking up and down the DNS hierarchy. When you contact a nameserver, it doesn't fetch the answer for you—instead, it gives you a referral pointing to the next nameserver that might know the answer. Your resolver must then make another query to that referral, repeating the process until it gets a definitive answer.

How It Works

Imagine asking for directions at a gas station. Instead of giving you the full route, the attendant says, "I don't know exactly, but ask the person at the library down the street." You drive there, ask again, and they say, "Try the post office on Main Street." You keep asking until someone finally gives you the complete directions.

Here's the DNS version for looking up www.example.com:

  1. Your resolver queries a root nameserver
  2. Root responds: "I don't have that, but ask the .com nameserver at this IP"
  3. Resolver queries the .com nameserver
  4. .com responds: "I don't have that, but ask example.com's nameserver"
  5. Resolver queries example.com's authoritative nameserver
  6. Finally gets the A record with the IP address

Iterative vs Recursive

Unlike recursive queries (where the nameserver does the legwork), iterative queries put the burden on the client resolver to follow each referral manually. Most actual DNS implementations use recursive queries to local resolvers, which then use iterative queries to contact other nameservers.

Key Takeaway: Iterative queries return referrals instead of answers, requiring the resolver to make successive queries up the DNS hierarchy until reaching the authoritative source.