Recursive vs. Authoritative DNS Servers
Tell the two kinds of DNS server apart, see how they work together and know which one to blame when a lookup goes wrong.
Key takeaways
- A recursive resolver searches the DNS tree on behalf of clients and caches what it learns.
- An authoritative server publishes the records for specific zones and does not go looking elsewhere.
- Changing DNS records affects authoritative servers; changing the DNS setting on your devices chooses a different recursive resolver.
- Keeping the two roles on separate systems is the usual practice, because it limits both confusion and abuse.
A recursive DNS server finds answers for you. An authoritative DNS server owns answers about particular domains. Your laptop asks a recursive resolver "what is the address of www.example.com?", and the resolver goes looking until it reaches an authoritative server that holds the official record.
The difference matters whenever something breaks or changes. If you edit a record, you are changing what the authoritative side says. If one person on one network sees an old or wrong answer, the recursive side is often where it lives.
The library comparison
Picture a reference librarian and a set of record offices. You give the librarian a question. The librarian checks their notes, and if the answer is not there, visits the offices that can point the way until one produces the official document. The librarian then hands you the answer and keeps a copy for the next person.
The librarian is the recursive resolver. It knows how to find things but owns none of the facts. The final record office is the authoritative server. It owns the facts for its own files and will not run errands to find anything else.
What a recursive resolver does
When a request arrives, the resolver first checks its cache. If it holds a record that has not expired, it replies at once. This is the common case for popular names.
Otherwise it works down the hierarchy:
- It asks a root server, which refers it to the servers for the top-level domain.
- It asks one of those, which refers it to the name servers for the specific domain.
- It asks one of those, which returns the record or says it does not exist.
- It stores what it learned and sends the final answer to the client.
Strictly speaking, the client makes a recursive query ("give me the finished answer"), and the resolver then makes iterative queries to the other servers (each replies with the best it has, often a referral). That is where the names come from.
A resolver may also do extra work: validate DNSSEC signatures, block known malicious domains, or encrypt the connection from your device.
Where your resolver comes from
Most home devices learn their DNS server from the router through DHCP, the protocol that hands out network settings, covered in DHCP explained. The router often names itself, then forwards questions to your provider's resolver. You can override this per device or on the router.
A box that only passes questions to another resolver and caches the replies is called a forwarder. Home routers are a common example. They add one more hop and one more cache to keep in mind when debugging.
What an authoritative server does
An authoritative server is loaded with one or more zones. A zone is the set of records for a part of the tree that is managed together, such as example.com and the names under it. When a question arrives, the server looks only in its own data and returns one of these:
- The record asked for, marked with the "authoritative answer" flag.
- A referral, if the name belongs to a child zone that has been delegated elsewhere.
- A negative answer, saying the name does not exist (NXDOMAIN) or exists but has no record of that type.
- A refusal, if the question is about a zone it does not serve.
Domains normally list at least two authoritative servers, so that one failure does not take the domain offline. One is often treated as the primary, where edits are made, and the others as secondaries that copy the zone from it. Many hosted DNS services hide this arrangement and replicate your changes through their own systems. The file format behind it is described in zone files and name servers.
How they work together
The two roles meet in a short chain. Here it is with a resolver that already knows where the top-level domain servers are.
Notice that your phone never speaks to the authoritative servers. It only sees what the resolver tells it. That is convenient and efficient, and it means you are trusting the resolver to report faithfully.
Seeing the difference with commands
You can query either kind of server directly. On macOS or Linux, ask your usual resolver:
dig www.example.com A Then find the domain's authoritative servers and ask one of them yourself:
dig example.com NS +short
dig @ns1.example.com www.example.com A +norecurse Replace ns1.example.com with a name the first command returns. In the output, look at the flags line. aa means the answer is authoritative. ra means the server offers recursion. A resolver's cached reply normally shows ra without aa, and its time to live counts down if you repeat the query. An authoritative reply shows the same configured value each time.
On Windows PowerShell:
Resolve-DnsName example.com -Type NS
Resolve-DnsName www.example.com -Server ns1.example.com -DnsOnly If the authoritative server gives the new address and your resolver gives the old one, your edit is correct and you are waiting for a cache to expire. If the authoritative server itself gives the old address, the change was not saved, or you edited a DNS host that the domain does not actually use.
Which side has the problem
The local overrides in that last step include the hosts file, which can quietly replace any DNS answer on a single machine.
Why the roles are usually kept apart
Some server software can do both jobs, and small internal networks sometimes run it that way. On the public internet, separating them is the normal recommendation.
A resolver that accepts questions from anyone is called an open resolver. Attackers can send it questions with a forged source address so that large replies land on a victim. A resolver should therefore answer only its intended users, unless it is a deliberately operated public service with defenses for abuse.
Mixing roles also muddies answers. A server that is authoritative for an old copy of a zone may keep handing out that copy to its own users even after the domain has moved elsewhere. This is a classic cause of "it works for everyone but our office". Teams that need different internal answers should set that up deliberately, as described in split-horizon DNS.
What goes wrong on each side
The two roles fail in different ways, and knowing the pattern saves time.
On the recursive side, typical faults are slowness, timeouts and answers that differ from the rest of the world. A resolver may be overloaded, cut off from part of the internet, holding an old entry or applying a filter that blocks a name on purpose. These faults affect everyone who shares that resolver and nobody else. Switching one device to a different resolver for a minute is a quick way to confirm the suspicion.
On the authoritative side, faults follow the domain wherever it is looked up. Common ones include:
- Lame delegation. The registrar lists a name server that does not actually serve the zone, so queries sent there go nowhere useful.
- Secondaries out of step. One server has the new records and another still has the old ones, so results seem to change at random.
- A typo in a record. A wrong digit in an address, or a missing final dot in a zone file, publishes something you did not intend.
- An expired or suspended domain. The records may be intact at the DNS host while the registry no longer points to them.
- A broken DNSSEC chain. Signatures expire or keys no longer match, and validating resolvers reject the answers.
A useful habit is to query every listed name server one by one after a change. If they all agree, the publishing side is consistent. If one differs, you have found the fault before your visitors report it.
How to tell what a server offers
You can usually learn a server's role from its behavior. Send it a question about a domain it has nothing to do with. A resolver that serves you will go and find the answer. A purely authoritative server will refuse, or reply with no useful data.
dig @ns1.example.com example.org A A status of REFUSED here is healthy for an authoritative server. If instead it returns a full answer with the recursion-available flag set, and the server is reachable by anyone on the internet, its configuration deserves a second look. Only test servers you are responsible for, or your own provider's published resolvers in the normal way.
Which one should you care about
As an ordinary user, you mostly choose a recursive resolver, even if only by accepting the default. Speed, reliability, filtering and privacy policy are the things that differ between them, and public DNS resolvers walks through that choice.
As a domain owner, you mostly care about the authoritative side. Make sure your DNS host is reliable, protect the account that can edit records, and check that the name servers listed at your registrar match the service where you make changes.
As an administrator, you may run both. Keep them on separate addresses or separate machines, restrict recursion to your own networks, and monitor each for its own failure: resolvers for slow or failing lookups, authoritative servers for zones that are out of step with each other.