1unbound-control(8) unbound 1.6.6 unbound-control(8)
2
3
4
6 unbound-control, unbound-control-setup - Unbound remote server control
7 utility.
8
10 unbound-control [-hq] [-c cfgfile] [-s server] command
11
13 Unbound-control performs remote administration on the unbound(8) DNS
14 server. It reads the configuration file, contacts the unbound server
15 over SSL sends the command and displays the result.
16
17 The available options are:
18
19 -h Show the version and commandline option help.
20
21 -c cfgfile
22 The config file to read with settings. If not given the default
23 config file /etc/unbound/unbound.conf is used.
24
25 -s server[@port]
26 IPv4 or IPv6 address of the server to contact. If not given,
27 the address is read from the config file.
28
29 -q quiet, if the option is given it does not print anything if it
30 works ok.
31
33 There are several commands that the server understands.
34
35 start Start the server. Simply execs unbound(8). The unbound exe‐
36 cutable is searched for in the PATH set in the environment. It
37 is started with the config file specified using -c or the
38 default config file.
39
40 stop Stop the server. The server daemon exits.
41
42 reload Reload the server. This flushes the cache and reads the config
43 file fresh.
44
45 verbosity number
46 Change verbosity value for logging. Same values as verbosity
47 keyword in unbound.conf(5). This new setting lasts until the
48 server is issued a reload (taken from config file again), or the
49 next verbosity control command.
50
51 log_reopen
52 Reopen the logfile, close and open it. Useful for logrotation
53 to make the daemon release the file it is logging to. If you
54 are using syslog it will attempt to close and open the syslog
55 (which may not work if chrooted).
56
57 stats Print statistics. Resets the internal counters to zero, this can
58 be controlled using the statistics-cumulative config statement.
59 Statistics are printed with one [name]: [value] per line.
60
61 stats_noreset
62 Peek at statistics. Prints them like the stats command does, but
63 does not reset the internal counters to zero.
64
65 status Display server status. Exit code 3 if not running (the connec‐
66 tion to the port is refused), 1 on error, 0 if running.
67
68 local_zone name type
69 Add new local zone with name and type. Like local-zone config
70 statement. If the zone already exists, the type is changed to
71 the given argument.
72
73 local_zone_remove name
74 Remove the local zone with the given name. Removes all local
75 data inside it. If the zone does not exist, the command suc‐
76 ceeds.
77
78 local_data RR data...
79 Add new local data, the given resource record. Like local-data
80 config statement, except for when no covering zone exists. In
81 that case this remote control command creates a transparent zone
82 with the same name as this record. This command is not good at
83 returning detailed syntax errors.
84
85 local_data_remove name
86 Remove all RR data from local name. If the name already has no
87 items, nothing happens. Often results in NXDOMAIN for the name
88 (in a static zone), but if the name has become an empty nonter‐
89 minal (there is still data in domain names below the removed
90 name), NOERROR nodata answers are the result for that name.
91
92 local_zones
93 Add local zones read from stdin of unbound-control. Input is
94 read per line, with name space type on a line. For bulk addi‐
95 tions.
96
97 local_zones_remove
98 Remove local zones read from stdin of unbound-control. Input is
99 one name per line. For bulk removals.
100
101 local_datas
102 Add local data RRs read from stdin of unbound-control. Input is
103 one RR per line. For bulk additions.
104
105 local_datas_remove
106 Remove local data RRs read from stdin of unbound-control. Input
107 is one name per line. For bulk removals.
108
109 dump_cache
110 The contents of the cache is printed in a text format to stdout.
111 You can redirect it to a file to store the cache in a file.
112
113 load_cache
114 The contents of the cache is loaded from stdin. Uses the same
115 format as dump_cache uses. Loading the cache with old, or wrong
116 data can result in old or wrong data returned to clients. Load‐
117 ing data into the cache in this way is supported in order to aid
118 with debugging.
119
120 lookup name
121 Print to stdout the name servers that would be used to look up
122 the name specified.
123
124 flush name
125 Remove the name from the cache. Removes the types A, AAAA, NS,
126 SOA, CNAME, DNAME, MX, PTR, SRV and NAPTR. Because that is fast
127 to do. Other record types can be removed using flush_type or
128 flush_zone.
129
130 flush_type name type
131 Remove the name, type information from the cache.
132
133 flush_zone name
134 Remove all information at or below the name from the cache. The
135 rrsets and key entries are removed so that new lookups will be
136 performed. This needs to walk and inspect the entire cache, and
137 is a slow operation.
138
139 flush_bogus
140 Remove all bogus data from the cache.
141
142 flush_negative
143 Remove all negative data from the cache. This is nxdomain
144 answers, nodata answers and servfail answers. Also removes bad
145 key entries (which could be due to failed lookups) from the
146 dnssec key cache, and iterator last-resort lookup failures from
147 the rrset cache.
148
149 flush_stats
150 Reset statistics to zero.
151
152 flush_requestlist
153 Drop the queries that are worked on. Stops working on the
154 queries that the server is working on now. The cache is unaf‐
155 fected. No reply is sent for those queries, probably making
156 those users request again later. Useful to make the server
157 restart working on queries with new settings, such as a higher
158 verbosity level.
159
160 dump_requestlist
161 Show what is worked on. Prints all queries that the server is
162 currently working on. Prints the time that users have been
163 waiting. For internal requests, no time is printed. And then
164 prints out the module status. This prints the queries from the
165 first thread, and not queries that are being serviced from other
166 threads.
167
168 flush_infra all|IP
169 If all then entire infra cache is emptied. If a specific IP
170 address, the entry for that address is removed from the cache.
171 It contains EDNS, ping and lameness data.
172
173 dump_infra
174 Show the contents of the infra cache.
175
176 set_option opt: val
177 Set the option to the given value without a reload. The cache
178 is therefore not flushed. The option must end with a ':' and
179 whitespace must be between the option and the value. Some val‐
180 ues may not have an effect if set this way, the new values are
181 not written to the config file, not all options are supported.
182 This is different from the set_option call in libunbound, where
183 all values work because unbound has not been initialized.
184
185 The values that work are: statistics-interval, statistics-cumu‐
186 lative, do-not-query-localhost, harden-short-bufsize,
187 harden-large-queries, harden-glue, harden-dnssec-stripped,
188 harden-below-nxdomain, harden-referral-path, prefetch,
189 prefetch-key, log-queries, hide-identity, hide-version, iden‐
190 tity, version, val-log-level, val-log-squelch, ignore-cd-flag,
191 add-holddown, del-holddown, keep-missing, tcp-upstream,
192 ssl-upstream, max-udp-size, ratelimit, ip-ratelimit,
193 cache-max-ttl, cache-min-ttl, cache-max-negative-ttl.
194
195 get_option opt
196 Get the value of the option. Give the option name without a
197 trailing ':'. The value is printed. If the value is "", noth‐
198 ing is printed and the connection closes. On error 'error ...'
199 is printed (it gives a syntax error on unknown option). For
200 some options a list of values, one on each line, is printed.
201 The options are shown from the config file as modified with
202 set_option. For some options an override may have been taken
203 that does not show up with this command, not results from e.g.
204 the verbosity and forward control commands. Not all options
205 work, see list_stubs, list_forwards, list_local_zones and
206 list_local_data for those.
207
208 list_stubs
209 List the stub zones in use. These are printed one by one to the
210 output. This includes the root hints in use.
211
212 list_forwards
213 List the forward zones in use. These are printed zone by zone
214 to the output.
215
216 list_insecure
217 List the zones with domain-insecure.
218
219 list_local_zones
220 List the local zones in use. These are printed one per line
221 with zone type.
222
223 list_local_data
224 List the local data RRs in use. The resource records are
225 printed.
226
227 insecure_add zone
228 Add a domain-insecure for the given zone, like the statement in
229 unbound.conf. Adds to the running unbound without affecting the
230 cache contents (which may still be bogus, use flush_zone to
231 remove it), does not affect the config file.
232
233 insecure_remove zone
234 Removes domain-insecure for the given zone.
235
236 forward_add [+i] zone addr ...
237 Add a new forward zone to running unbound. With +i option also
238 adds a domain-insecure for the zone (so it can resolve inse‐
239 curely if you have a DNSSEC root trust anchor configured for
240 other names). The addr can be IP4, IP6 or nameserver names,
241 like forward-zone config in unbound.conf.
242
243 forward_remove [+i] zone
244 Remove a forward zone from running unbound. The +i also removes
245 a domain-insecure for the zone.
246
247 stub_add [+ip] zone addr ...
248 Add a new stub zone to running unbound. With +i option also
249 adds a domain-insecure for the zone. With +p the stub zone is
250 set to prime, without it it is set to notprime. The addr can be
251 IP4, IP6 or nameserver names, like the stub-zone config in
252 unbound.conf.
253
254 stub_remove [+i] zone
255 Remove a stub zone from running unbound. The +i also removes a
256 domain-insecure for the zone.
257
258 forward [off | addr ... ]
259 Setup forwarding mode. Configures if the server should ask
260 other upstream nameservers, should go to the internet root name‐
261 servers itself, or show the current config. You could pass the
262 nameservers after a DHCP update.
263
264 Without arguments the current list of addresses used to forward
265 all queries to is printed. On startup this is from the for‐
266 ward-zone "." configuration. Afterwards it shows the status.
267 It prints off when no forwarding is used.
268
269 If off is passed, forwarding is disabled and the root name‐
270 servers are used. This can be used to avoid to avoid buggy or
271 non-DNSSEC supporting nameservers returned from DHCP. But may
272 not work in hotels or hotspots.
273
274 If one or more IPv4 or IPv6 addresses are given, those are then
275 used to forward queries to. The addresses must be separated
276 with spaces. With '@port' the port number can be set explicitly
277 (default port is 53 (DNS)).
278
279 By default the forwarder information from the config file for
280 the root "." is used. The config file is not changed, so after
281 a reload these changes are gone. Other forward zones from the
282 config file are not affected by this command.
283
284 ratelimit_list [+a]
285 List the domains that are ratelimited. Printed one per line
286 with current estimated qps and qps limit from config. With +a
287 it prints all domains, not just the ratelimited domains, with
288 their estimated qps. The ratelimited domains return an error
289 for uncached (new) queries, but cached queries work as normal.
290
291 ip_ratelimit_list [+a]
292 List the ip addresses that are ratelimited. Printed one per
293 line with current estimated qps and qps limit from config. With
294 +a it prints all ips, not just the ratelimited ips, with their
295 estimated qps. The ratelimited ips are dropped before checking
296 the cache.
297
298 view_list_local_zones view
299 list_local_zones for given view.
300
301 view_local_zone view name type
302 local_zone for given view.
303
304 view_local_zone_remove view name
305 local_zone_remove for given view.
306
307 view_list_local_data view
308 list_local_data for given view.
309
310 view_local_data view RR data...
311 local_data for given view.
312
313 view_local_data_remove view name
314 local_data_remove for given view.
315
317 The unbound-control program exits with status code 1 on error, 0 on
318 success.
319
321 The setup requires a self-signed certificate and private keys for both
322 the server and client. The script unbound-control-setup generates
323 these in the default run directory, or with -d in another directory.
324 If you change the access control permissions on the key files you can
325 decide who can use unbound-control, by default owner and group but not
326 all users. Run the script under the same username as you have config‐
327 ured in unbound.conf or as root, so that the daemon is permitted to
328 read the files, for example with:
329 sudo -u unbound unbound-control-setup
330 If you have not configured a username in unbound.conf, the keys need
331 read permission for the user credentials under which the daemon is
332 started. The script preserves private keys present in the directory.
333 After running the script as root, turn on control-enable in
334 unbound.conf.
335
337 The stats command shows a number of statistic counters.
338
339 threadX.num.queries
340 number of queries received by thread
341
342 threadX.num.queries_ip_ratelimited
343 number of queries rate limited by thread
344
345 threadX.num.cachehits
346 number of queries that were successfully answered using a cache
347 lookup
348
349 threadX.num.cachemiss
350 number of queries that needed recursive processing
351
352 threadX.num.prefetch
353 number of cache prefetches performed. This number is included
354 in cachehits, as the original query had the unprefetched answer
355 from cache, and resulted in recursive processing, taking a slot
356 in the requestlist. Not part of the recursivereplies (or the
357 histogram thereof) or cachemiss, as a cache response was sent.
358
359 threadX.num.zero_ttl
360 number of replies with ttl zero, because they served an expired
361 cache entry.
362
363 threadX.num.recursivereplies
364 The number of replies sent to queries that needed recursive pro‐
365 cessing. Could be smaller than threadX.num.cachemiss if due to
366 timeouts no replies were sent for some queries.
367
368 threadX.requestlist.avg
369 The average number of requests in the internal recursive pro‐
370 cessing request list on insert of a new incoming recursive pro‐
371 cessing query.
372
373 threadX.requestlist.max
374 Maximum size attained by the internal recursive processing
375 request list.
376
377 threadX.requestlist.overwritten
378 Number of requests in the request list that were overwritten by
379 newer entries. This happens if there is a flood of queries that
380 recursive processing and the server has a hard time.
381
382 threadX.requestlist.exceeded
383 Queries that were dropped because the request list was full.
384 This happens if a flood of queries need recursive processing,
385 and the server can not keep up.
386
387 threadX.requestlist.current.all
388 Current size of the request list, includes internally generated
389 queries (such as priming queries and glue lookups).
390
391 threadX.requestlist.current.user
392 Current size of the request list, only the requests from client
393 queries.
394
395 threadX.recursion.time.avg
396 Average time it took to answer queries that needed recursive
397 processing. Note that queries that were answered from the cache
398 are not in this average.
399
400 threadX.recursion.time.median
401 The median of the time it took to answer queries that needed
402 recursive processing. The median means that 50% of the user
403 queries were answered in less than this time. Because of big
404 outliers (usually queries to non responsive servers), the aver‐
405 age can be bigger than the median. This median has been calcu‐
406 lated by interpolation from a histogram.
407
408 threadX.tcpusage
409 The currently held tcp buffers for incoming connections. A spot
410 value on the time of the request. This helps you spot if the
411 incoming-num-tcp buffers are full.
412
413 total.num.queries
414 summed over threads.
415
416 total.num.cachehits
417 summed over threads.
418
419 total.num.cachemiss
420 summed over threads.
421
422 total.num.prefetch
423 summed over threads.
424
425 total.num.zero_ttl
426 summed over threads.
427
428 total.num.recursivereplies
429 summed over threads.
430
431 total.requestlist.avg
432 averaged over threads.
433
434 total.requestlist.max
435 the maximum of the thread requestlist.max values.
436
437 total.requestlist.overwritten
438 summed over threads.
439
440 total.requestlist.exceeded
441 summed over threads.
442
443 total.requestlist.current.all
444 summed over threads.
445
446 total.recursion.time.median
447 averaged over threads.
448
449 total.tcpusage
450 summed over threads.
451
452 time.now
453 current time in seconds since 1970.
454
455 time.up
456 uptime since server boot in seconds.
457
458 time.elapsed
459 time since last statistics printout, in seconds.
460
462 mem.cache.rrset
463 Memory in bytes in use by the RRset cache.
464
465 mem.cache.message
466 Memory in bytes in use by the message cache.
467
468 mem.mod.iterator
469 Memory in bytes in use by the iterator module.
470
471 mem.mod.validator
472 Memory in bytes in use by the validator module. Includes the key
473 cache and negative cache.
474
475 histogram.<sec>.<usec>.to.<sec>.<usec>
476 Shows a histogram, summed over all threads. Every element counts
477 the recursive queries whose reply time fit between the lower and
478 upper bound. Times larger or equal to the lowerbound, and
479 smaller than the upper bound. There are 40 buckets, with bucket
480 sizes doubling.
481
482 num.query.type.A
483 The total number of queries over all threads with query type A.
484 Printed for the other query types as well, but only for the
485 types for which queries were received, thus =0 entries are omit‐
486 ted for brevity.
487
488 num.query.type.other
489 Number of queries with query types 256-65535.
490
491 num.query.class.IN
492 The total number of queries over all threads with query class IN
493 (internet). Also printed for other classes (such as CH (CHAOS)
494 sometimes used for debugging), or NONE, ANY, used by dynamic
495 update. num.query.class.other is printed for classes 256-65535.
496
497 num.query.opcode.QUERY
498 The total number of queries over all threads with query opcode
499 QUERY. Also printed for other opcodes, UPDATE, ...
500
501 num.query.tcp
502 Number of queries that were made using TCP towards the unbound
503 server.
504
505 num.query.tcpout
506 Number of queries that the unbound server made using TCP outgo‐
507 ing towards other servers.
508
509 num.query.ipv6
510 Number of queries that were made using IPv6 towards the unbound
511 server.
512
513 num.query.flags.RD
514 The number of queries that had the RD flag set in the header.
515 Also printed for flags QR, AA, TC, RA, Z, AD, CD. Note that
516 queries with flags QR, AA or TC may have been rejected because
517 of that.
518
519 num.query.edns.present
520 number of queries that had an EDNS OPT record present.
521
522 num.query.edns.DO
523 number of queries that had an EDNS OPT record with the DO
524 (DNSSEC OK) bit set. These queries are also included in the
525 num.query.edns.present number.
526
527 num.query.ratelimited
528 The number of queries that are turned away from being send to
529 nameserver due to ratelimiting.
530
531 num.answer.rcode.NXDOMAIN
532 The number of answers to queries, from cache or from recursion,
533 that had the return code NXDOMAIN. Also printed for the other
534 return codes.
535
536 num.answer.rcode.nodata
537 The number of answers to queries that had the pseudo return code
538 nodata. This means the actual return code was NOERROR, but
539 additionally, no data was carried in the answer (making what is
540 called a NOERROR/NODATA answer). These queries are also
541 included in the num.answer.rcode.NOERROR number. Common for
542 AAAA lookups when an A record exists, and no AAAA.
543
544 num.answer.secure
545 Number of answers that were secure. The answer validated cor‐
546 rectly. The AD bit might have been set in some of these
547 answers, where the client signalled (with DO or AD bit in the
548 query) that they were ready to accept the AD bit in the answer.
549
550 num.answer.bogus
551 Number of answers that were bogus. These answers resulted in
552 SERVFAIL to the client because the answer failed validation.
553
554 num.rrset.bogus
555 The number of rrsets marked bogus by the validator. Increased
556 for every RRset inspection that fails.
557
558 unwanted.queries
559 Number of queries that were refused or dropped because they
560 failed the access control settings.
561
562 unwanted.replies
563 Replies that were unwanted or unsolicited. Could have been ran‐
564 dom traffic, delayed duplicates, very late answers, or could be
565 spoofing attempts. Some low level of late answers and delayed
566 duplicates are to be expected with the UDP protocol. Very high
567 values could indicate a threat (spoofing).
568
569 msg.cache.count
570 The number of items (DNS replies) in the message cache.
571
572 rrset.cache.count
573 The number of RRsets in the rrset cache. This includes rrsets
574 used by the messages in the message cache, but also delegation
575 information.
576
577 infra.cache.count
578 The number of items in the infra cache. These are IP addresses
579 with their timing and protocol support information.
580
581 key.cache.count
582 The number of items in the key cache. These are DNSSEC keys,
583 one item per delegation point, and their validation status.
584
586 /etc/unbound/unbound.conf
587 unbound configuration file.
588
589 /etc/unbound
590 directory with private keys (unbound_server.key and unbound_con‐
591 trol.key) and self-signed certificates (unbound_server.pem and
592 unbound_control.pem).
593
595 unbound.conf(5), unbound(8).
596
597
598
599NLnet Labs Sep 18, 2017 unbound-control(8)