UNBOUND-CONTROL(8)
๐ธ NAME ๐ธ
okay so bestie, this is the page for local-unbound-control โ the Local-unbound 1.25.1 remote server control utility. that's it, that's the vibe. it's the little remote control for your DNS server ๐
โจ SYNOPSIS โจ
unbound-control [-hq] [-c cfgfile] [-s server] command
๐ DESCRIPTION ๐
unbound-control does remote administration on the local-unbound(8) DNS server. like, you're not even in the same room and it still listens to you. iconic. ๐
so what happens: it reads the config file, contacts the Local-unbound server over TLS, sends the command, and shows you the result. that's the whole loop. ๐ฆ
here are the options you can pass, bestie:
-hโ shows the version and the commandline option help. the "what do i even type" button ๐ซถ-c<cfgfile>โ the config file to read settings from. if you don't give one, the default/var/unbound/unbound.confgets used.-s<server[@port]>โ IPv4 or IPv6 address of the server to contact. if you don't give one, the address comes from the config file. โจ-qโ quiet mode. if you pass this, it prints nothing when everything worked ok. silence = slay ๐
๐ COMMANDS ๐
there are a bunch of commands the server actually understands. let's go through them, no skipping, i promise ๐ซก
startโ starts the server. literally just execslocal-unbound(8). the unbound executable is searched for in thePATHset in the environment, and it's started with the config file you specified using-c, or the default config file. go go go ๐โโ๏ธstopโ stops the server. the server daemon exits. bye bestie ๐ญreloadโ reloads the server. this flushes the cache and reads the config file fresh. clean slate energy โจreload_keep_cacheโ reloads the server but tries to keep the RRset and message cache if the (re)configuration allows for it. and what does that mean? the cache sizes and the number of threads must not change between reloads. no cap.fast_reload [+dpv]โ reloads the server but keeps downtime to a minimum so user queries keep seeing service. this needs the code compiled with threads. the config gets loaded in a thread and prepared, then it briefly pauses the existing server and updates config options. the intent is that the pause doesn't impact the service of user queries. the cache is kept. also user queries that are being worked on are kept and continue โ but with the new config options. ๐ง
NOTE: this command is experimental at this time. you've been warned, bestie ๐
the amount of temporal memory needed during a fast_reload is twice the amount needed for configuration. why? because Local-unbound temporarily needs to store both the current configuration values and the new ones while trying to fast reload. zones loaded from disk (authority zones and RPZ zones) are included in those memory needs. ๐พ
options that can be changed are for forwards, stubs, views, authority zones, RPZ zones and local zones.
also access-control and similar options, interface-action and similar options and tcp-connection-limit. it can reload some define-tag changes โ more on that below. further options include insecure-lan-zones, domain-insecure, trust-anchor-file, trust-anchor, trusted-keys-file, auto-trust-anchor-file, edns-client-string, ipset, log-identity, infra-cache-numhosts, msg-cache-size, rrset-cache-size, key-cache-size, ratelimit-size, neg-cache-size, num-queries-per-thread, jostle-timeout, use-caps-for-id, unwanted-reply-threshold, tls-use-sni, outgoing-tcp-mss, ip-dscp, max-reuse-tcp-queries, tcp-reuse-timeout, tcp-auth-query-timeout, delay-close. iter-scrub-promiscuous. tls-service-key. tls-service-pem. yes i listed every single one, don't test me ๐
it does not work with interface and outgoing-interface changes, also not with remote control, outgoing-port-permit, outgoing-port-avoid, msg-buffer-size, any *-slabs options and statistics-interval changes. hard no ๐ซ
for dnstap, these options can be changed: dnstap-log-resolver-query-messages, dnstap-log-resolver-response-messages, dnstap-log-client-query-messages, dnstap-log-client-response-messages, dnstap-log-forwarder-query-messages and dnstap-log-forwarder-response-messages.
it does not work with these options: dnstap-enable, dnstap-bidirectional, dnstap-socket-path, dnstap-ip, dnstap-tls, dnstap-tls-server-name, dnstap-tls-cert-bundle, dnstap-tls-client-key-file and dnstap-tls-client-cert-file.
the options dnstap-send-identity, dnstap-send-version, dnstap-identity, and dnstap-version can be loaded when +p is not used.
the +v option makes the output verbose, which includes the time it took to do the reload. with +vv it's more verbose, which includes the amount of memory that was allocated temporarily to perform the reload โ and this amount of memory can be big if the config has large contents. in the timing output, the 'reload' time is the time during which the server was paused. โฑ๏ธ
the +p option makes the reload not pause threads โ they keep running. locks are acquired, but items are updated in sequence, so it's possible for threads to see an inconsistent state, with some options from the old config and some options from the new config. like, cache TTL parameters from the old config and forwards from the new config. ๐ the stubs and forwards are updated at the same time so that they're viewed consistently โ either old or new values together. the option makes the reload time take eg. 3 microseconds instead of 0.3 milliseconds during which the worker threads are interrupted. so the interruption is much shorter, at the expense of some inconsistency. after the reload itself, every worker thread is briefly contacted to make them release resources โ this makes the delete timing a little longer, and takes up time from the remote control servicing worker thread. ๐งต
with the nopause option (+p), the reload does not work to reload some options that fast reload works on without the nopause option: val-bogus-ttl, val-override-date, val-sig-skew-min, val-sig-skew-max, val-max-restart, val-nsec3-keysize-iterations, target-fetch-policy, outbound-msg-retry, max-sent-count, max-query-restarts, do-not-query-address, do-not-query-localhost, private-address, private-domain, caps-exempt, nat64-prefix, do-nat64, infra-host-ttl, infra-keep-probing, ratelimit, ip-ratelimit, ip-ratelimit-cookie, wait-limit-netblock, wait-limit-cookie-netblock, ratelimit-below-domain, ratelimit-for-domain. that's the whole list, i counted ๐
the +d option makes the reload drop queries that the worker threads are working on. this is like flush_requestlist. without it, the queries are kept so users keep getting answers for those queries that are currently being processed. the drop makes it so that queries during the lifetime of the query processing see only old, or only new config options. ๐ซถ
when there are changes to the config tags โ from the define-tag option โ then the +d option is implicitly turned on with a warning printout, and queries are dropped. this is to stop references to the old tag information by the old queries. if the number of tags is increased in the newly loaded config, by adding tags at the end, then the implicit +d option is not needed. iykyk โจ
for response ip โ that is, actions associated with IP addresses, and perhaps intersected with access control tag and action information โ those settings are stored with a query when it comes in, based on its source IP address. the old information is kept with the query until the queries are done. this is gone when those queries are resolved and finished, or it's possible to flush the requestlist with +d. ๐
verbositynumberโ changes the verbosity value for logging. same values as theverbosity:keyword inunbound.conf(5). this new setting lasts until the server is issued a reload (taken from the config file again), or the next verbosity control command. ๐ฅlog_reopenโ reopens the logfile: closes it and opens it. useful for logrotation, to make the daemon release the file it's logging to. if you're using syslog it will attempt to close and open the syslog โ which may not work if chrooted. โ ๏ธstatsโ prints statistics. resets the internal counters to zero, and this can be controlled using thestatistics-cumulative:config statement. statistics are printed with one[name]: [value]per line. ๐stats_noresetโ peeks at statistics. prints them like thestatscommand does, but does not reset the internal counters to zero. just looking ๐statusโ displays server status. exit code 3 if not running (the connection to the port is refused), 1 on error, 0 if running. simple as that ๐local_zonename typeโ adds a new local zone withnameandtype. like thelocal-zoneconfig statement. if the zone already exists, the type is changed to the given argument. ๐local_zone_removenameโ removes the local zone with the givenname. removes all local data inside it. if the zone doesn't exist, the command still succeeds. no drama ๐ธlocal_dataRR data...โ adds new local data: the given resource record. like thelocal-data:keyword, except for when no covering zone exists. in that case this remote control command creates a transparent zone with the same name as this record. โจlocal_data_removenameโ removes all RR data from the localname. if the name already has no items, nothing happens. often results inNXDOMAINfor the name (in a static zone), but if the name has become an empty nonterminal (there's still data in domain names below the removed name),NOERRORnodata answers are the result for that name. ๐ญlocal_zonesโ adds local zones read from stdin oflocal-unbound-control. input is read per line, withname space typeon a line. for bulk additions. ๐ฆlocal_zones_removeโ removes local zones read from stdin oflocal-unbound-control. input is one name per line. for bulk removals. ๐งนlocal_datasโ adds local data RRs read from stdin oflocal-unbound-control. input is one RR per line. for bulk additions. ๐ฅlocal_datas_removeโ removes local data RRs read from stdin oflocal-unbound-control. input is one name per line. for bulk removals. ๐๏ธdump_cacheโ the contents of the cache is printed in a text format to stdout. you can redirect it to a file to store the cache in a file. not supported in remote Unbounds in multi-process operation. ๐ซ
load_cache ๐ง
Okay so this one slurps the contents of the cache in from stdin, using the exact same format that dump_cache spits out. โ ๏ธ Big warning though: loading the cache with old or straight-up wrong data can absolutely result in old or wrong data getting handed back to clients โ like, garbage in, garbage out, bestie. This whole "load data into the cache this way" thing exists purely to help with debugging. Also, it's not supported in remote Unbounds in multi-process operation.
cache_lookup [+t] names ๐
Prints the RRsets and messages that are chilling in the cache to stdout. For every name you list, it prints the content at or under that name. You can pass several names separated by spaces and each one gets printed. If subnetcache is enabled, it also prints matching entries from the subnet cache. โจ
The +t option allows tld and root names โ so with it you can use names like 'com' and '.', but fair warning, it takes a lot of effort to look those up in the cache. ๐ฎโ๐จ
lookup name ๐ต๏ธโโ๏ธ
Prints to stdout the name servers that would be used to look up the name you specified. Just a peek, no actual resolving drama.
flush [+c] name ๐๏ธ
Removes the name from the cache. It removes the types A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR, SVCB and HTTPS โ because that's fast to do, periodt. Other record types can be removed using flush_type or flush_zone.
The +c option removes the items also from the cachedb cache โ if cachedb is in use.
flush_type [+c] name type ๐งน
Removes the name + type information from the cache.
The +c option removes the items also from the cachedb cache โ if cachedb is in use.
flush_zone [+c] name ๐ฅ
Removes all information at or below the name from the cache. The rrsets and key entries get removed so that new lookups will be performed. Heads up: this needs to walk and inspect the entire cache, so it's a slow operation, ngl. The entries are set to expired in the implementation of this command โ so with serve-expired enabled, it'll serve that information but schedule a prefetch for new information. ๐
The +c option removes the items also from the cachedb cache โ if cachedb is in use.
flush_bogus [+c] ๐
Removes all bogus data from the cache. Bye, fake news.
The +c option removes the items also from the cachedb cache โ if cachedb is in use.
flush_negative [+c] ๐ญ
Removes all negative data from the cache. That means nxdomain answers, nodata answers and servfail answers. It also removes bad key entries (which could be due to failed lookups) from the dnssec key cache, and iterator last-resort lookup failures from the rrset cache. So thorough. ๐
The +c option removes the items also from the cachedb cache โ if cachedb is in use.
flush_stats ๐
Resets statistics to zero. Fresh start energy.
flush_requestlist ๐ซง
Drops the queries that are worked on. It stops working on the queries the server is working on right now. The cache is unaffected. No reply is sent for those queries โ which probably makes those users request again later, oops. Useful to make the server restart working on queries with new settings, such as a higher verbosity level. ๐
dump_requestlist ๐
Shows what is worked on โ prints all queries the server is currently working on, plus the time that users have been waiting. For internal requests, no time is printed. And then it prints out the module status. Note: this prints the queries from the first thread, and not the queries being serviced from other threads. ๐
flush_infra all|IP ๐
If you pass all, the entire infra cache gets emptied. If you pass a specific IP address, the entry for that address is removed from the cache. It contains EDNS, ping and lameness data.
dump_infra ๐
Shows the contents of the infra cache. Peek behind the curtain.
set_option opt: val โ๏ธ
Sets the option to the given value without a reload. The cache is therefore not flushed. The option must end with a ':' and whitespace must be between the option and the value. Some values may not have an effect if set this way, the new values are not written to the config file, and not all options are supported. This is different from the set_option call in libunbound, where all values work because Local-unbound has not been initialized. iykyk.
The values that work are: statistics-interval, statistics-cumulative, do-not-query-localhost, harden-short-bufsize, harden-large-queries, harden-glue, harden-dnssec-stripped, harden-below-nxdomain, harden-referral-path, prefetch, prefetch-key, log-queries, hide-identity, hide-version, identity, version, val-log-level, val-log-squelch, ignore-cd-flag, add-holddown, del-holddown, keep-missing, tcp-upstream, ssl-upstream, max-udp-size, ratelimit, ip-ratelimit, cache-max-ttl, cache-min-ttl, cache-max-negative-ttl.
get_option opt ๐
Gets the value of the option. Give the option name without a trailing ':'. The value is printed. If the value is "", nothing is printed and the connection closes. On error 'error ...' is printed (it gives a syntax error on unknown option). For some options, a list of values is printed, one on each line. The options are shown from the config file as modified with set_option. For some options an override may have been taken that does not show up with this command โ not results from e.g. the verbosity and forward control commands. Not all options work; see list_stubs, list_forwards, list_local_zones and list_local_data for those. ๐ธ
list_stubs ๐ฆ
Lists the stub zones in use. These are printed one by one to the output. This includes the root hints in use. Cute.
list_forwards ๐งญ
Lists the forward zones in use. These are printed zone by zone to the output.
list_insecure ๐ซ
Lists the zones with domain-insecure.
list_local_zones ๐
Lists the local zones in use. These are printed one per line with zone type.
list_local_data ๐
Lists the local data RRs in use. The resource records are printed.
insecure_add zone โ
Adds a domain-insecure for the given zone, like the statement in unbound.conf. Adds it to the running Local-unbound without affecting the cache contents (which may still be bogus โ use flush_zone to remove it), and it does not affect the config file. ๐
โโ๏ธ
insecure_remove zone โ
Removes domain-insecure for the given zone.
forward_add [+it] zone addr ... โก๏ธ
Adds a new forward zone to running Unbound. With the +i option it also adds a domain-insecure for the zone (so it can resolve insecurely if you have a DNSSEC root trust anchor configured for other names). The addr can be IP4, IP6 or nameserver names, like forward-zone config in unbound.conf. The +t option sets it to use TLS upstream, like forward-tls-upstream: yes. ๐ฅ
forward_remove [+i] zone โฌ
๏ธ
Removes a forward zone from running Unbound. The +i also removes a domain-insecure for the zone.
stub_add [+ipt] zone addr ... ๐ฑ
Adds a new stub zone to running Unbound. With the +i option it also adds a domain-insecure for the zone. With +p the stub zone is set to prime, without it it is set to notprime. The addr can be IP4, IP6 or nameserver names, like the stub-zone: config in unbound.conf. The +t option sets it to use TLS upstream, like stub-tls-upstream: yes.
stub_remove [+i] zone ๐
Removes a stub zone from running Unbound. The +i also removes a domain-insecure for the zone.
forward [off | addr ... ] ๐ฐ๏ธ
Sets up forwarding mode. Configures if the server should ask other upstream nameservers, should go to the internet root nameservers itself, or show the current config. You could pass the nameservers after a DHCP update.
Without arguments, the current list of addresses used to forward all queries to is printed. On startup this is from the forward-zone "." configuration. Afterwards it shows the status. It prints off when no forwarding is used.
If off is passed, forwarding is disabled and the root nameservers are used. This can be used to avoid buggy or non-DNSSEC supporting nameservers returned from DHCP โ but it may not work in hotels or hotspots. ๐จ
If one or more IPv4 or IPv6 addresses are given, those are then used to forward queries to. The addresses must be separated with spaces. With '@port' the port number can be set explicitly (default port is 53 (DNS)).
By default the forwarder information from the config file for the root "." is used. The config file is not changed, so after a reload these changes are gone. Other forward zones from the config file are not affected by this command.
ratelimit_list [+a] ๐
Lists the domains that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all domains, not just the ratelimited domains, with their estimated qps. The ratelimited domains return an error for uncached (new) queries, but cached queries work as normal. ๐
ip_ratelimit_list [+a] ๐
Lists the ip addresses that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all ips, not just the ratelimited ips, with their estimated qps. The ratelimited ips are dropped before checking the cache. ๐ค
list_auth_zones ๐
Lists the auth zones that are configured. Printed one per line with a status, indicating if the zone is expired and current serial number. Configured RPZ zones are included.
auth_zone_reload zone ๐
Reloads the auth zone (or RPZ zone) from zonefile. The zonefile is read in, overwriting the current contents of the zone in memory. This changes the auth zone contents itself, not the cache contents. Such cache contents exists if you set Local-unbound to validate with for-upstream: yes, and that can be cleared with flush_zone zone.
auth_zone_transfer zone ๐ก
Transfers the auth zone (or RPZ zone) from master. The auth zone probe sequence is started, where the masters are probed to see if they have an updated zone (with the SOA serial check). And then the zone is transferred for a newer zone version. ๐ฆ
rpz_enable zone โ
Enables the RPZ zone if it had previously been disabled.
rpz_disable zone โ
Disables the RPZ zone.
view_list_local_zonesview โ thelist_local_zonescommand, but scoped to the view you name. Same energy, different view ๐view_local_zoneview name type โ that'slocal_zonefor the given view.view_local_zone_removeview name โlocal_zone_remove, but for the given view.view_list_local_dataview โlist_local_data, for the given view.view_local_dataview RR data... โlocal_datafor the given view.view_local_data_removeview name โlocal_data_removefor the given view.view_local_datas_removeview โ removes a whole list oflocal_datafor the given view, read from stdin. Exactly likelocal_datas_remove๐ซถview_local_datasview โ adds a list oflocal_datafor the given view, read from stdin. Exactly likelocal_datas.add_cookie_secretsecret โ adds or replaces a cookie secret, and it persists. secret has to be a 128 bit hex string, no exceptions bestie.
So here's the tea: cookie secrets can be either active or staging. Active cookie secrets are the ones used to create DNS Cookies, but verification of a DNS Cookie succeeds with any of the active or staging cookie secrets. Wanna see the current state of things? Print the cookie secrets with the print_cookie_secrets command.
When there are no cookie secrets configured yet, the secret gets added as active. If there's already an active cookie secret, the secret is added as staging โ or it replaces an existing staging secret.
Now, to "roll" a cookie secret used in an anycast set: the new secret has to be added as a staging secret to all nodes in the anycast set. Once all the nodes can verify DNS Cookies with the new secret, you can activate it with the activate_cookie_secret command. And after all the nodes have had the new secret active for at least one hour, the previous secret can be dropped with the drop_cookie_secret command. Whole rollout, chef's kiss ๐
Persistence is accomplished by writing to a file which is configured with the cookie-secret-file option in the server section of the config file. This is disabled by default, "".
drop_cookie_secretโ drops the staging cookie secret. bye girl ๐activate_cookie_secretโ makes the current staging cookie secret active, and the current active cookie secret staging. Switcheroo โจprint_cookie_secretsโ shows the current configured cookie secrets, with their status.
๐ฅ EXIT CODE ๐ฅ
The unbound-control program exits with status code 1 on error, and 0 on success. That's it, that's the whole vibe check ๐
๐ ๏ธ SET UP ๐ ๏ธ
okay so setup requires a self-signed certificate and private keys for both the server and the client. The script unbound-control-setup generates these in the default run directory, or with -d in another directory. Iconic behaviour, honestly.
If you change the access control permissions on the key files, you can decide who gets to use unbound-control โ by default it's the owner and the group, but not all users. Run the script under the same username as you configured in unbound.conf, or as root, so that the daemon is actually permitted to read the files, for example with:
sudo -u local-unbound local-unbound-control-setup
If you haven't configured a username in unbound.conf, the keys need read permission for the user credentials under which the daemon is started. The script preserves private keys already present in the directory. And after running the script as root, turn on control-enable in unbound.conf. Don't forget, bestie ๐
๐ STATISTIC COUNTERS ๐
The stats and stats_noreset commands show a number of statistic counters. Here's the full roster, no skips ๐
threadX.num.queriesโ number of queries received by thread.threadX.num.queries_ip_ratelimitedโ number of queries rate limited by thread.threadX.num.queries_cookie_validโ number of queries with a valid DNS Cookie by thread.threadX.num.queries_cookie_clientโ number of queries with a client part only DNS Cookie by thread.threadX.num.queries_cookie_invalidโ number of queries with an invalid DNS Cookie by thread.threadX.num.queries_discard_timeoutโ number of queries removed due todiscard-timeoutby thread.threadX.num.queries_replyaddr_limitโ number of queries removed due to replyaddr limits by thread.threadX.num.queries_wait_limitโ number of queries removed due towait-limitby thread.threadX.num.cachehitsโ number of queries that were successfully answered using a cache lookup.threadX.num.cachemissโ number of queries that needed recursive processing.threadX.num.dnscrypt.cryptedโ number of queries that were encrypted and successfully decapsulated by dnscrypt.threadX.num.dnscrypt.certโ number of queries that were requesting dnscrypt certificates.threadX.num.dnscrypt.cleartextโ number of queries received on the dnscrypt port that were cleartext and not a request for certificates.threadX.num.dnscrypt.malformedโ number of requests that were neither cleartext nor valid dnscrypt messages. messy ๐threadX.num.dns_error_reportsโ number of DNS Error Reports generated by thread.threadX.num.prefetchโ number of cache prefetches performed. This number is included incachehits, since the original query had the unprefetched answer from cache, and resulted in recursive processing, taking a slot in the requestlist. It's not part of therecursivereplies(or the histogram thereof) orcachemiss, because a cache response was sent.threadX.num.expiredโ number of replies that served an expired cache entry.threadX.num.queries_timed_outโ number of queries that are dropped because they waited in the UDP socket buffer for too long.threadX.query.queue_time_us.maxโ the maximum wait time for packets in the socket buffer, in microseconds. This is only reported whensock-queue-timeoutis enabled.threadX.num.recursiverepliesโ the number of replies sent to queries that needed recursive processing. Could be smaller thanthreadX.num.cachemissif, due to timeouts, no replies were sent for some queries.threadX.requestlist.avgโ the average number of requests in the internal recursive processing request list, on insert of a new incoming recursive processing query.threadX.requestlist.maxโ maximum size attained by the internal recursive processing request list.threadX.requestlist.overwrittenโ number of requests in the request list that were overwritten by newer entries. This happens if there's a flood of queries that need recursive processing and the server is having a hard time. The counter is increased when, during the flood, thejostle-timeoutallows a query to be removed in favor of a new incoming query โ the older query is then dropped to make space.threadX.requestlist.exceededโ queries that were dropped because the request list was full. This happens if a flood of queries need recursive processing and the server can't keep up. The counter is increased when, during the flood, there's no space to be made by jostling out an older query, and the new query is dropped. Since no older queries are removed (see thejostle-timeoutsetting), there's no space for the new query. sad but real ๐ญthreadX.requestlist.current.allโ current size of the request list, includes internally generated queries (such as priming queries and glue lookups).threadX.requestlist.current.userโ current size of the request list, only the requests from client queries.threadX.requestlist.current.repliesโ current count of the number of reply entries waiting on request list entries. Because a request list entry can send results to multiple reply addresses, this number may be larger than the size of the request list.threadX.recursion.time.avgโ average time it took to answer queries that needed recursive processing. Note that queries that were answered from the cache are not in this average.threadX.recursion.time.medianโ the median of the time it took to answer queries that needed recursive processing. Median means 50% of the user queries were answered in less than this time. Because of big outliers (usually queries to non responsive servers), the average can be bigger than the median. This median has been calculated by interpolation from a histogram โ math girl moment ๐งthreadX.tcpusageโ the currently held tcp buffers for incoming connections. A spot value at the time of the request. This helps you spot if theincoming-num-tcpbuffers are full.total.num.queriesโ summed over threads.total.num.queries_ip_ratelimitedโ summed over threads.total.num.queries_cookie_validโ summed over threads.total.num.queries_cookie_clientโ summed over threads.total.num.queries_cookie_invalidโ summed over threads.total.num.queries_discard_timeoutโ summed over threads.total.num.queries_replyaddr_limitโ summed over threads.total.num.queries_wait_limitโ summed over threads.total.num.cachehitsโ summed over threads.total.num.cachemissโ summed over threads.total.num.dnscrypt.cryptedโ summed over threads.total.num.dnscrypt.certโ summed over threads.total.num.dnscrypt.cleartextโ summed over threads.total.num.dnscrypt.malformedโ summed over threads.total.num.dns_error_reportsโ summed over threads.total.num.prefetchโ summed over threads.total.num.expiredโ summed over threads.total.num.queries_timed_outโ summed over threads.total.query.queue_time_us.maxโ the maximum of the thread values.total.num.recursiverepliesโ summed over threads.total.requestlist.avgโ averaged over threads.total.requestlist.maxโ the maximum of the threadrequestlist.maxvalues.total.requestlist.overwrittenโ summed over threads.total.requestlist.exceededโ summed over threads.total.requestlist.current.allโ summed over threads.total.requestlist.current.userโ summed over threads.total.requestlist.current.repliesโ summed over threads.total.recursion.time.medianโ averaged over threads.total.tcpusageโ summed over threads.time.nowโ current time in seconds since1970. era-defining โญtime.upโ uptime since server boot in seconds.time.elapsedโ time since last statistics printout, in seconds.
โจ EXTENDED STATISTICS โจ
okay bestie this is the big list, the one you pull up when you're like "why is my resolver acting up" and you need receipts ๐
these come out of unbound-control stats (and friends) and every single one of them is a little window into what Local-unbound is doing. buckle up ๐
mem.cache.rrsetโ memory in bytes that the RRset cache is currently using. ๐พmem.cache.messageโ memory in bytes in use by the message cache. that's the one holding whole DNS replies, not just rrsets.mem.cache.dnscrypt_shared_secretโ memory in bytes in use by the dnscrypt shared secrets cache ๐.mem.cache.dnscrypt_nonceโ memory in bytes in use by the dnscrypt nonce cache ๐ฒ.mem.mod.iteratorโ memory in bytes in use by the iterator module. yes, that's the thing that does the actual walking-around-the-internet part ๐.mem.mod.validatorโ memory in bytes in use by the validator module. heads up, this includes the key cache AND the negative cache ๐ง .mem.streamwaitโ memory in bytes used by the TCP and TLS stream wait buffers. these are literally answers waiting to be written back to the clients ๐ซถ (yes the manpage says "in used by", we keep that, it's iconic).mem.http.query_bufferโ memory in bytes used by the HTTP/2 query buffers. holds (partial) DNS queries that are waiting on request stream completion ๐ง.mem.http.response_bufferโ memory in bytes used by the HTTP/2 response buffers. holds DNS responses waiting to be written back to the clients ๐ธ.mem.quicโ memory in bytes used by QUIC. holds connection info, stream info, queries read, and responses written back to the clients โก.histogram.<sec>.<usec>.to.<sec>.<usec>โ a whole histogram, summed over all threads. each element counts the recursive queries whose reply time landed between the lower and the upper bound: times larger or equal to the lowerbound, and smaller than the upper bound. there are 40 buckets, and the bucket sizes double each step ๐. she's giving very-much-a-log-scale, iykyk.
tiny note bestie: "lowerbound"/"lower bound", "upperbound"/"upper bound" โ the page is not consistent and honestly neither am I, but the meaning is the same ๐ซ
num.query.type.Aโ the total number of queries over all threads with query typeA. this gets printed for the other query types too, but only for the types that actually received queries โ so=0entries get omitted for brevity ๐. no filler metrics here, periodt.num.query.type.otherโ number of queries with query types256-65535(the long tail, the weird ones ๐ฆ).num.query.class.INโ the total number of queries over all threads with query classIN(internet). also printed for other classes, such asCH(CHAOS) which is sometimes used for debugging, orNONE,ANY, which are used by dynamic update. andnum.query.class.otheris printed for classes256-65535๐.num.query.opcode.QUERYโ the total number of queries over all threads with query opcodeQUERY. also printed for other opcodes,UPDATE, ... and so on ๐num.query.tcpโ number of queries that were made using TCP towards the Local-unbound server.num.query.tcpoutโ number of queries the Local-unbound server itself made using TCP outgoing towards other servers. her little outbound calls ๐.num.query.udpoutโ number of queries the Local-unbound server made using UDP outgoing towards other servers.num.query.tlsโ number of queries made using TLS towards the Local-unbound server. these are also counted innum.query.tcp, because TLS rides on TCP ๐.num.query.tls.resumeโ number of TLS session resumptions: queries over TLS towards the Local-unbound server where the client negotiated a TLS session resumption key โป๏ธ (reusing a session? slay, efficient).num.query.httpsโ number of queries made using HTTPS towards the Local-unbound server. these are also counted innum.query.tcpandnum.query.tls, because HTTPS uses TLS and TCP ๐งโโ๏ธ. the nesting is real.num.query.quicโ number of queries made using QUIC towards the Local-unbound server. these are also counted innum.query.tls, because TLS is used for these queries โก.num.query.ipv6โ number of queries made using IPv6 towards the Local-unbound server ๐.num.query.flags.RDโ the number of queries that had theRDflag set in the header. also printed for flagsQR,AA,TC,RA,Z,AD,CD. โ ๏ธ important: note that queries with flagsQR,AAorTCmay have been rejected because of that.num.query.edns.presentโ number of queries that had an EDNS OPT record present (lowercase "number" in the original, and honestly same ๐ ).num.query.edns.DOโ number of queries that had an EDNS OPT record with theDO(DNSSEC OK) bit set. these queries are also included in thenum.query.edns.presentnumber, so don't double-count them, bestie ๐ซถ.num.query.ratelimitedโ the number of queries that are turned away from being send to nameserver due to ratelimiting ๐ฆ (yep, "being send", we're keeping the original phrasing, it's part of the vibe now).num.query.dnscrypt.shared_secret.cachemissโ the number of dnscrypt queries that did not find a shared secret in the cache. you can use this to compute the shared secret hitrate ๐ฏ.num.query.dnscrypt.replayโ the number of dnscrypt queries that found a nonce hit in the nonce cache and hence are considered a query replay ๐จ. (someone's being shady.)num.answer.rcode.NXDOMAINโ the number of answers to queries, from cache or from recursion, that had the return codeNXDOMAIN. also printed for the other return codes ๐.num.answer.rcode.nodataโ the number of answers to queries that had the pseudo return codenodata. what that means: the actual return code wasNOERROR, but additionally, no data was carried in the answer (making what is called aNOERROR/NODATAanswer). these queries are also included in thenum.answer.rcode.NOERRORnumber. super common for AAAA lookups when an A record exists and there's no AAAA ๐ณ๏ธ.num.answer.secureโ number of answers that were secure. the answer validated correctly โ . theADbit might have been set in some of these answers, where the client signalled (withDOorADbit in the query) that they were ready to accept theADbit in the answer. consent-based AD bit, we love to see it.num.answer.bogusโ number of answers that were bogus ๐. these answers resulted inSERVFAILto the client because the answer failed validation. yeah. that's a bad day.num.rrset.bogusโ the number of rrsets marked bogus by the validator. increased for every RRset inspection that fails ๐num.valopsโ the number of validation operations performed by the validator. increased for every RRSIG verification operation regardless of the validation result. important caveat: the RRSIG and key combination needs to first pass some sanity checks before Local-unbound even performs the verification, e.g., length/protocol checks ๐. so this isn't "how many sigs got checked", it's "how many made it far enough to be attempted".num.query.authzone.upโ the number of queries answered from auth-zone data, upstream queries. these queries would otherwise have been sent (with fallback enabled) to the internet, but are now answered from the auth zone ๐ .num.query.authzone.downโ the number of queries for downstream answered from auth-zone data. these queries are from downstream clients, and have had an answer from the data in the auth zone ๐ซถ.num.query.aggressive.NOERRORโ the number of queries answered using cached NSEC records withNODATARCODE. these queries would otherwise have been sent to the internet, but are now answered using cached data ๐๏ธ (aggressive NSEC, the glow-up).num.query.aggressive.NXDOMAINโ the number of queries answered using cached NSEC records withNXDOMAINRCODE. same deal: would otherwise have been sent to the internet, now answered from cache ๐๏ธ.num.query.subnetโ number of queries that got an answer that contained EDNS client subnet data ๐.num.query.subnet_cacheโ number of queries answered from the edns client subnet cache. heads up: these are counted as cachemiss by the main counters, but they hit the client subnet specific cache after getting processed by the edns client subnet module ๐.num.query.cachedbโ number of queries answered from the external cache ofcachedb. same pattern: these are counted as cachemiss by the main counters, but they hit the cachedb external cache after getting processed by the cachedb module ๐๏ธ.num.rpz.action.<rpz_action>โ number of queries answered using the configured RPZ policy, per RPZ action type. the possible actions are:nxdomain,nodata,passthru,drop,tcp-only,local-data,disabled, andcname-override๐๏ธ.
like, that's a lot of counters, but honestly once you know what each one's doing they're so useful โ it's giving "resolver x-ray" ๐ฅ
๐ FILES ๐
/var/unbound/unbound.confโ the local-unbound config file, aka the blueprint. this is where all the rules live, bestie ๐๏ธ/var/unboundโ the directory that's holding all the secret stuff, and yes it's private:unbound_server.keyandunbound_control.keyโ the private keys ๐๐unbound_server.pemandunbound_control.pemโ the self-signed certificates ๐
ok so real talk โ those keys and certs are the whole reason unbound-control can talk to the server safely. treat that directory like your diary. locked. ๐
๐ธ SEE ALSO ๐ธ
like, go read those too fr fr. one's the config, one's the server itself. iykyk ๐ฆ
๐ AUTHOR ๐
the Local-unbound developers are mentioned in the CREDITS file in the distribution. iconic behavior honestly, credit where credit is due ๐ซถ
โญ COPYRIGHT โญ
1999-2026, NLnet Labs
no cap, that's the copyright line, verbatim, all of it ๐
okay bestie that's genuinely the whole page, you made it to the end, i'm so proud ๐ญ๐ this gem is from unbound-control โ source/version 1.25.1 โ dated May 20, 2026, and it's filed under UNBOUND-CONTROL(8). slay, go control some unbound โจ๐๐
๐ฆ where this page comes from
- freebsd 15.1: base 15.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms