DNS resolver (the kinds)

term

networkingIT support

Kept in this browser · My desk

A DNS resolver is any program that asks name servers questions on behalf of a client; RFC 9499 sorts them into stub, recursive (full-service), iterative, forwarding, validating, policy-implementing and open resolvers, each a different role in the same lookup.

One lookup crosses several kinds of resolver. The stub in the operating system cannot resolve alone and asks a recursive resolver; a forwarder may sit between them; the recursive resolver iterates from the root, caches, and may validate DNSSEC or apply policy. Knowing which kind answered explains most surprises: a cached TTL, a filtered name, a forwarder's timeout, or a public resolver's anycast instance in another city.

Why the word needs a map. RFC (Request for Comments) 9499 (March 2024), the DNS (Domain Name System) terminology, quotes RFC 1034's definition of a resolver as a program "that extract[s] information from name servers in response to client requests", and warns that in practice the term "is usually referring to some specific type of resolver" whose meaning "depends on understanding the context". Its definitions give the map.

Where the kinds come from. RFC 1123 (October 1989, R. Braden, ed.) wrote down the two models a host could choose: a full-service resolver, "a complete implementation of the resolver service" that "MUST implement a local caching function" and "MUST time out information in the cache", or a stub resolver relying on a recursive name server nearby, recommended for workstations on one network "because it allows all of the workstations to share the cache". Forwarders, filtering resolvers, validators and public resolvers came later; RFC 9499 (March 2024), which obsoletes RFC 8499, is today's list.

The kinds. A stub resolver "cannot perform all resolution itself" and depends "on a recursive resolver to undertake the actual resolution function"; it is what an operating system's library is. A recursive resolver acts "in recursive mode", answering from its cache or querying other servers, and is "expected to cache", which makes it a full-service resolver in RFC 1123's sense; RFC 9499 discourages "full resolver", a term "not properly defined in any RFC". Iterative mode is the opposite: a server "responds with a referral to another server", and a client that follows referrals itself, as dig +trace does, is resolving iteratively. A forwarder, in RFC 2308's words, is "a nameserver used to resolve queries instead of directly using the authoritative nameserver chain", though "In current use, however, forwarders often stand between stub resolvers and recursive servers". A validating resolver applies DNSSEC (the DNS Security Extensions) validation. A policy-implementing resolver "changes some of the answers that it returns based on policy criteria", and "a stub resolver has no idea whether upstream resolvers implement such policy". An open resolver accepts queries "from any (or nearly any) client"; "public resolver" is the name for the ones meant to be open, "as compared to the vast majority of open resolvers that are probably misconfigured to be open".

Why it matters in practice. The kind explains what you see. A non-authoritative answer comes from a cache; a filtered answer from a policy-implementing resolver; a different answer at home and on mobile from two recursive resolvers with different caches, policies or anycast instances. Authoritative servers that tailor answers by location see the recursive resolver, not the client, which RFC 7871 (EDNS Client Subnet, EDNS being the Extension Mechanisms for DNS; Informational) addresses for "Centralized Resolvers" far from their users; Cloudflare's 1.1.1.1 says it does not send that client subnet, while Quad9 offers it on a separate address. RFC 8945 suggests a host using TSIG (Secret Key Transaction Authentication for DNS) "should probably be configured with a "stub resolver" and a local caching and forwarding name server", since the stub's configuration is readable by every user.

The 2008 lesson. A resolver takes the first answer that matches its question, its identifier (ID) and the address and port it used, so an attacker who guesses them can plant a forged answer in the cache. On 8 July 2008 CERT/CC (the CERT Coordination Center) published Vulnerability Note VU#800113: with a properly random 16-bit ID "an attacker will require, on average, 32,768 attempts", and many resolvers sent every query from one fixed port. The note thanks Dan Kaminsky of IOActive for showing how practical cache poisoning had become and Paul Vixie of ISC (Internet Systems Consortium) for raising the urgency, and credits Daniel J. Bernstein with the original idea of randomized source ports, the fix vendors shipped, worth "approximately 16 additional bits", which NAT (network address translation) and PAT (port address translation) devices can undo. RFC 5452 (January 2009, A. Hubert and R. van Mook) made it a rule: an unpredictable source port from 53 or 1024 and above, several ports at once, and an unpredictable ID over the full 0 to 65,535 range.

Open resolvers as weapons. Alert TA13-088A of 29 March 2013, from US-CERT (now part of CISA, the Cybersecurity and Infrastructure Security Agency), described DNS amplification: queries with the victim's address forged as source, sent to open resolvers, whose larger answers flood the victim in a DDoS (distributed denial of service) attack. It quoted the Open DNS Resolver Project: of 27 million known resolvers, about "25 million pose a significant threat". Its remedies were BCP 38 (Best Current Practice 38) filtering of spoofed sources by providers and closing recursion to outsiders, authoritative servers included. Validating resolvers carry a risk of their own: KeyTrap (CVE-2023-50387, Common Vulnerabilities and Exposures, February 2024) showed that one crafted zone could make a resolver spend its processor on a single answer, and is told in the entry on RRSIG, the resource record signature.

Defaults in the servers. BIND serves recursion only to allow-recursion, which falls back to allow-query-cache, then allow-query, then "localnets; localhost;". Unbound refuses everyone except 127.0.0.0/8 until access-control says otherwise, answering REFUSED rather than dropping "because that is protocol-friendly", and sends each server only the labels it needs (qname-minimisation, on by default, after RFC 9156 of November 2021). Windows Server switches recursion with Set-DnsServerRecursion, whose SecureResponse option screens records "to prevent cache pollution" and whose timeout defaults to 8 seconds, and adds forwarders with Add-DnsServerForwarder.

Separation of roles. Registro.br's 2007 talk on firewalls and DNS recommended separating authoritative and recursive servers on different machines and restricting the recursive one to the network's own clients, citing CERT.br's guidance on open recursive resolvers; NIC.br's training material makes the same point with software built for one role each, NSD only authoritative and Unbound only recursive. The recursive resolver itself, with priming, the four steps of resolution and caching, has its own entry.

How it differs. The word covers the whole map of roles; the recursive resolver is one of them, with its own workings from priming to caching. An authoritative server answers only for its own zones and resolves nothing; a forwarder is a role a recursive server plays, not a separate kind of program, and one program can play several roles in the same lookup.

Also known as: resolver, resolver kinds, stub resolver, forwarder, dns forwarder, forwarding resolver, iterative resolver, open resolver, validating resolver, policy-implementing resolver

Sources

← Back to D Back to the glossary