← Glossary

What Is DNS?

DNS, the domain name system, translates human-readable domain names into the records computers need, chiefly IP addresses. This article follows a query from a browser through recursive and authoritative servers, explains caching and TTLs, lists the common record types, and clarifies what DNS does not do.

Updated:

DNS (domain name system) is the distributed directory that translates domain names such as www.example.com into the data computers need to reach them, most often IP addresses. It is organized as a hierarchy of zones, each administered by whoever owns that part of the namespace, and queried by resolvers that work on behalf of applications. The design dates from RFC 1034 and RFC 1035, published in 1987, and the core model is unchanged: a name goes in, a set of resource records comes out.

DNS is a lookup service, not a transport. DNS helps discover a destination; it does not carry the subsequent web request, which travels over IP. A page can still trigger additional lookups for other resources. Keeping those two steps apart explains most of the confusion about what changing a DNS setting can and cannot achieve.

From a Domain Name to an Answer

When a user opens www.example.com, the browser commonly asks the operating system's stub resolver for the address, although a browser may use its own cache or secure-DNS resolver. The stub checks its local cache, and if the name is unknown it sends a query to a configured recursive resolver, typically one run by the ISP, the organization's network, or a public resolver chosen in system settings. The query is a small message, usually carried in a single UDP packet to port 53, with a header, a question section naming the record wanted, and empty answer sections.

The recursive resolver does the work the stub cannot. If its own cache is empty, it asks a root server, which does not know the answer but refers it to the servers for the com zone. Those servers refer it in turn to the authoritative servers for example.com, which finally return the A or AAAA record for www. Each referral is an iterative step; RFC 1034 describes recursion, where one server pursues the whole chain for its client, as an optional service signalled by the recursion-desired bit in the query header. The resolver assembles the final answer, caches it, and sends it to the stub, which hands the address to the browser. In practice the chain is short because the com referral and most popular names are already cached.

Resolvers, Authoritative Servers and Caches

Three roles make the system work. A stub resolver lives in the operating system or application and knows only how to forward questions. A recursive DNS resolver accepts those questions, walks the hierarchy and caches responses; a validating resolver also checks DNSSEC where available, and is the component people mean when they talk about choosing or changing their DNS. Authoritative servers hold the actual zone data for a domain and provide authoritative answers for the zones they serve; RFC 1034 requires at least two of them per zone for redundancy.

Caching is governed by the time to live (TTL) attached to every record. The TTL is a number of seconds for which a resolver may reuse an answer before asking again; a TTL of zero means the record may be used once and not stored. Negative answers, meaning that a name does not exist, can also be cached for a period derived from the zone's SOA record. These timers are why a change to a record is seen by some users immediately and by others only after the old value expires from their resolver's cache, a delay usually described as propagation even though nothing is being pushed anywhere.

Common DNS Record Types

A zone contains DNS records of many types. Several widely used types are listed below; a domain need not publish every type.

TypeMaps a name toTypical use
AAn IPv4 addressReaching a web or mail host over IPv4
AAAAAn IPv6 addressThe same over IPv6 (RFC 3596)
CNAMEAnother name (the canonical one)Pointing an alias such as www at a hosting hostname
MXA mail server name with a preference valueRouting inbound email for the domain
NSAn authoritative name server for the zoneDelegation from the parent zone
TXTFree-form textDomain verification, SPF and similar policies
SOAZone metadata: primary server, serial, timersZone transfers and negative caching
PTRA name, looked up from an addressReverse lookups under in-addr.arpa and ip6.arpa

A single name can carry several records of the same type, which is how one hostname advertises multiple addresses for load distribution, and it can carry different types at once, such as A, AAAA and MX for the bare domain. A CNAME is the exception: an alias cannot coexist with ordinary data such as A or MX records at the same name, apart from associated DNSSEC records, which is why the root of a zone generally uses A and AAAA records directly rather than a CNAME.

What DNS Does and Does Not Do

DNS answers the question of where a name points. It does not route traffic, host content or decide whether a connection is allowed. The web server, the hosting provider and the registrar are separate things: the registrar records who owns the domain and which name servers are authoritative, the authoritative servers publish the records, and the host at the published address serves the site. Changing any one of them does not change the others.

Encrypted variants protect one segment of the path. DNS over TLS (RFC 7858) wraps queries between the stub and the recursive resolver in TLS on port 853; DNS over HTTPS (RFC 8484) carries them inside HTTPS to a configured resolver URL. When properly authenticated and used without plaintext fallback, both protect those queries against local-network eavesdropping and undetected modification. Neither hides the queries from the resolver that answers them, which sees the queries it receives and usually the connecting IP address. These protocols do not by themselves protect the separate recursive-to-authoritative segment. Encrypted DNS is a privacy improvement for the first hop, not a VPN and not a guarantee that queries take any particular route.

Common Uses and Limitations

Beyond web addresses, DNS underpins email delivery through MX records, service discovery inside organizations, content delivery networks that return different addresses by region or load, and domain ownership checks through TXT records. Blocking resolvers use it as a policy point by refusing to answer for known malicious or unwanted names, which is possible precisely because the lookup happens before the connection.

Its limitations follow from its age and openness. Plain DNS is unauthenticated, so responses can be forged unless the zone is signed with DNSSEC and the resolver validates signatures, something RFC 8484 notes that HTTPS transport does not replace. Caching means changes take effect unevenly across the internet. The recursive resolver sees the queries sent to it, making DNS a useful source of metadata even when later web traffic is encrypted. Upstream servers usually see the resolver rather than the end user; QNAME minimisation can also avoid sending the full requested name to every server in the hierarchy. And DNS says nothing about the content behind an address: a correct answer for a malicious domain is still a correct answer.

Frequently asked questions

Is DNS the same as hosting?

No. Hosting is the server that stores and serves a website's files. DNS is the directory that tells clients which address that server has. A domain's DNS can be managed by the registrar, the host or a third party, and moving a site to a new host usually means updating DNS records rather than replacing DNS.

Why can DNS changes take time?

Because resolvers cache answers for the record's TTL. A resolver that fetched the old value shortly before the change keeps serving it until the TTL expires, so different users see different results for a while. Lowering the TTL in advance shortens this window; nothing is actively pushed to resolvers.

Does encrypted DNS hide all browsing activity?

No. Properly authenticated DNS over TLS or HTTPS protects queries on the connection to the chosen resolver. That resolver still handles the queries it receives, and the destination site can observe the visit. Encrypted DNS does not encrypt ordinary web traffic or guarantee that all applications use the same DNS route.

What does a DNS resolver do?

A recursive resolver checks its cache and, when necessary, follows referrals through the DNS hierarchy or forwards to another resolver. It returns the answer to the requesting device. A stub resolver is the local client of that service; browsers can also implement their own resolution and caching.

What is the difference between an A record and a CNAME?

An A record gives an IPv4 address. A CNAME points an alias to another name, which must then be resolved. An alias cannot share its name with ordinary records such as A or MX, though DNSSEC records are an exception. Zone roots need SOA and NS records, so ordinary CNAMEs do not fit there.