Uni-Sine
Computer ScienceNetworks

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:

ServerWhat it doesExample
Recursive resolverTakes your question and does all the asking for you, then remembers the answerYour internet provider's server, or a public one such as 8.8.8.8
Root serverKnows where to find each top level domain, such as .com or .ukThe 13 root server identities, a.root-servers.net to m.root-servers.net
TLD serverKnows which servers are in charge of each domain under its endingThe servers for .com
Authoritative serverHolds the actual records for a domain and gives the final answerThe 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:

  1. Your device checks its own cache. If it looked this name up recently, it already knows the answer and stops here.
  2. It asks the recursive resolver. The resolver checks its cache too. If the answer isn't there, it starts asking other servers.
  3. The resolver asks a root server: "Where is www.example.com?" The root server doesn't know, but replies with the servers for .com.
  4. The resolver asks a .com TLD server. It replies with the authoritative servers for example.com.
  5. The resolver asks the authoritative server, which replies with the IP address for www.example.com.
  6. The resolver passes the address back to your device and saves it in its cache for next time.
  7. 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:

RecordWhat it holdsExample
AAn IPv4 addresswww.example.com → 203.0.113.10
AAAAAn IPv6 addresswww.example.com → 2001:db8::10
CNAMEAnother name to look up instead (an alias)shop.example.com → stores.provider.net
MXThe mail servers that accept email for the domainexample.com → mail.example.com
NSThe authoritative name servers for the domainexample.com → ns1.example.net
TXTText, 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?
A computer that looks up the IP address for a website name, like a phone book that turns a name into a number your device can dial.
What does DNS stand for?
Domain Name System.
What is DNS cache?
A store of recent DNS lookups kept by your browser, computer and DNS resolver, so repeated visits don't need a full lookup. Each entry expires after its TTL (time to live).
Should I flush my DNS cache?
Only if a site isn't loading because of an old or wrong address, for example after it has moved servers. On Windows, run ipconfig /flushdns in Command Prompt. It is safe; your device simply looks names up again.
What happens if DNS stops working?
Websites and apps fail to load by name, even though your internet connection works. Visiting a site by its IP address would still work, which is a quick way to tell DNS is the problem.
What is the best DNS server?
Your internet provider's resolver works for most people. Public resolvers such as Google Public DNS (8.8.8.8) and Cloudflare (1.1.1.1) are popular alternatives; which is fastest depends on where you are.

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
Read next
Computer Science · CoursesIP addressing course: subnets, ports, NAT, DHCP and DNSAn interactive IP addressing course in 25 short sections: octets and bits, subnet masks and CIDR, host counts, ports, TCP and UDP, NAT, DHCP, DNS and IPv6.