1 .TH "unbound-control" "8" "Oct 8, 2020" "NLnet Labs" "unbound 1.12.0"
3 .\" unbound-control.8 -- unbound remote control manual
5 .\" Copyright (c) 2008, NLnet Labs. All rights reserved.
7 .\" See LICENSE for the license.
12 .B unbound\-control\-setup
13 \- Unbound remote server control utility.
24 performs remote administration on the \fIunbound\fR(8) DNS server.
25 It reads the configuration file, contacts the unbound server over SSL
26 sends the command and displays the result.
28 The available options are:
31 Show the version and commandline option help.
34 The config file to read with settings. If not given the default
35 config file @ub_conf_file@ is used.
37 .B \-s \fIserver[@port]
38 IPv4 or IPv6 address of the server to contact. If not given, the
39 address is read from the config file.
42 quiet, if the option is given it does not print anything if it works ok.
44 There are several commands that the server understands.
47 Start the server. Simply execs \fIunbound\fR(8). The unbound executable
48 is searched for in the \fBPATH\fR set in the environment. It is started
49 with the config file specified using \fI\-c\fR or the default config file.
52 Stop the server. The server daemon exits.
55 Reload the server. This flushes the cache and reads the config file fresh.
57 .B verbosity \fInumber
58 Change verbosity value for logging. Same values as \fBverbosity\fR keyword in
59 \fIunbound.conf\fR(5). This new setting lasts until the server is issued
60 a reload (taken from config file again), or the next verbosity control command.
63 Reopen the logfile, close and open it. Useful for logrotation to make the
64 daemon release the file it is logging to. If you are using syslog it will
65 attempt to close and open the syslog (which may not work if chrooted).
68 Print statistics. Resets the internal counters to zero, this can be
69 controlled using the \fBstatistics\-cumulative\fR config statement.
70 Statistics are printed with one [name]: [value] per line.
73 Peek at statistics. Prints them like the \fBstats\fR command does, but does not
74 reset the internal counters to zero.
77 Display server status. Exit code 3 if not running (the connection to the
78 port is refused), 1 on error, 0 if running.
80 .B local_zone \fIname\fR \fItype
81 Add new local zone with name and type. Like \fBlocal\-zone\fR config statement.
82 If the zone already exists, the type is changed to the given argument.
84 .B local_zone_remove \fIname
85 Remove the local zone with the given name. Removes all local data inside
86 it. If the zone does not exist, the command succeeds.
88 .B local_data \fIRR data...
89 Add new local data, the given resource record. Like \fBlocal\-data\fR
90 config statement, except for when no covering zone exists. In that case
91 this remote control command creates a transparent zone with the same
92 name as this record. This command is not good at returning detailed syntax
95 .B local_data_remove \fIname
96 Remove all RR data from local name. If the name already has no items,
97 nothing happens. Often results in NXDOMAIN for the name (in a static zone),
98 but if the name has become an empty nonterminal (there is still data in
99 domain names below the removed name), NOERROR nodata answers are the
100 result for that name.
103 Add local zones read from stdin of unbound\-control. Input is read per line,
104 with name space type on a line. For bulk additions.
106 .B local_zones_remove
107 Remove local zones read from stdin of unbound\-control. Input is one name per
108 line. For bulk removals.
111 Add local data RRs read from stdin of unbound\-control. Input is one RR per
112 line. For bulk additions.
114 .B local_datas_remove
115 Remove local data RRs read from stdin of unbound\-control. Input is one name per
116 line. For bulk removals.
119 The contents of the cache is printed in a text format to stdout. You can
120 redirect it to a file to store the cache in a file.
123 The contents of the cache is loaded from stdin. Uses the same format as
124 dump_cache uses. Loading the cache with old, or wrong data can result
125 in old or wrong data returned to clients. Loading data into the cache
126 in this way is supported in order to aid with debugging.
129 Print to stdout the name servers that would be used to look up the
133 Remove the name from the cache. Removes the types
134 A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV and NAPTR.
135 Because that is fast to do. Other record types can be removed using
140 .B flush_type \fIname\fR \fItype
141 Remove the name, type information from the cache.
143 .B flush_zone \fIname
144 Remove all information at or below the name from the cache.
145 The rrsets and key entries are removed so that new lookups will be performed.
146 This needs to walk and inspect the entire cache, and is a slow operation.
147 The entries are set to expired in the implementation of this command (so,
148 with serve\-expired enabled, it'll serve that information but schedule a
149 prefetch for new information).
152 Remove all bogus data from the cache.
155 Remove all negative data from the cache. This is nxdomain answers,
156 nodata answers and servfail answers. Also removes bad key entries
157 (which could be due to failed lookups) from the dnssec key cache, and
158 iterator last-resort lookup failures from the rrset cache.
161 Reset statistics to zero.
164 Drop the queries that are worked on. Stops working on the queries that the
165 server is working on now. The cache is unaffected. No reply is sent for
166 those queries, probably making those users request again later.
167 Useful to make the server restart working on queries with new settings,
168 such as a higher verbosity level.
171 Show what is worked on. Prints all queries that the server is currently
172 working on. Prints the time that users have been waiting. For internal
173 requests, no time is printed. And then prints out the module status.
174 This prints the queries from the first thread, and not queries that are
175 being serviced from other threads.
177 .B flush_infra \fIall|IP
178 If all then entire infra cache is emptied. If a specific IP address, the
179 entry for that address is removed from the cache. It contains EDNS, ping
183 Show the contents of the infra cache.
185 .B set_option \fIopt: val
186 Set the option to the given value without a reload. The cache is
187 therefore not flushed. The option must end with a ':' and whitespace
188 must be between the option and the value. Some values may not have an
189 effect if set this way, the new values are not written to the config file,
190 not all options are supported. This is different from the set_option call
191 in libunbound, where all values work because unbound has not been initialized.
193 The values that work are: statistics\-interval, statistics\-cumulative,
194 do\-not\-query\-localhost, harden\-short\-bufsize, harden\-large\-queries,
195 harden\-glue, harden\-dnssec\-stripped, harden\-below\-nxdomain,
196 harden\-referral\-path, prefetch, prefetch\-key, log\-queries,
197 hide\-identity, hide\-version, identity, version, val\-log\-level,
198 val\-log\-squelch, ignore\-cd\-flag, add\-holddown, del\-holddown,
199 keep\-missing, tcp\-upstream, ssl\-upstream, max\-udp\-size, ratelimit,
200 ip\-ratelimit, cache\-max\-ttl, cache\-min\-ttl, cache\-max\-negative\-ttl.
203 Get the value of the option. Give the option name without a trailing ':'.
204 The value is printed. If the value is "", nothing is printed
205 and the connection closes. On error 'error ...' is printed (it gives
206 a syntax error on unknown option). For some options a list of values,
207 one on each line, is printed. The options are shown from the config file
208 as modified with set_option. For some options an override may have been
209 taken that does not show up with this command, not results from e.g. the
210 verbosity and forward control commands. Not all options work, see list_stubs,
211 list_forwards, list_local_zones and list_local_data for those.
214 List the stub zones in use. These are printed one by one to the output.
215 This includes the root hints in use.
218 List the forward zones in use. These are printed zone by zone to the output.
221 List the zones with domain\-insecure.
224 List the local zones in use. These are printed one per line with zone type.
227 List the local data RRs in use. The resource records are printed.
229 .B insecure_add \fIzone
230 Add a \fBdomain\-insecure\fR for the given zone, like the statement in unbound.conf.
231 Adds to the running unbound without affecting the cache contents (which may
232 still be bogus, use \fBflush_zone\fR to remove it), does not affect the config file.
234 .B insecure_remove \fIzone
235 Removes domain\-insecure for the given zone.
237 .B forward_add \fR[\fI+i\fR] \fIzone addr ...
238 Add a new forward zone to running unbound. With +i option also adds a
239 \fIdomain\-insecure\fR for the zone (so it can resolve insecurely if you have
240 a DNSSEC root trust anchor configured for other names).
241 The addr can be IP4, IP6 or nameserver names, like \fIforward-zone\fR config
244 .B forward_remove \fR[\fI+i\fR] \fIzone
245 Remove a forward zone from running unbound. The +i also removes a
246 \fIdomain\-insecure\fR for the zone.
248 .B stub_add \fR[\fI+ip\fR] \fIzone addr ...
249 Add a new stub zone to running unbound. With +i option also adds a
250 \fIdomain\-insecure\fR for the zone. With +p the stub zone is set to prime,
251 without it it is set to notprime. The addr can be IP4, IP6 or nameserver
252 names, like the \fIstub-zone\fR config in unbound.conf.
254 .B stub_remove \fR[\fI+i\fR] \fIzone
255 Remove a stub zone from running unbound. The +i also removes a
256 \fIdomain\-insecure\fR for the zone.
258 .B forward \fR[\fIoff\fR | \fIaddr ...\fR ]
259 Setup forwarding mode. Configures if the server should ask other upstream
260 nameservers, should go to the internet root nameservers itself, or show
261 the current config. You could pass the nameservers after a DHCP update.
263 Without arguments the current list of addresses used to forward all queries
264 to is printed. On startup this is from the forward\-zone "." configuration.
265 Afterwards it shows the status. It prints off when no forwarding is used.
267 If \fIoff\fR is passed, forwarding is disabled and the root nameservers
268 are used. This can be used to avoid to avoid buggy or non\-DNSSEC supporting
269 nameservers returned from DHCP. But may not work in hotels or hotspots.
271 If one or more IPv4 or IPv6 addresses are given, those are then used to forward
272 queries to. The addresses must be separated with spaces. With '@port' the
273 port number can be set explicitly (default port is 53 (DNS)).
275 By default the forwarder information from the config file for the root "." is
276 used. The config file is not changed, so after a reload these changes are
277 gone. Other forward zones from the config file are not affected by this command.
279 .B ratelimit_list \fR[\fI+a\fR]
280 List the domains that are ratelimited. Printed one per line with current
281 estimated qps and qps limit from config. With +a it prints all domains, not
282 just the ratelimited domains, with their estimated qps. The ratelimited
283 domains return an error for uncached (new) queries, but cached queries work
286 .B ip_ratelimit_list \fR[\fI+a\fR]
287 List the ip addresses that are ratelimited. Printed one per line with current
288 estimated qps and qps limit from config. With +a it prints all ips, not
289 just the ratelimited ips, with their estimated qps. The ratelimited
290 ips are dropped before checking the cache.
293 List the auth zones that are configured. Printed one per line with a
294 status, indicating if the zone is expired and current serial number.
296 .B auth_zone_reload \fIzone\fR
297 Reload the auth zone from zonefile. The zonefile is read in overwriting
298 the current contents of the zone in memory. This changes the auth zone
299 contents itself, not the cache contents. Such cache contents exists if
300 you set unbound to validate with for-upstream yes and that can be cleared
301 with \fBflush_zone\fR \fIzone\fR.
303 .B auth_zone_transfer \fIzone\fR
304 Transfer the auth zone from master. The auth zone probe sequence is started,
305 where the masters are probed to see if they have an updated zone (with the SOA
306 serial check). And then the zone is transferred for a newer zone version.
308 .B view_list_local_zones \fIview\fR
309 \fIlist_local_zones\fR for given view.
311 .B view_local_zone \fIview\fR \fIname\fR \fItype
312 \fIlocal_zone\fR for given view.
314 .B view_local_zone_remove \fIview\fR \fIname
315 \fIlocal_zone_remove\fR for given view.
317 .B view_list_local_data \fIview\fR
318 \fIlist_local_data\fR for given view.
320 .B view_local_data \fIview\fR \fIRR data...
321 \fIlocal_data\fR for given view.
323 .B view_local_data_remove \fIview\fR \fIname
324 \fIlocal_data_remove\fR for given view.
326 .B view_local_datas_remove \fIview\fR
327 Remove a list of \fIlocal_data\fR for given view from stdin. Like local_datas_remove.
329 .B view_local_datas \fIview\fR
330 Add a list of \fIlocal_data\fR for given view from stdin. Like local_datas.
332 The unbound\-control program exits with status code 1 on error, 0 on success.
334 The setup requires a self\-signed certificate and private keys for both
335 the server and client. The script \fIunbound\-control\-setup\fR generates
336 these in the default run directory, or with \-d in another directory.
337 If you change the access control permissions on the key files you can decide
338 who can use unbound\-control, by default owner and group but not all users.
339 Run the script under the same username as you have configured in unbound.conf
340 or as root, so that the daemon is permitted to read the files, for example with:
342 sudo \-u unbound unbound\-control\-setup
344 If you have not configured
345 a username in unbound.conf, the keys need read permission for the user
346 credentials under which the daemon is started.
347 The script preserves private keys present in the directory.
348 After running the script as root, turn on \fBcontrol\-enable\fR in
350 .SH "STATISTIC COUNTERS"
351 The \fIstats\fR command shows a number of statistic counters.
353 .I threadX.num.queries
354 number of queries received by thread
356 .I threadX.num.queries_ip_ratelimited
357 number of queries rate limited by thread
359 .I threadX.num.cachehits
360 number of queries that were successfully answered using a cache lookup
362 .I threadX.num.cachemiss
363 number of queries that needed recursive processing
365 .I threadX.num.dnscrypt.crypted
366 number of queries that were encrypted and successfully decapsulated by dnscrypt.
368 .I threadX.num.dnscrypt.cert
369 number of queries that were requesting dnscrypt certificates.
371 .I threadX.num.dnscrypt.cleartext
372 number of queries received on dnscrypt port that were cleartext and not a
373 request for certificates.
375 .I threadX.num.dnscrypt.malformed
376 number of request that were neither cleartext, not valid dnscrypt messages.
378 .I threadX.num.prefetch
379 number of cache prefetches performed. This number is included in
380 cachehits, as the original query had the unprefetched answer from cache,
381 and resulted in recursive processing, taking a slot in the requestlist.
382 Not part of the recursivereplies (or the histogram thereof) or cachemiss,
383 as a cache response was sent.
385 .I threadX.num.expired
386 number of replies that served an expired cache entry.
388 .I threadX.num.recursivereplies
389 The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.
391 .I threadX.requestlist.avg
392 The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.
394 .I threadX.requestlist.max
395 Maximum size attained by the internal recursive processing request list.
397 .I threadX.requestlist.overwritten
398 Number of requests in the request list that were overwritten by newer entries. This happens if there is a flood of queries that recursive processing and the server has a hard time.
400 .I threadX.requestlist.exceeded
401 Queries that were dropped because the request list was full. This happens if a flood of queries need recursive processing, and the server can not keep up.
403 .I threadX.requestlist.current.all
404 Current size of the request list, includes internally generated queries (such
405 as priming queries and glue lookups).
407 .I threadX.requestlist.current.user
408 Current size of the request list, only the requests from client queries.
410 .I threadX.recursion.time.avg
411 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.
413 .I threadX.recursion.time.median
414 The median of the time it took to answer queries that needed recursive
415 processing. The median means that 50% of the user queries were answered in
416 less than this time. Because of big outliers (usually queries to non
417 responsive servers), the average can be bigger than the median. This median
418 has been calculated by interpolation from a histogram.
421 The currently held tcp buffers for incoming connections. A spot value on
422 the time of the request. This helps you spot if the incoming\-num\-tcp
428 .I total.num.cachehits
431 .I total.num.cachemiss
434 .I total.num.dnscrypt.crypted
437 .I total.num.dnscrypt.cert
440 .I total.num.dnscrypt.cleartext
443 .I total.num.dnscrypt.malformed
446 .I total.num.prefetch
452 .I total.num.recursivereplies
455 .I total.requestlist.avg
456 averaged over threads.
458 .I total.requestlist.max
459 the maximum of the thread requestlist.max values.
461 .I total.requestlist.overwritten
464 .I total.requestlist.exceeded
467 .I total.requestlist.current.all
470 .I total.recursion.time.median
471 averaged over threads.
477 current time in seconds since 1970.
480 uptime since server boot in seconds.
483 time since last statistics printout, in seconds.
484 .SH EXTENDED STATISTICS
487 Memory in bytes in use by the RRset cache.
490 Memory in bytes in use by the message cache.
492 .I mem.cache.dnscrypt_shared_secret
493 Memory in bytes in use by the dnscrypt shared secrets cache.
495 .I mem.cache.dnscrypt_nonce
496 Memory in bytes in use by the dnscrypt nonce cache.
499 Memory in bytes in use by the iterator module.
502 Memory in bytes in use by the validator module. Includes the key cache and
506 Memory in bytes in used by the TCP and TLS stream wait buffers. These are
507 answers waiting to be written back to the clients.
509 .I mem.http.query_buffer
510 Memory in bytes used by the HTTP/2 query buffers. Containing (partial) DNS
511 queries waiting for request stream completion.
513 .I mem.http.response_buffer
514 Memory in bytes used by the HTTP/2 response buffers. Containing DNS responses
515 waiting to be written back to the clients.
517 .I histogram.<sec>.<usec>.to.<sec>.<usec>
518 Shows a histogram, summed over all threads. Every element counts the
519 recursive queries whose reply time fit between the lower and upper bound.
520 Times larger or equal to the lowerbound, and smaller than the upper bound.
521 There are 40 buckets, with bucket sizes doubling.
524 The total number of queries over all threads with query type A.
525 Printed for the other query types as well, but only for the types for which
526 queries were received, thus =0 entries are omitted for brevity.
528 .I num.query.type.other
529 Number of queries with query types 256\-65535.
531 .I num.query.class.IN
532 The total number of queries over all threads with query class IN (internet).
533 Also printed for other classes (such as CH (CHAOS) sometimes used for
534 debugging), or NONE, ANY, used by dynamic update.
535 num.query.class.other is printed for classes 256\-65535.
537 .I num.query.opcode.QUERY
538 The total number of queries over all threads with query opcode QUERY.
539 Also printed for other opcodes, UPDATE, ...
542 Number of queries that were made using TCP towards the unbound server.
545 Number of queries that the unbound server made using TCP outgoing towards
549 Number of queries that were made using TLS towards the unbound server.
550 These are also counted in num.query.tcp, because TLS uses TCP.
552 .I num.query.tls.resume
553 Number of TLS session resumptions, these are queries over TLS towards
554 the unbound server where the client negotiated a TLS session resumption key.
557 Number of queries that were made using HTTPS towards the unbound server.
558 These are also counted in num.query.tcp and num.query.tls, because HTTPS
562 Number of queries that were made using IPv6 towards the unbound server.
564 .I num.query.flags.RD
565 The number of queries that had the RD flag set in the header.
566 Also printed for flags QR, AA, TC, RA, Z, AD, CD.
567 Note that queries with flags QR, AA or TC may have been rejected
570 .I num.query.edns.present
571 number of queries that had an EDNS OPT record present.
574 number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set.
575 These queries are also included in the num.query.edns.present number.
577 .I num.query.ratelimited
578 The number of queries that are turned away from being send to nameserver due to
581 .I num.query.dnscrypt.shared_secret.cachemiss
582 The number of dnscrypt queries that did not find a shared secret in the cache.
583 The can be use to compute the shared secret hitrate.
585 .I num.query.dnscrypt.replay
586 The number of dnscrypt queries that found a nonce hit in the nonce cache and
587 hence are considered a query replay.
589 .I num.answer.rcode.NXDOMAIN
590 The number of answers to queries, from cache or from recursion, that had the
591 return code NXDOMAIN. Also printed for the other return codes.
593 .I num.answer.rcode.nodata
594 The number of answers to queries that had the pseudo return code nodata.
595 This means the actual return code was NOERROR, but additionally, no data was
596 carried in the answer (making what is called a NOERROR/NODATA answer).
597 These queries are also included in the num.answer.rcode.NOERROR number.
598 Common for AAAA lookups when an A record exists, and no AAAA.
601 Number of answers that were secure. The answer validated correctly.
602 The AD bit might have been set in some of these answers, where the client
603 signalled (with DO or AD bit in the query) that they were ready to accept
604 the AD bit in the answer.
607 Number of answers that were bogus. These answers resulted in SERVFAIL
608 to the client because the answer failed validation.
611 The number of rrsets marked bogus by the validator. Increased for every
612 RRset inspection that fails.
615 Number of queries that were refused or dropped because they failed the
616 access control settings.
619 Replies that were unwanted or unsolicited. Could have been random traffic,
620 delayed duplicates, very late answers, or could be spoofing attempts.
621 Some low level of late answers and delayed duplicates are to be expected
622 with the UDP protocol. Very high values could indicate a threat (spoofing).
625 The number of items (DNS replies) in the message cache.
628 The number of RRsets in the rrset cache. This includes rrsets used by
629 the messages in the message cache, but also delegation information.
632 The number of items in the infra cache. These are IP addresses with their
633 timing and protocol support information.
636 The number of items in the key cache. These are DNSSEC keys, one item
637 per delegation point, and their validation status.
639 .I dnscrypt_shared_secret.cache.count
640 The number of items in the shared secret cache. These are precomputed shared
641 secrets for a given client public key/server secret key pair. Shared secrets
642 are CPU intensive and this cache allows unbound to avoid recomputing the
643 shared secret when multiple dnscrypt queries are sent from the same client.
645 .I dnscrypt_nonce.cache.count
646 The number of items in the client nonce cache. This cache is used to prevent
647 dnscrypt queries replay. The client nonce must be unique for each client public
648 key/server secret key pair. This cache should be able to host QPS * `replay
649 window` interval keys to prevent replay of a query during `replay window`
652 .I num.query.authzone.up
653 The number of queries answered from auth\-zone data, upstream queries.
654 These queries would otherwise have been sent (with fallback enabled) to
655 the internet, but are now answered from the auth zone.
657 .I num.query.authzone.down
658 The number of queries for downstream answered from auth\-zone data.
659 These queries are from downstream clients, and have had an answer from
660 the data in the auth zone.
662 .I num.query.aggressive.NOERROR
663 The number of queries answered using cached NSEC records with NODATA RCODE.
664 These queries would otherwise have been sent to the internet, but are now
665 answered using cached data.
667 .I num.query.aggressive.NXDOMAIN
668 The number of queries answered using cached NSEC records with NXDOMAIN RCODE.
669 These queries would otherwise have been sent to the internet, but are now
670 answered using cached data.
673 Number of queries that got an answer that contained EDNS client subnet data.
675 .I num.query.subnet_cache
676 Number of queries answered from the edns client subnet cache. These are
677 counted as cachemiss by the main counters, but hit the client subnet
678 specific cache, after getting processed by the edns client subnet module.
680 .I num.rpz.action.<rpz_action>
681 Number of queries answered using configured RPZ policy, per RPZ action type.
682 Possible actions are: nxdomain, nodata, passthru, drop, local_data, disabled,
687 unbound configuration file.
690 directory with private keys (unbound_server.key and unbound_control.key) and
691 self\-signed certificates (unbound_server.pem and unbound_control.pem).
693 \fIunbound.conf\fR(5),