Consider the resolution of the domain name www.gate.org.in by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is ______.
GATE 2022 CS Q.35: solution and answer
Answer and solution
ANSWER
The number of DNS query-response pairs needed to resolve www.gate.org.in is 4.
Official answer: 4Source: Official answer key, GATE 2022 CS (IIT Kharagpur)
With an empty cache, the resolver knows only the addresses of the root name servers, so it starts there.
In iterative resolution the resolver itself contacts each server in turn. Each server either answers or returns a referral to the next server down.
Query 1 goes to a root server. It does not know
www.gate.org.in, so it replies with a referral to theinserver.Query 2 goes to the
inserver. It replies with a referral to the server fororg.in.Query 3 goes to the
org.inserver. It replies with a referral to the server forgate.org.in.Query 4 goes to the authoritative server for
gate.org.in. It replies with the address record forwww.gate.org.in, so resolution is complete.Total: query-response pairs. The query from the client host to its own resolver is not counted.
KEY IDEA
With empty caches and iterative resolution, the resolver walks down the name one zone at a time: root, then in, then org.in, then gate.org.in. Each server is one query-response pair.
WATCH OUT FOR
Counting only three pairs by skipping the org.in server, or counting five by adding the client's own request to its resolver. The question asks only for the pairs the resolver exchanges with the DNS servers.
From the GATE 2022 CS paper. Every question of this paper · Download the full paper · All 5 DNS & HTTP questions, with notes
