How nlnetlabs/unbound works
Unbound is a validating, recursive, caching DNS resolver. A client query enters the daemon’s listening and worker system, is processed as a mesh query through recursive iteration and DNSSEC validation, and is answered using cached or locally authoritative data before a response is sent. The graph also preserves documented code-level capabilities visible in the source index, including DNS64, client-subnet handling, response-IP policy, DNSCrypt, dnstap, and cachedb. Some runtime wiring is not shown in the excerpts, so those links are dashed and unverified.
Main entry points: worker.c Daemon worker · dns.c DNS caches · iterator.c Recursive iterator · mesh.h Query mesh
Components 19
Resolver runtime
- DNS listener
services/listen_dnsport.c - Daemon worker
daemon/worker.c - Network events
util/netevent.c - Resolver configuration
util/config_file.c
Query resolution
- Query mesh
services/mesh.h - Recursive iterator
iterator/iterator.c - DNSSEC validator
validator/validator.c
DNS data
- DNS caches
services/cache/dns.c - Local authoritative zones
services/authzone.c - Local zones
services/localzone.c - Cachedb backend
cachedb/cachedb.c
Resolver extensions
- DNS64 synthesis
dns64/dns64.c - EDNS client subnet
edns-subnet/subnetmod.c - Response IP policy
respip/respip.c - DNSCrypt
dnscrypt/dnscrypt.c - Query telemetry
dnstap/dtstream.c
Client interfaces
- libunbound API
libunbound/libworker.c
Other components
- DNS client
- DNS response
Connections 20
- DNS client → DNS listener: sends query
README - DNS listener → Daemon worker: dispatches query
- Daemon worker → Network events: uses networking
daemon/worker.c - Daemon worker → Resolver configuration: reads settings
daemon/worker.c - Daemon worker → Query mesh: starts query
daemon/worker.c - Query mesh → Recursive iterator: activates module
- Recursive iterator → DNS caches: looks up records
iterator/iterator.c - Recursive iterator → DNSSEC validator: requests validation
- DNSSEC validator → DNS caches: uses cached data
validator/validator.c - Local authoritative zones → DNS caches: uses DNS cache
services/authzone.c - Daemon worker → Local authoritative zones: uses zone service
- Daemon worker → Local zones: uses local zones
- Cachedb backend → DNS caches: integrates cache
cachedb/cachedb.c - Daemon worker → DNS64 synthesis: enables synthesis
- Daemon worker → EDNS client subnet: enables subnet module
- Daemon worker → Response IP policy: enables response policy
- Network events → DNSCrypt: supports DNSCrypt
util/netevent.c - Daemon worker → Query telemetry: records query events
- libunbound API → Query mesh: submits query
libunbound/libworker.c - Daemon worker → DNS response: sends answer