Unbound is an open-source validating, recursive and caching DNS resolver developed by NLnet Labs. It answers queries from clients by walking the DNS hierarchy from the root servers, validating DNSSEC signatures along the way and caching the results, which makes it a common choice for ISP resolvers, enterprise networks, firewalls and privacy-minded home setups.
Unbound is deliberately resolver-only: it does not act as a full authoritative name server for public zones. This narrow focus, a compact C code base and a security-first design distinguish it from multipurpose servers such as BIND.
How Unbound resolves and caches queries
When a stub resolver on a client asks Unbound for a name, Unbound first checks its message and RRset caches. On a cache miss, it performs iterative resolution: it queries a root server for the top-level domain delegation, then the top-level domain servers, then the authoritative servers of the zone, following referrals until it obtains an answer.
Unbound is built around a modular pipeline. The validator module checks DNSSEC signatures against a configured trust anchor, usually the root key maintained by the unbound-anchor utility under the RFC 5011 rollover procedure. The iterator module performs the actual recursion. Answers that fail validation are returned to the client as SERVFAIL, so tampered data never reaches applications.
Unbound runs multiple threads, each with its own event loop, and shares caches between them. Cached records live until their time to live expires, but features such as prefetching refresh popular records shortly before expiry, so frequently requested names are almost always answered from memory in well under a millisecond.
Key features and configuration options
Unbound is configured through a single text file, unbound.conf, organized in clauses such as server, forward-zone, stub-zone and remote-control. The table below summarizes the options that most strongly affect security, privacy and performance.
| Setting | Purpose | Typical value or choice |
|---|---|---|
| auto-trust-anchor-file | Enables DNSSEC validation with root key | Path to root.key |
| QNAME minimization | Sends only needed labels upstream | yes (default in modern releases) |
| prefetch | Refreshes popular records before expiry | yes on busy resolvers |
| serve-expired | Answers from stale cache if upstream fails | yes with a short limit |
| aggressive-nsec | Synthesizes negative answers from NSEC records | yes for fewer upstream queries |
| access-control | Restricts which networks may query | Allow internal ranges only |
| num-threads | Worker threads | Usually one per CPU core |
| msg-cache-size | Memory for cached messages | Tens to hundreds of megabytes |
The privacy technique QNAME minimization (RFC 9156) reduces what each authoritative server learns about the full queried name, which improves privacy without changing answers in most cases.
Beyond recursion, Unbound supports local zones and local data for internal names, forward zones that send selected domains to another resolver, Response Policy Zones for blocking malicious domains and encrypted transports: it can serve clients and forward upstream over DNS over TLS, and recent versions also accept DNS over HTTPS queries.
Unbound compared with other DNS servers
Unbound is best understood as a specialized recursive resolver, whereas several alternatives combine recursion with authoritative service or plug-in architectures. The comparison below shows where it fits among neighboring DNS software and services.
| Software | Primary role | Strength | Consideration |
|---|---|---|---|
| Unbound | Recursive validating resolver | Security focus, small footprint | Not an authoritative server |
| BIND | Authoritative and recursive | Feature-complete reference software | Larger attack surface |
| CoreDNS | Plug-in DNS server | Kubernetes service discovery | Usually forwards recursion |
| Knot Resolver | Recursive resolver | Lua-scriptable policies | Smaller community in some regions |
| Public resolvers | Hosted recursive service | No maintenance, anycast reach | Queries leave the organization |
Unbound pairs well with an authoritative-only server such as NSD, also from NLnet Labs, following the operational principle of separating recursive and authoritative roles. Running them separately limits cache poisoning risks and simplifies hardening of each service.
Where Unbound is deployed
Unbound is the default resolver in the base systems of FreeBSD and OpenBSD, is shipped in firewall distributions such as pfSense and OPNsense and is widely used by internet service providers and public DNS operators. Its library form, libunbound, lets applications embed validating resolution directly.
Choosing a deployment mode depends on trust, privacy and network constraints. The decision table below outlines common patterns.
| Situation | Recommended mode | Reason |
|---|---|---|
| Home network with ad blocker | Full recursion behind the filter | No third-party resolver sees all queries |
| Restrictive firewall blocks port 53 | Forwarding over DNS over TLS | Encrypted upstream on port 853 |
| Enterprise with internal domains | Recursion plus stub zones | Internal names go to internal servers |
| ISP serving many customers | Multi-threaded recursion with prefetch | High cache hit rate and low latency |
| Application needing DNSSEC answers | Embedded libunbound | Validation inside the program |
Operational limitations and common mistakes
The most serious misconfiguration is an open resolver: an Unbound instance that answers queries from the whole internet can be abused for DNS amplification attacks. The default access control refuses non-local clients, but administrators sometimes widen it carelessly when exposing a server.
- Clock errors break DNSSEC validation, because signatures carry validity periods; keep time synchronized.
- Disabling validation to fix one broken domain removes protection for all others; use a negative trust anchor instead.
- Undersized caches on busy resolvers lower hit rates and increase upstream traffic.
- Forwarding to a non-validating upstream while trusting its answers weakens the DNSSEC chain.
Administrators manage a running instance with unbound-control, which can reload configuration, flush cache entries and print statistics. Monitoring the cache hit ratio, SERVFAIL rate and recursion time quickly reveals upstream problems or validation failures.
A non-technical view
Every website has a name and a numeric address. Your device must find the address before it can connect. Unbound is a program that does this lookup work for you. It asks the internet’s directory servers step by step. It remembers the answers for later. It also checks a digital seal to confirm that no one has tampered with them.
Think of it as a careful personal librarian. It finds the right book, verifies that it is genuine and keeps a copy on the desk. The next request is then answered instantly.
A concrete example
A regional hospital network with about 3,000 devices previously sent all DNS queries to a public resolver. Its security team wanted internal control, DNSSEC validation and the ability to block known malware domains. They deployed two Unbound servers on virtual machines, each with four threads and a 256 MB message cache.
The servers resolve public names through full recursion with QNAME minimization, send the internal hospital domain to the Active Directory DNS servers through a stub zone and load a threat-intelligence Response Policy Zone that is refreshed hourly. Access control allows only internal address ranges.
After one month, the cache hit ratio stabilized near 85 percent, median lookup time for cached names was below one millisecond and the policy zone blocked several hundred attempts to reach malicious domains. When an external domain’s DNSSEC keys were misconfigured, the team added a temporary negative trust anchor rather than disabling validation for the whole network.