What is DNS? Explained with your phone's contacts list
DNS turns a website name people can remember into the number computers use to find it. Explained with tapping a name in your phone's contacts instead of typing the number.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- Engineering
In one sentence: DNS (the Domain Name System) is the internet's contacts list: it turns a name people can remember, like example.com, into the number computers use to find each other, called an IP address.
The everyday picture
Think about how you call a friend. You do not type their phone number. You tap their name in your contacts, and your phone dials the number for you. You remember names. The phone network only understands numbers.
Now imagine you want to call a shop you have never called before. Its number is not in your contacts. So you ring a directory helpline. The helpline finds the number, reads it to you, and you save it in your contacts for next time.
The internet works the same way. Every computer that runs a website has a number, called an IP address. People type names instead, like example.com. DNS is the system of contacts lists and directories that turns the name into the number, usually in a moment.
Your browser asks the resolver (the directory helpline). The helpline asks the main index, then the .com section, then the name's own listing, and reads the number back to you.
How it works, step by step
- Your browser checks its own memory first (you look in your contacts). Browsers and computers keep copies of recent answers. This saved copy is called a cache. If the number is there, the lookup is done.
- If not, it asks a DNS resolver (you ring the directory helpline). The resolver is a service, often run by your internet provider, that does the searching for you. It checks its own notebook of recent answers first.
- The resolver asks a root server (the main index). The root does not know the shop's number. It knows where the book for each ending is kept, so it points to the book for .com, .org, .uk and so on. These endings are called top-level domains.
- The resolver asks the top-level domain server (the .com section of the directory). This server does not hold the number either. It says which server keeps the official listing for that one name. That is the authoritative nameserver.
- The authoritative nameserver gives the answer (the shop's own official listing). It holds the name's records, including its IP address. The resolver passes the number back to your browser, which then connects to the website directly.
- Everyone keeps a copy for a while (you save the number, with a note to check it again later). Each record carries a "time to live", or TTL, that says how long copies may be kept. When it runs out, the next visitor triggers a fresh lookup.
Where the picture stops
- It is automatic and fast. Nobody waits on hold. The whole chain of questions happens between computers, and saved copies mean most lookups never travel the full route.
- One name holds many entries. A contact usually has one number. A domain can hold several kinds of record: one for the website's address, one that says where its email should go, and text entries used for things like email security.
- You rent the name, you do not own it. To get a domain name, you register it through a company called a registrar, usually for a set period, and renew it. If you forget, the name can lapse and someone else can take it.
Why it matters for your business
- Your website and email depend on it. If your DNS records are wrong or your domain expires, customers cannot reach your site, and your email can stop arriving.
- Moving providers is smoother with a plan. When you switch website hosts, you update one record. Because old copies are kept until their TTL runs out, some visitors see the change later than others.
- It is a security point. Whoever controls your registrar account controls where your name points. Protect that login like your bank login, and keep the renewal date and payment details up to date.
An example
Imagine a 12-person design studio moving its website to a new hosting company. A day before the move, its developer shortens the TTL on the website's record, so saved copies expire quickly. On moving day, they change that one record to the new server's IP address. Within a short time, visitors reach the new site.
The developer leaves the email records alone, so staff email keeps flowing the whole time. Afterwards, they turn on auto-renew for the domain and two-step login on the registrar account.
Frequently asked questions
What is the difference between a domain name and a website?
The domain name is the address people type, like example.com. The website is the content, which lives on a server somewhere. DNS connects the two by pointing the name at the server's number.
Who is in charge of DNS?
No single company runs it all. ICANN coordinates the internet's naming system. Registry operators keep the records for each ending, such as .com, and registrars are the companies you buy names from.
Why does a DNS change take time to show up?
Resolvers and devices keep saved copies of old answers until the record's time to live runs out. Many DNS providers let you set it anywhere from about a minute to a day, so a change can appear quickly for some people and later for others.
What is a DNS record?
It is one entry in a domain's listing. Common ones are an A record (the website's IP address), an MX record (where email goes), a CNAME (an alias pointing to another name) and a TXT record (free text, often for email security).
Related explainers
- What is cloud hosting? Explained with a serviced office
- What is caching? Explained with a restaurant kitchen
- Frontend vs backend, explained with a restaurant
The DevDrift sets up domains, DNS and hosting for web apps and platforms: see how.