isitdns? wiki/Fundamentals/Query types: recursive, iterative, forwarding
Fundamentals

๐Ÿ” Query types: recursive, iterative, forwarding

Asks a recursive resolver to go and find an answer.

 dig @1.1.1.1 example.com A
; <<>> DiG 9.20.11-0ubuntu0.2-Ubuntu <<>> @1.1.1.1 example.com A
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28546
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 262 IN A 172.66.147.243
example.com. 262 IN A 104.20.23.154
;; Query time: 34 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Wed Sep 23 11:42:05 CDT 2026
;; MSG SIZE rcvd: 72

GO rd and ra on the flags line, and an answer

NO GO rd with no ra, which means that server will not recurse for you

run this query in the dig tool →

what each part of this output means →

RFC 1035 section 4.1.1 defines the RD, RA, and AA bits in the header. RFC 1034 section 4.3.1 describes the recursive and iterative modes those bits select. RFC 9499 is the current DNS terminology glossary.

ModeRDRAAAWho does the walking
Recursive110 (usually)the resolver
Iterative0n/a1 if the server owns the zoneyou, hop by hop
Forwarding110a different resolver, on this one's behalf

Recursive query (RD=1)#

client --RD=1--> resolver --...do the work...--> resolver --answer--> client

Every stub resolver sets RD by default. The client never speaks to an authoritative server directly; the resolver does the walking and returns one answer. The capture above is a recursive query: rd and ra are both set.

Iterative query (RD=0)#

client --RD=0--> resolver
                 returns whatever it has, with referrals if needed
                 client itself walks the next hop

A recursive resolver iterates on the client's behalf: root, then TLD, then the zone's authoritative servers. +norec on dig sets RD=0, for asking an authoritative server directly.

dig -4 @pns2.isitdns.net probe.isitdns.net SOA +norec
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: ...
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
probe.isitdns.net. 5 IN SOA pns2.isitdns.net. hostmaster.isitdns.net. \
    2026082002 7200 3600 1209600 300

aa is set because pns2.isitdns.net owns probe.isitdns.net. rd is absent because the query sent RD=0, and the server leaves it unset in the response. The serial number changes on every zone edit, so it will differ from the capture above. Watch the walk itself with dig +trace (dig reference): each referral hop prints as its own block, root to TLD to authoritative.

Forwarding#

client --RD=1--> local resolver --RD=1--> upstream resolver --answer--> ...

The local resolver doesn't iterate: it passes the query to a configured upstream and returns whatever comes back. Forwarding requires recursion: a server with recursion disabled has nothing that reads its forwarders list. See forward for how forward zones are configured, including conditional forwarding by name.

Gotchas#

  • rd without ra from an authoritative server is normal. Servers echo rd back even when they will not recurse.
  • ad on its own proves nothing. Requesting +dnssec sets the DO bit, not ad; the resolver sets ad only when it validates, and it can be stripped on the path (RFC 6840 section 5.8).
  • Forwarders enabled with an empty list still iterates from root. Confirm the path with dig +trace from the resolver itself.
  • ra set on a server you expect to be authoritative-only usually means a middlebox is answering in its place, not the server itself: something on the path intercepts port 53 (captive portals, some routers) and responds directly.

See also#