8.1DNS
The idea
DNS turns names into IP addresses using a hierarchy of servers: root, top-level-domain, authoritative. A resolver can query them iteratively: each server points to the next.
Think of it like this: Asking directions in a big city: the information desk says "ask at the district office", which says "ask at the street office", which finally knows the house.
Why it exists
GATE counts the query-response pairs for a given name or asks where the DNS query happens in a browser interaction.
How it works
- The browser needs an IP before it can open TCP, so DNS comes first.
- Iterative resolution of a.b.c.d with empty caches: one query per level, from the root down to the authoritative server.
- www.gate.org.in: root, .in, org.in, gate.org.in = 4 pairs.
- DNS normally uses UDP port 53.
Worked example: Number of query-response pairs to resolve www.gate.org.in iteratively with empty caches.
4 (GATE 2022).
Now play with it
- →Switch the lab between iterative and recursive and compare who asks whom.
- →Count levels for a name like www.iitd.ac.in.
- Host → local DNS resolver: query: www.gate.org.in (recursive request)
- Resolver → root server: who knows www.gate.org.in? Reply: ask the .in TLD server (referral)
- Resolver → .in TLD server: Reply: ask the org.in server
- Resolver → org.in server: Reply: ask the gate.org.in authoritative server
- Resolver → gate.org.in server: Reply: www.gate.org.in = 203.0.113.9 (the answer)
- Resolver → Host: answer, and the resolver caches it
Resolving www.gate.org.in iteratively with all caches empty needs 4 query-response pairs between the resolver and the DNS servers (root, .in, org.in, gate.org.in), plus the host-to-resolver exchange if you count it.
Check yourself
In a web browsing interaction the correct order is
Exam notes (the dense version)
The Domain Name System maps names to IP addresses through a hierarchy: root servers, top-level-domain (.in, .com), authoritative servers. A name like www.gate.org.in is resolved iteratively by the local resolver: root → .in → org.in → gate.org.in, which is 4 query-response pairs when nothing is cached. In recursive mode each server asks the next on your behalf. Resolvers cache answers (TTL). DNS uses UDP port 53 for ordinary queries and TCP for zone transfers or large replies. Records: A (IPv4), AAAA, MX (mail), NS, CNAME.
Previous year questions: Application Layer: DNS, HTTP, Email (9)
PYQs are grouped by topic, so this is the full set for Application Layer: DNS, HTTP, Email; try the ones that match this subtopic. Open all 9 on the topic page.