Module 1 · 1.1
DNS: the phone book of the internet
Module 1: What is DNS? · Reading time: 6 minutes
Learning objective: After this lesson, you can explain in your own words what DNS does and why the internet can't do without it.
Key concepts: DNS, IP address, domain name, lookup, record
Computers work with numbers, people with names
Every computer connected to the internet has an address: the IP address. It's a bit like a phone number. There are two versions:
- IPv4, four numbers separated by dots, for example
192.0.2.10; - IPv6, longer, with colons, for example
2001:db8::10.
Computers only find each other through these numbers. We humans prefer to remember names. example.com is easier to remember than 192.0.2.10, and the number can change without the name changing. If a website moves to a different server, it gets a different number. The name simply stays the same.
So something is needed that translates names into numbers. That's the Domain Name System, or DNS for short.
The phone book
You can compare DNS to a phone book, or to the contact list on your phone. You look up a name and get a number back. When you type example.com into your browser, this happens:
- Your browser asks DNS: "What's the address of example.com?"
- DNS replies: "192.0.2.10."
- Your browser connects to 192.0.2.10 and requests the website.
This lookup is called a query, or, in technical terms, a lookup. It happens incredibly fast: usually in under a tenth of a second. So you don't notice anything, as long as it works.
Not just for websites
The phone book picture is almost right, but DNS can store more than one number per name. A domain name has several kinds of data attached to it, each for a different purpose. This kind of data is called a record. A few examples:
| Question | Record type | Answer (example) |
|---|---|---|
| What IPv4 address is the website on? | A | 192.0.2.10 |
| What IPv6 address is the website on? | AAAA | 2001:db8::10 |
| Where should email for this domain go? | MX | mail.example.com |
| Which servers are allowed to send mail on behalf of this domain? | TXT (SPF) | v=spf1 ip4:192.0.2.25 ~all |
If someone sends a mail to info@example.com, the sender's mail server doesn't ask for the A record, but for the MX record: where is this domain's mailbox? That means the website and email can sit with two completely different providers. That's entirely normal: the website with one provider, the mail with Microsoft 365 or Google Workspace.
Every record always has three things:
- a name (for example
example.comorwww.example.com); - a type (A, AAAA, MX, TXT and a handful of others);
- a value (the answer).
There's also a number attached that says how long an answer may be remembered. That's called the TTL. Module 6 covers that.
What DNS isn't
A few misunderstandings come up often:
- DNS doesn't store websites. It only tells you where the website is. Your site's files sit on a web server, not in DNS.
- DNS doesn't store email. It only tells you which server the mail should be delivered to.
- DNS doesn't know about pages. You can't put
example.com/contactinto DNS. DNS only knows names. Whatever comes after the first forward slash is handled by the web server (lesson 3.4). - DNS isn't proof of ownership. Who owns a domain name is recorded at the registry, not in DNS (lesson 1.3).
A worldwide, distributed phone book
There isn't one giant computer holding all the names on the internet. That could never work: there are hundreds of millions of domain names, and enormous numbers of queries are made every second. That's why DNS is distributed. Each party only manages its own small piece:
- the operator of
.com(the company Verisign) knows which servers hold the phone book forexample.com; for a.nldomain, that's SIDN, the registry for .nl domains in the Netherlands; - those servers themselves know the records for
example.com.
You'll see how a query finds its way through these pieces to the right answer in lesson 1.4. Being distributed also explains something that surprises many people: when you change a record, not everyone sees it at the same time. Many computers along the way remember an answer for a while (the cache). Lessons 6.1 and 6.2 cover that.
Why you need to know this as a domain holder
As long as everything works, you don't need to touch DNS. But you'll come across it as soon as:
- your website or email moves to a different provider;
- a service such as Google, Microsoft, an online store platform or a newsletter service asks you to "add this record to your DNS";
- your mail ends up in spam and someone tells you your SPF, DKIM or DMARC aren't set up correctly;
- your website works for some people but not others after a change.
A small mistake in DNS can bring down your website or email. That's why it pays to understand what you're doing. This course helps you with that, step by step.
Summary
- Computers find each other through IP addresses (IPv4 like
192.0.2.10, IPv6 like2001:db8::10); people use names. - DNS translates names into data, such as IP addresses and a domain's mail server.
- Each piece of data is a record with a name, a type and a value.
- DNS doesn't store websites or mail and doesn't know about pages: it only points the way.
- DNS is spread across many servers and answers are remembered for a while (cache).
Quiz
Exercise
Exercise Z1.1: The address of sidn.nl. Look up the IPv4 address (A record) and, if there is one, the IPv6 address (AAAA record) for sidn.nl, the website of SIDN, the registry of .nl in the Netherlands. Use our IP address lookup tool (https://www.weboke.es/en/ip-lookup), another online DNS lookup tool, or, if you already know how, nslookup sidn.nl in a command prompt. Enter the addresses you find.
Further reading
These articles describe the steps in the WebOké control panels. Other providers work in a similar way.
