Library βΊ Internet
π Internet
How DNS Works: The Internet's Phone Book, Explained With Moving Pictures
You type resinfo.in, but computers on the internet only understand numbers like 203.0.113.7. Something has to translate the name into the number, in a split second, billions of times a day. That something is DNS, the Domain Name System. Let's watch it work.
1. The internet's phone book
On your phone you tap a name like "Mom", and the phone dials a number. You never memorise the number.
The internet works the same way. Every website lives on a computer with an IP address, a number like 203.0.113.7. Names like resinfo.in are just for humans. DNS is the phone book that turns names into numbers.
Without it you'd have to type numbers to visit every website. In fact, in the internet's early days a single shared file listed every computer's name and number. When the network grew too big for one file, DNS was invented, in 1983.
2. Watch one lookup, step by step
Here's what happens the first time your computer looks up www.resinfo.in. Each glowing dot is a question or an answer:
- Your browser asks a resolver. The resolver is a helper server, usually run by your internet provider, or a public one like Cloudflare's
1.1.1.1or Google's8.8.8.8. - The resolver asks a root server. Root servers don't know every website, but they know who runs each ending, like
.com,.inor.org. - The resolver asks the .in server. It knows which name server is in charge of
resinfo.in. - The resolver asks that name server, called the authoritative server. It has the real answer: the IP address.
- The resolver passes the answer back to your browser, and remembers it for next time.
- Your browser connects to that IP address and the page starts loading.
All of that usually takes just a few dozen milliseconds, faster than a blink.
3. Why it's usually instant: caching
If every visit needed all those trips, the internet would feel slow. So DNS answers get remembered (cached) by the resolver, your computer and even your browser.
Every DNS answer comes with a TTL ("time to live"), set by the website's owner. It says how long the answer may be remembered, for example 300 seconds. When the TTL runs out, the next visitor triggers a fresh lookup. That's why, when a website moves to a new server, it can take a little while for everyone to see the change.
4. Names are read from right to left
A web address is really a path through a giant upside-down tree. DNS reads it from right to left, starting at an invisible dot at the end:
- Root ( . ): the top of the tree. There are 13 named root servers (A to M), with over a thousand copies spread around the world so they're always nearby.
- Top-level domain: the ending, like
.com,.org, or country endings like.in(India) and.uk. - Domain: the name someone registered, like
resinfo.in. - Subdomain: anything in front, like
wwwormail. The owner can create as many as they like.
5. What's inside the phone book: DNS records
A domain's name server holds a small list of records. Each type answers a different question:
| Record | Answers the question | Example |
|---|---|---|
| A | What's the IPv4 address? | 203.0.113.7 |
| AAAA | What's the newer, longer IPv6 address? | 2001:db8::7 |
| CNAME | Is this name a nickname for another name? | www β resinfo.in |
| MX | Which server receives email for this domain? | mail goes to a mail server |
| NS | Which name servers are in charge of this domain? | two Cloudflare name servers |
| TXT | Any notes for other services? | proof you own the domain |
A real example: this very website, resinfo.in, was bought from one company (the registrar) but its DNS is run by Cloudflare. To set that up, we simply changed its NS records to point at Cloudflare's name servers. From then on, Cloudflare answered every "where is resinfo.in?" question.
6. Try it yourself: a live DNS lookup
Type any website and ask the internet's phone book directly. This sends a real DNS question and shows the real answer:
Lookups are answered by Cloudflare's public DNS (1.1.1.1). Nothing is stored by this website.
On a computer you can also do this in a terminal: type nslookup resinfo.in (Windows, Mac or Linux) and press Enter.
7. When DNS goes wrong
Because almost everything online starts with a DNS lookup, DNS problems can make huge services vanish, even when their servers are running fine:
- October 2016: a flood of junk traffic from hacked home devices (the "Mirai" botnet) hit Dyn, a big DNS company. Sites like Twitter, Netflix and Reddit became unreachable for many people across the US and Europe.
- October 2021: a faulty network change cut Facebook's name servers off from the internet. For about six hours, Facebook, Instagram and WhatsApp simply couldn't be found.
There's also a security side. Attackers sometimes try to send fake DNS answers that point you to a look-alike website. Modern protections like DNSSEC (digitally signed answers) and encrypted DNS (DNS over HTTPS) make that much harder.
Key takeaways
- DNS turns names like resinfo.in into IP addresses, like a phone book.
- A resolver finds the answer by asking the root, then the top-level domain server, then the authoritative name server.
- Answers are cached for their TTL, which is why most lookups are instant.
- Names are read right to left: root β .in β resinfo.in β www.
- Different records (A, AAAA, CNAME, MX, NS, TXT) answer different questions.
Quiz: test yourself
1. What does DNS turn resinfo.in into?
An IP address, the number computers use to find each other.
2. Who does the resolver ask first on a brand-new lookup?
A root server, which points it to the right top-level domain server (like .in).
3. Why is the second visit to a website faster?
The answer is cached, so no trips to DNS servers are needed until the TTL runs out.
4. Which record tells the world where to deliver email for a domain?
The MX record.
5. Reading right to left, what comes right after the root in www.example.com?
.com, the top-level domain.
Two new visual guides every week
Plus animated tech explainers on YouTube and Facebook.
More from the Library

Why CORS Errors Happen
The 'blocked by CORS policy' error explained with moving pictures: what an origin is, why browsers block, preflight requests and the server fixes that work.
Read with pictures β
What Is an API?
APIs explained like a restaurant waiter: see requests and responses travel, learn GET, POST, status codes and JSON, then make a real API call yourself.
Read with pictures β
Monolithic vs Microservices
One big app or many small ones? See how monoliths and microservices deploy, scale and fail, with running diagrams, real company stories and a quick decision helper.
Read with pictures β