What is DNS, and what is a DNS server?
What does DNS stand for?
DNS stands for Domain Name System. Every device on the internet is reached by an IP address, a number such as 203.0.113.10. Numbers are hard for people to remember, so we use domain names instead. DNS is the worldwide system that links the two. It was set out in 1987 in RFC 1034 and RFC 1035, and it still runs every web visit, email and app connection.
What is a DNS server?
A DNS server is any computer that answers DNS questions. There are four kinds, each with its own job:
| Server | What it does | Example |
|---|---|---|
| Recursive resolver | Takes your question and does all the asking for you, then remembers the answer | Your internet provider's server, or a public one such as 8.8.8.8 |
| Root server | Knows where to find each top level domain, such as .com or .uk | The 13 root server identities, a.root-servers.net to m.root-servers.net |
| TLD server | Knows which servers are in charge of each domain under its ending | The servers for .com |
| Authoritative server | Holds the actual records for a domain and gives the final answer | The servers the owner of example.com chooses |
When people say "my DNS server", they mean the recursive resolver their device uses. Your router usually hands out your internet provider's resolver automatically, but you can choose a public one, such as Google Public DNS at 8.8.8.8 or Cloudflare at 1.1.1.1.
How does a DNS server resolve a domain name?
Here is what happens the first time anyone using your resolver visits www.example.com:
- Your device checks its own cache. If it looked this name up recently, it already knows the answer and stops here.
- It asks the recursive resolver. The resolver checks its cache too. If the answer isn't there, it starts asking other servers.
- The resolver asks a root server: "Where is www.example.com?" The root server doesn't know, but replies with the servers for
.com. - The resolver asks a .com TLD server. It replies with the authoritative servers for
example.com. - The resolver asks the authoritative server, which replies with the IP address for www.example.com.
- The resolver passes the address back to your device and saves it in its cache for next time.
- Your browser connects to that IP address and loads the page.
Each step only narrows things down, reading the name from right to left: first the ending (.com), then the domain (example), then the host (www). The whole chain usually takes a fraction of a second, and most lookups skip most of it thanks to caching. Try it: this question asks you to put the steps of a lookup in order.
Put the steps of a DNS lookup in order, with and without a cached answer.
Press Mark to have your answer marked in the IP Addressing & Protocols course.
Root servers
The top of the system is surprisingly small. There are 13 root server identities, lettered A to M, run by 12 independent organisations. Each letter is copied to many machines around the world that share the same address. On 7 November 2026, root-servers.org listed 2,048 operational root server instances.
What is DNS cache?
The DNS cache is a short term memory of recent lookups, kept by your browser, your operating system and your resolver. Each answer comes with a TTL (time to live) in seconds, set by the domain's owner. A TTL of 3,600 means the answer may be reused for 3,600 seconds, which is 1 hour, before it must be looked up again.
Caching makes the web feel fast and stops the root and TLD servers being swamped. The downside is that when a website moves to a new IP address, some people keep being sent to the old one until their cached answer expires. That is why website owners often lower the TTL before a move.
How to view or clear the DNS cache
If a site won't load after a change, clearing the cache forces a fresh lookup. On Windows, open Command Prompt and type:
ipconfig /displaydns (shows what is cached)
ipconfig /flushdns (clears it)Microsoft's documentation says /flushdns flushes and resets the DNS client resolver cache. Browsers keep their own short cache as well, so restarting the browser can help too. Your resolver's cache is out of your hands; it clears entries when their TTL runs out.
Common DNS record types
An authoritative server stores several kinds of record for a domain:
| Record | What it holds | Example |
|---|---|---|
| A | An IPv4 address | www.example.com → 203.0.113.10 |
| AAAA | An IPv6 address | www.example.com → 2001:db8::10 |
| CNAME | Another name to look up instead (an alias) | shop.example.com → stores.provider.net |
| MX | The mail servers that accept email for the domain | example.com → mail.example.com |
| NS | The authoritative name servers for the domain | example.com → ns1.example.net |
| TXT | Text, often used to prove who owns a domain or to fight spam email | "v=spf1 include:..." |
The addresses in these examples come from ranges reserved for documentation (RFC 5737 for IPv4), so they don't belong to any real site. For more on the numbers themselves, see our guides to subnet masks and MAC addresses.
DNS privacy and security
- Traditional DNS isn't encrypted, so anyone on the network path can see which names you look up, even if the website itself uses HTTPS.
- DNS over HTTPS (DoH) wraps lookups inside encrypted web traffic, as described in RFC 8484. Many browsers can turn it on in their settings.
- DNS spoofing (or cache poisoning) is an attack that plants a fake answer in a cache to send people to the wrong site. DNSSEC lets resolvers check that answers are signed by the real domain owner.
- Changing DNS server can make lookups faster or add filtering, such as blocking known malware sites, but your new resolver then sees your lookups instead.
Common mistakes
- Thinking DNS stores websites. It only maps names to addresses. The website is on a web server.
- Thinking there is one giant DNS server. DNS is spread across millions of servers in a tree.
- Thinking root servers know every address. They only point the way to the TLD servers.
- Expecting changes to appear instantly. Cached answers last until their TTL runs out.
- Confusing DNS with DHCP. DHCP gives your device its IP address on the local network; DNS looks up other devices' addresses by name.
Common questions
What is a DNS server in simple terms?
What does DNS stand for?
What is DNS cache?
Should I flush my DNS cache?
What happens if DNS stops working?
What is the best DNS server?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Number Base Converter
Convert between binary, hex and decimal and add in binary
Open the tool - Learn it
IP Addressing & Protocols
IPv4, IPv6, subnetting and the protocols that power the internet
Start the course - Test it
AP Computer Science Principles
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper