DNS resolution
Follow one lookup of www.example.com from your device to a resolver, the root, the .com servers and the authoritative server, then see what caching saves and what breaks when DNS is down.
In 30 seconds
Computers reach each other by number, but people use names. DNS is the system that turns a name like www.example.com into an address like 192.0.2.44.
Your device asks a resolver. The resolver asks a root server, which points to the .com servers, which point to the domain’s own authoritative server, which gives the answer.
The resolver remembers the answer for a set time (the TTL), so repeat lookups are instant. When DNS fails, sites look down even though they are running.
DNS resolution, step by step
Simplified: one address record (A) over IPv4. IPv6 addresses live in AAAA records, and resolvers often start partway down because the .com servers are already in their cache.
- Step 1: Names need translating. People remember names; the network delivers data only to numeric IP addresses. Before your browser can fetch a page from www.example.com it must find out which number that name stands for. DNS, the Domain Name System, is the lookup that answers that question.
- Step 2: Ask a recursive resolver. Your device does not hunt for the answer itself. It sends the question to a recursive resolver, usually run by your internet provider or a public DNS service, and waits. The resolver does the legwork: it first checks its own memory, and if the name is not there it goes and asks.
- Step 3: The root points the way. The resolver starts at the top. Root servers do not know the address, but they know who is in charge of every ending such as .com, .org or .net, and reply with a referral. Every resolver ships with the root servers’ addresses built in, so this first step never needs a lookup.
- Step 4: The TLD server narrows it. Next the resolver puts the same question to a server for the top-level domain (TLD), here .com. It does not know the address either, but it keeps the list of which name servers each .com domain has registered, and refers the resolver to the ones for example.com.
- Step 5: The authoritative answer. The authoritative server is the one the domain’s owner controls. It holds the actual records, so it can finally answer: www.example.com is at 192.0.2.44. The answer comes with a TTL (time to live), the number of seconds it may be reused before asking again.
- Step 6: Answer, and remember it. The resolver passes the address back and your browser connects to it. It also keeps the answer in its cache until the TTL runs out, so the next person who asks gets it at once, with no trips to other servers. Your browser and operating system keep short-lived copies too.
- Step 7: When DNS fails. If the resolver cannot be reached, or the name servers do not answer, your device gets no address and the browser reports that the site cannot be found, even though the web server is running. Answers already cached keep working until their TTL ends. A name that does not exist gets a clear reply: NXDOMAIN.
Try it yourself
Learn this first
Nothing. This concept starts from scratch.
Spotted a mistake on this page?