What is DNS, and how does a domain find a server?
The system that turns a domain name into the address of a server, and what really happens in the gap between typing and loading.
Computers find each other using numbers, not names. Every website ultimately lives at a server with a numeric address — something like 203.0.113.42 for the older IPv4 system, or a longer hexadecimal address for IPv6. Nobody wants to type that to check their email or read the news, so a translation layer sits between the name you type and the number a computer needs. That layer is DNS: the Domain Name System.
Without it, every domain would need to be memorised as a string of digits, and that number would have to change every time a site moved to different hardware. DNS solves both problems at once: it gives names a permanent, human-readable form, and it lets the number behind that name change freely without anyone needing to know.
The problem DNS actually solves
Think of DNS as a distributed directory rather than a single database. No one computer holds the whole map of the internet's domain names — that would be both a single point of failure and an impossibly large file to keep current. Instead, the job is split across millions of servers, each responsible for a small piece, and a lookup is a conversation that hops between them until it reaches the one server that actually knows the answer for your specific domain.
That final server is called the authoritative nameserver for the domain, and understanding that one term unlocks most of what confuses people about DNS. Whoever controls the authoritative nameservers for a domain controls where that domain's website, email, and everything else on it actually goes. Our guide to what nameservers are covers that role in more detail.
What happens when you type a domain
Type a domain into a browser and a chain of lookups fires before a single byte of the actual website arrives:
- Your browser checks its own cache first. If it looked this domain up recently, it may already have an answer and skip everything below.
- Your operating system checks its cache next. Same idea, one level down.
- A recursive resolver takes over. This is usually run by your ISP, or a public one like a well-known DNS provider you may have configured on your router. It does the actual legwork on your behalf.
- The resolver asks a root server which server is responsible for the domain's top-level extension —
.com,.co.uk,.org, and so on. - That top-level registry answers with a referral, not the final answer: it names the authoritative nameservers for your specific domain.
- The resolver asks those nameservers directly, and finally gets back the actual record — an IP address, a mail server, or whatever was requested.
- The answer is cached at several of those layers, for a length of time set by the domain's own TTL value, so the next person asking gets a fast answer without repeating the whole chain.
All of that typically happens in well under a second, and almost always before you have finished releasing the Enter key. It only becomes visible to you at all when something changes — a domain moves to new hosting, and you have to wait for cached answers around the world to expire before everyone sees the update. That waiting period is what people call DNS propagation.
DNS answers more than one question
"Where is the website" is only the most visible question DNS answers. A single domain typically carries several different record types side by side, each answering something different:
| Record | Question it answers |
|---|---|
| A | What IPv4 address does the website live at? |
| AAAA | What IPv6 address does the website live at? |
| MX | Which server should handle email for this domain? |
| TXT | Miscellaneous text — ownership proof, sender permissions, verification codes |
| CNAME | This name is really just an alias for another name — look that one up instead |
| NS | Which nameservers are authoritative for this domain? |
Our guide to every DNS record type goes through each of these, along with the less common ones, in full.
Where a domain's DNS actually lives
Two different companies are usually involved with any domain, and mixing them up is the single most common source of DNS confusion:
- The registrar is who you bought the domain from and who you renew it with. Registering a domain does not automatically mean your DNS records live there.
- The nameservers — set at the registrar, but potentially pointing anywhere — are where the actual DNS records are managed and answered from. This might be your hosting provider, the registrar itself, or a dedicated DNS service.
Whichever company runs the nameservers for a domain is the only place where editing a DNS record has any effect. A record changed anywhere else is simply never consulted, no matter how correct it looks in that other panel.
Run nslookup -type=ns yourdomain.com (or dig +short NS yourdomain.com on macOS or Linux) and whatever comes back is authoritative right now, regardless of what any control panel implies. See how to check which DNS a domain is actually using for the full method.
Why any of this is worth knowing
You do not need to understand DNS to run a website day to day — most of the time it works silently in the background and nobody thinks about it. It becomes worth understanding at exactly three moments: setting up a new domain, moving a site to different hosting, and troubleshooting a domain that has stopped resolving correctly. In every one of those situations, the fix usually comes down to the same handful of facts covered above — knowing which nameservers are authoritative, knowing which record answers which question, and knowing that a change takes time to spread rather than happening everywhere at once.
Get those three things straight and DNS stops being a mysterious layer that occasionally breaks your site, and becomes a short, predictable checklist you can work through whenever something needs pointing somewhere new.
Related reading
They decide who gets to answer questions about your domain — and changing them hands your whole domain to a different company.
Every DNS record type, explained plainlyWhat each DNS record type actually does, in plain terms, and the handful you will realistically ever need to touch.
How long does DNS propagation take?Usually a few hours, occasionally up to 48 — and your own browser is almost always the last thing on earth to catch up.
How to point a domain to your hostingThe two ways to connect a domain to a hosting account, when to use each, and how to tell the change has actually taken effect.