What is a DNS server?

A DNS server is a computer that answers one deceptively simple question: given a domain name like example.com, what is the IP address your device should connect to? DNS stands for Domain Name System, and it acts like the internet's phone book. You remember names; your computer needs numbers. DNS is the service that translates between the two.

Why DNS exists

Every website and server on the internet is reachable by an IP address, not by its name. But addresses like 93.184.216.34 are hard to remember and can change over time. Domain names give us something human-friendly to type, while DNS quietly does the lookup in the background. Without it, you would have to memorize a number for every site you visit.

How a DNS lookup works

When you type an address into your browser, a small chain of servers cooperates to find the answer. It usually happens in a fraction of a second:

First, a stub resolver built into your operating system takes the request and forwards it to a recursive resolver, typically run by your ISP or a public DNS provider. The recursive resolver does the real legwork. If it doesn't already know the answer, it asks a root server, which points it toward the right TLD server for the top-level domain, such as .com or .org. The TLD server then refers it to the authoritative server for that specific domain, which holds the actual record and returns the IP address. The recursive resolver hands that answer back to your device, and your browser opens the connection.

The key idea is that no single server knows everything. The system is deliberately distributed, so responsibility is delegated down a hierarchy from root to TLD to the individual domain.

Caching and TTL

Doing that full lookup every single time would be slow and wasteful, so DNS relies heavily on caching. When a resolver learns an answer, it stores it temporarily. Each record carries a TTL (time to live), a number of seconds that says how long the answer may be reused before it should be looked up fresh. Your operating system, your browser, and your resolver all keep caches, which is why the same site loads faster the second time and why DNS changes can take a while to appear everywhere.

Common DNS record types

A domain's authoritative server holds several kinds of records, each with a different job:

  • A maps a domain name to an IPv4 address.
  • AAAA maps a domain name to an IPv6 address.
  • CNAME points one name at another name, creating an alias.
  • MX tells the internet which mail servers handle email for the domain.
  • TXT stores arbitrary text, often used for verification and email security policies.
  • NS lists the authoritative name servers responsible for the domain.

Recursive vs authoritative servers

It helps to keep two roles straight. A recursive resolver works on your behalf, chasing down the answer by querying other servers and caching what it finds. An authoritative server is the source of truth for a particular domain; it does not go asking anyone else, it simply returns the records its owner has published. A recursive resolver is the researcher, and the authoritative server is the reference book.

Public DNS resolvers

By default your device uses whatever recursive resolver your ISP provides. Many people switch to a public DNS resolver instead, such as Cloudflare at 1.1.1.1 or Google at 8.8.8.8. People change resolvers for a few reasons: speed, since a well-run public resolver may respond faster; privacy, since some providers promise not to log or sell your query history; and filtering, since certain resolvers can block malware domains or offer family-friendly filtering. Note that a handful of addresses, like the loopback and other reserved IP addresses, are set aside for special uses and never resolve to public sites.

DNS and your IP address are separate

DNS and your IP address are two different things, and browsing needs both. Your IP address is how the network reaches your device; DNS is how your device learns where to send its requests. One is about your identity on the network, the other is about looking up destinations.

There is a privacy angle worth knowing. Because your recursive resolver sees every domain you ask about, your DNS queries can reveal a fair amount about your browsing to whoever runs that resolver. Choosing a resolver that encrypts queries and has a clear no-logging policy helps, and if you want to go further, see our guide on how to hide your IP address.

The takeaway

A DNS server is the translator that turns names into numbers so the rest of the internet can do its job. Understanding the resolution flow, how caching keeps it fast, and why the resolver you choose matters gives you a clearer picture of what happens every time you open a page, and a bit more control over your privacy along the way.

→ Check your IP address  ·  More guides