Free tech learning for everyone, from basics to pro

Start hereNetworking fundamentalsBasics

How DNS works: the internet's phonebook

In short: DNS turns names people remember (example.com) into IP addresses computers use. When DNS fails, websites seem "down" even though the internet connection works.

Why we need DNS

Computers find each other using IP addresses, but people remember names. The Domain Name System (DNS) is like a phonebook: you look up a name and get back a number (the IP address).

Looking up a name, like a phone bookYou type anameexample.comResolverasks on yourbehalfDNS serverslook up thenameIP addressthe "phonenumber"Website loadsbrowserconnects
Figure 1. DNS works like a phone book: your device asks a resolver to look up a name, gets back an IP address, and only then connects to the website.

What happens when you type a website name

  1. Your device checks whether it already knows the answer (its cache).
  2. If not, it asks a DNS resolver, usually run by your router, company or internet provider.
  3. The resolver asks the DNS servers responsible for that name, starting from the top of the system if needed.
  4. The answer (an IP address) comes back, and your browser connects to it.
  5. The answer is cached for a while, so the next visit is faster.

All of this usually takes a fraction of a second.

Common DNS record types

RecordWhat it does
AName → IPv4 address
AAAAName → IPv6 address
CNAMEAn alias that points one name to another name
MXWhich servers receive email for the domain
TXTText used for verification and email security (SPF, DKIM, DMARC)

When DNS goes wrong

A classic sign: you can ping an IP address, but websites won't load by name. Check which DNS servers the device uses, and test with:

nslookup example.com

Clearing the local cache often helps: ipconfig /flushdns on Windows.

Real-world example: "the internet is down", but WhatsApp still works

A family laptop shows "This site can't be reached" for every website. Yet on the same Wi-Fi, a phone still receives WhatsApp messages and the laptop's music app keeps playing. Is the internet really down?

Often the connection is fine and only the name lookup is failing. Apps that already know where to connect can carry on, while a browser that needs to look up a new name gets stuck at the first step of the phone book. Common causes at home include a router that needs a restart, or DNS settings that were changed by hand and later stopped working.

A quick test separates the two problems. If you can ping an IP address such as 8.8.8.8 but nslookup example.com fails, the connection is working and DNS is the problem.

Try this: run nslookup on a website you visit often. Note the address it returns and the name of the server that answered. That server is your resolver, usually your router or your internet provider.

Key takeaways

  • DNS converts names into IP addresses.
  • Answers are cached to make browsing faster.
  • A, AAAA, CNAME, MX and TXT are the records you'll meet most.
  • IP works but names don't? Suspect DNS.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.