Skip to main content

Recursive/iterative query and DNS records

Short answer

Recursive query: local DNS server fully resolves the name, querying other servers itself. Iterative query: server returns referrals; the requester queries each referred server. DNS records include A (IPv4), AAAA (IPv6), NS (authoritative server), CNAME (alias), MX (mail server), PTR (reverse lookup), SOA (zone authority), and TXT (text). Root servers only accept iterative queries to reduce load.

What is recursive and iterative query? Explain with suitable diagram. Discuss the DNS records.

DNS translates domain names to IP addresses. A client's request for a name can be resolved in two ways.

Recursive query

The client asks its local DNS server and the server takes the complete responsibility of finding the answer. If it does not know the answer, it queries other servers itself and finally returns either the final answer or an error. The client sends one query and gets one reply.

Iterative query

The queried server returns the best answer it has: either the address, or a referral to another server that is closer to the answer. The querier then asks that next server itself. So the burden is on the requester.

Recursive (client -> local), iterative (local -> others)

Host            Local DNS         Root     TLD(.com)   Auth(abc.com)
 |--1 www.abc.com->|
 |                 |--2 query------->|
 |                 |<--3 refer .com--|
 |                 |--4 query------------>|
 |                 |<--5 refer abc.com----|
 |                 |--6 query------------------>|
 |                 |<--7 IP 1.2.3.4-------------|
 |<--8 IP 1.2.3.4--|
PointRecursiveIterative
Work done byQueried serverQuerying client/server
ReplyFinal answer or errorAnswer or referral
Load on root serversHigh (so root servers do not accept recursive queries)Low

DNS resource records

A record format is (Name, Value, Type, Class, TTL).

TypeMeaningExample
AHost name to IPv4 addresswww.abc.com -> 1.2.3.4
AAAAHost name to IPv6 addresswww.abc.com -> 2001:db8::1
NSAuthoritative name server of a domainabc.com -> ns1.abc.com
CNAMEAlias to canonical nameftp.abc.com -> www.abc.com
MXMail server of a domain (with priority)abc.com -> mail.abc.com
PTRIP address to name (reverse lookup)4.3.2.1.in-addr.arpa -> www.abc.com
SOAStart of authority: zone serial, refresh, admin-
TXTFree text (SPF, verification)-

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Networks and Security chapter 6 questions →