]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - doc/unbound-control.8.in
import unbound 1.4.22
[FreeBSD/FreeBSD.git] / doc / unbound-control.8.in
1 .TH "unbound-control" "8" "Mar 12, 2014" "NLnet Labs" "unbound 1.4.22"
2 .\"
3 .\" unbound-control.8 -- unbound remote control manual
4 .\"
5 .\" Copyright (c) 2008, NLnet Labs. All rights reserved.
6 .\"
7 .\" See LICENSE for the license.
8 .\"
9 .\"
10 .SH "NAME"
11 .LP
12 .B unbound\-control,
13 .B unbound\-control\-setup
14 \- Unbound remote server control utility.
15 .SH "SYNOPSIS"
16 .B unbound\-control
17 .RB [ \-hq ]
18 .RB [ \-c 
19 .IR cfgfile ]
20 .RB [ \-s 
21 .IR server ]
22 .IR command
23 .SH "DESCRIPTION"
24 .B Unbound\-control
25 performs remote administration on the \fIunbound\fR(8) DNS server.
26 It reads the configuration file, contacts the unbound server over SSL
27 sends the command and displays the result.
28 .P
29 The available options are:
30 .TP
31 .B \-h
32 Show the version and commandline option help.
33 .TP
34 .B \-c \fIcfgfile
35 The config file to read with settings.  If not given the default
36 config file @ub_conf_file@ is used.
37 .TP
38 .B \-s \fIserver[@port]
39 IPv4 or IPv6 address of the server to contact.  If not given, the
40 address is read from the config file.
41 .TP
42 .B \-q
43 quiet, if the option is given it does not print anything if it works ok.
44 .SH "COMMANDS"
45 There are several commands that the server understands.
46 .TP
47 .B start
48 Start the server. Simply execs \fIunbound\fR(8).  The unbound executable 
49 is searched for in the \fBPATH\fR set in the environment.  It is started 
50 with the config file specified using \fI\-c\fR or the default config file.
51 .TP
52 .B stop
53 Stop the server. The server daemon exits.
54 .TP
55 .B reload
56 Reload the server. This flushes the cache and reads the config file fresh.
57 .TP
58 .B verbosity \fInumber
59 Change verbosity value for logging. Same values as \fBverbosity\fR keyword in
60 \fIunbound.conf\fR(5).  This new setting lasts until the server is issued
61 a reload (taken from config file again), or the next verbosity control command.
62 .TP
63 .B log_reopen
64 Reopen the logfile, close and open it.  Useful for logrotation to make the
65 daemon release the file it is logging to.  If you are using syslog it will
66 attempt to close and open the syslog (which may not work if chrooted).
67 .TP
68 .B stats
69 Print statistics. Resets the internal counters to zero, this can be 
70 controlled using the \fBstatistics\-cumulative\fR config statement. 
71 Statistics are printed with one [name]: [value] per line.
72 .TP
73 .B stats_noreset
74 Peek at statistics. Prints them like the \fBstats\fR command does, but does not
75 reset the internal counters to zero.
76 .TP
77 .B status
78 Display server status. Exit code 3 if not running (the connection to the 
79 port is refused), 1 on error, 0 if running.
80 .TP
81 .B local_zone \fIname\fR \fItype
82 Add new local zone with name and type. Like \fBlocal\-zone\fR config statement.
83 If the zone already exists, the type is changed to the given argument.
84 .TP
85 .B local_zone_remove \fIname
86 Remove the local zone with the given name.  Removes all local data inside
87 it.  If the zone does not exist, the command succeeds.
88 .TP
89 .B local_data \fIRR data...
90 Add new local data, the given resource record. Like \fBlocal\-data\fR
91 config statement, except for when no covering zone exists.  In that case
92 this remote control command creates a transparent zone with the same 
93 name as this record.  This command is not good at returning detailed syntax 
94 errors.
95 .TP
96 .B local_data_remove \fIname
97 Remove all RR data from local name.  If the name already has no items,
98 nothing happens.  Often results in NXDOMAIN for the name (in a static zone),
99 but if the name has become an empty nonterminal (there is still data in 
100 domain names below the removed name), NOERROR nodata answers are the 
101 result for that name.
102 .TP
103 .B dump_cache
104 The contents of the cache is printed in a text format to stdout. You can
105 redirect it to a file to store the cache in a file.
106 .TP
107 .B load_cache
108 The contents of the cache is loaded from stdin.  Uses the same format as
109 dump_cache uses.  Loading the cache with old, or wrong data can result
110 in old or wrong data returned to clients.  Loading data into the cache
111 in this way is supported in order to aid with debugging.
112 .TP
113 .B lookup \fIname
114 Print to stdout the name servers that would be used to look up the 
115 name specified.
116 .TP
117 .B flush \fIname
118 Remove the name from the cache. Removes the types
119 A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV and NAPTR.
120 Because that is fast to do. Other record types can be removed using 
121 .B flush_type 
122 or 
123 .B flush_zone\fR.
124 .TP
125 .B flush_type \fIname\fR \fItype
126 Remove the name, type information from the cache.
127 .TP
128 .B flush_zone \fIname
129 Remove all information at or below the name from the cache. 
130 The rrsets and key entries are removed so that new lookups will be performed.
131 This needs to walk and inspect the entire cache, and is a slow operation.
132 .TP
133 .B flush_bogus
134 Remove all bogus data from the cache.
135 .TP
136 .B flush_stats
137 Reset statistics to zero.
138 .TP
139 .B flush_requestlist
140 Drop the queries that are worked on.  Stops working on the queries that the
141 server is working on now.  The cache is unaffected.  No reply is sent for
142 those queries, probably making those users request again later.
143 Useful to make the server restart working on queries with new settings,
144 such as a higher verbosity level.
145 .TP
146 .B dump_requestlist
147 Show what is worked on.  Prints all queries that the server is currently
148 working on.  Prints the time that users have been waiting.  For internal
149 requests, no time is printed.  And then prints out the module status.
150 .TP
151 .B flush_infra \fIall|IP
152 If all then entire infra cache is emptied.  If a specific IP address, the
153 entry for that address is removed from the cache.  It contains EDNS, ping
154 and lameness data.
155 .TP
156 .B dump_infra
157 Show the contents of the infra cache.
158 .TP
159 .B set_option \fIopt: val
160 Set the option to the given value without a reload.  The cache is
161 therefore not flushed.  The option must end with a ':' and whitespace
162 must be between the option and the value.  Some values may not have an
163 effect if set this way, the new values are not written to the config file,
164 not all options are supported.  This is different from the set_option call
165 in libunbound, where all values work because unbound has not been inited.
166 .IP
167 The values that work are: statistics\-interval, statistics\-cumulative,
168 do\-not\-query\-localhost, harden\-short\-bufsize, harden\-large\-queries,
169 harden\-glue, harden\-dnssec\-stripped, harden\-below\-nxdomain,
170 harden\-referral\-path, prefetch, prefetch\-key, log\-queries,
171 hide\-identity, hide\-version, identity, version, val\-log\-level,
172 val\-log\-squelch, ignore\-cd\-flag, add\-holddown, del\-holddown,
173 keep\-missing, tcp\-upstream, ssl\-upstream, max\-udp\-size.
174 .TP
175 .B get_option \fIopt
176 Get the value of the option.  Give the option name without a trailing ':'.
177 The value is printed.  If the value is "", nothing is printed
178 and the connection closes.  On error 'error ...' is printed (it gives
179 a syntax error on unknown option).  For some options a list of values,
180 one on each line, is printed.  The options are shown from the config file
181 as modified with set_option.  For some options an override may have been
182 taken that does not show up with this command, not results from e.g. the
183 verbosity and forward control commands.  Not all options work, see list_stubs,
184 list_forwards, list_local_zones and list_local_data for those.
185 .TP
186 .B list_stubs
187 List the stub zones in use.  These are printed one by one to the output.
188 This includes the root hints in use.
189 .TP
190 .B list_forwards
191 List the forward zones in use.  These are printed zone by zone to the output.
192 .TP
193 .B list_local_zones
194 List the local zones in use.  These are printed one per line with zone type.
195 .TP
196 .B list_local_data
197 List the local data RRs in use.  The resource records are printed.
198 .TP
199 .B insecure_add \fIzone
200 Add a \fBdomain\-insecure\fR for the given zone, like the statement in unbound.conf.
201 Adds to the running unbound without affecting the cache contents (which may
202 still be bogus, use \fBflush_zone\fR to remove it), does not affect the config file.
203 .TP
204 .B insecure_remove \fIzone
205 Removes domain\-insecure for the given zone.
206 .TP
207 .B forward_add \fR[\fI+i\fR] \fIzone addr ...
208 Add a new forward zone to running unbound.  With +i option also adds a
209 \fIdomain\-insecure\fR for the zone (so it can resolve insecurely if you have
210 a DNSSEC root trust anchor configured for other names).
211 The addr can be IP4, IP6 or nameserver names, like \fIforward-zone\fR config
212 in unbound.conf.
213 .TP
214 .B forward_remove \fR[\fI+i\fR] \fIzone
215 Remove a forward zone from running unbound.  The +i also removes a
216 \fIdomain\-insecure\fR for the zone.
217 .TP
218 .B stub_add \fR[\fI+ip\fR] \fIzone addr ...
219 Add a new stub zone to running unbound.  With +i option also adds a
220 \fIdomain\-insecure\fR for the zone.  With +p the stub zone is set to prime,
221 without it it is set to notprime.  The addr can be IP4, IP6 or nameserver
222 names, like the \fIstub-zone\fR config in unbound.conf.
223 .TP
224 .B stub_remove \fR[\fI+i\fR] \fIzone
225 Remove a stub zone from running unbound.  The +i also removes a
226 \fIdomain\-insecure\fR for the zone.
227 .TP
228 .B forward \fR[\fIoff\fR | \fIaddr ...\fR ]
229 Setup forwarding mode.  Configures if the server should ask other upstream
230 nameservers, should go to the internet root nameservers itself, or show 
231 the current config.  You could pass the nameservers after a DHCP update.
232 .IP
233 Without arguments the current list of addresses used to forward all queries
234 to is printed.  On startup this is from the forward\-zone "." configuration.
235 Afterwards it shows the status.  It prints off when no forwarding is used.
236 .IP
237 If \fIoff\fR is passed, forwarding is disabled and the root nameservers
238 are used.  This can be used to avoid to avoid buggy or non\-DNSSEC supporting
239 nameservers returned from DHCP.  But may not work in hotels or hotspots.
240 .IP
241 If one or more IPv4 or IPv6 addresses are given, those are then used to forward
242 queries to.  The addresses must be separated with spaces.  With '@port' the
243 port number can be set explicitly (default port is 53 (DNS)).
244 .IP
245 By default the forwarder information from the config file for the root "." is
246 used.  The config file is not changed, so after a reload these changes are
247 gone.  Other forward zones from the config file are not affected by this command.
248 .SH "EXIT CODE"
249 The unbound\-control program exits with status code 1 on error, 0 on success.
250 .SH "SET UP"
251 The setup requires a self\-signed certificate and private keys for both 
252 the server and client.  The script \fIunbound\-control\-setup\fR generates
253 these in the default run directory, or with \-d in another directory.
254 If you change the access control permissions on the key files you can decide
255 who can use unbound\-control, by default owner and group but not all users.
256 Run the script under the same username as you have configured in unbound.conf
257 or as root, so that the daemon is permitted to read the files, for example with:
258 .nf
259     sudo \-u unbound unbound\-control\-setup
260 .fi
261 If you have not configured
262 a username in unbound.conf, the keys need read permission for the user
263 credentials under which the daemon is started.
264 The script preserves private keys present in the directory.
265 After running the script as root, turn on \fBcontrol\-enable\fR in 
266 \fIunbound.conf\fR.
267 .SH "STATISTIC COUNTERS"
268 The \fIstats\fR command shows a number of statistic counters.
269 .TP
270 .I threadX.num.queries
271 number of queries received by thread
272 .TP
273 .I threadX.num.cachehits
274 number of queries that were successfully answered using a cache lookup
275 .TP
276 .I threadX.num.cachemiss
277 number of queries that needed recursive processing
278 .TP
279 .I threadX.num.prefetch
280 number of cache prefetches performed.  This number is included in
281 cachehits, as the original query had the unprefetched answer from cache,
282 and resulted in recursive processing, taking a slot in the requestlist.
283 Not part of the recursivereplies (or the histogram thereof) or cachemiss,
284 as a cache response was sent.
285 .TP
286 .I threadX.num.recursivereplies
287 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.
288 .TP
289 .I threadX.requestlist.avg
290 The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.
291 .TP
292 .I threadX.requestlist.max
293 Maximum size attained by the internal recursive processing request list.
294 .TP
295 .I threadX.requestlist.overwritten
296 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.
297 .TP
298 .I threadX.requestlist.exceeded
299 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.
300 .TP
301 .I threadX.requestlist.current.all
302 Current size of the request list, includes internally generated queries (such
303 as priming queries and glue lookups).
304 .TP
305 .I threadX.requestlist.current.user
306 Current size of the request list, only the requests from client queries.
307 .TP
308 .I threadX.recursion.time.avg
309 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.
310 .TP
311 .I threadX.recursion.time.median
312 The median of the time it took to answer queries that needed recursive
313 processing.  The median means that 50% of the user queries were answered in 
314 less than this time.  Because of big outliers (usually queries to non 
315 responsive servers), the average can be bigger than the median.  This median
316 has been calculated by interpolation from a histogram.
317 .TP
318 .I total.num.queries
319 summed over threads.
320 .TP
321 .I total.num.cachehits
322 summed over threads.
323 .TP
324 .I total.num.cachemiss
325 summed over threads.
326 .TP
327 .I total.num.prefetch
328 summed over threads.
329 .TP
330 .I total.num.recursivereplies
331 summed over threads.
332 .TP
333 .I total.requestlist.avg
334 averaged over threads.
335 .TP
336 .I total.requestlist.max
337 the maximum of the thread requestlist.max values.
338 .TP
339 .I total.requestlist.overwritten
340 summed over threads.
341 .TP
342 .I total.requestlist.exceeded
343 summed over threads.
344 .TP
345 .I total.requestlist.current.all
346 summed over threads.
347 .TP
348 .I total.recursion.time.median
349 averaged over threads.
350 .TP
351 .I time.now
352 current time in seconds since 1970.
353 .TP
354 .I time.up
355 uptime since server boot in seconds.
356 .TP
357 .I time.elapsed
358 time since last statistics printout, in seconds.
359 .SH EXTENDED STATISTICS
360 .TP
361 .I mem.total.sbrk
362 If sbrk(2) is available, an estimate of the heap size of the program in number of bytes. Close to the total memory used by the program, as reported by top and ps.  Could be wrong if the OS allocates memory non\-contiguously.
363 .TP
364 .I mem.cache.rrset
365 Memory in bytes in use by the RRset cache.
366 .TP
367 .I mem.cache.message
368 Memory in bytes in use by the message cache.
369 .TP
370 .I mem.mod.iterator
371 Memory in bytes in use by the iterator module.
372 .TP
373 .I mem.mod.validator
374 Memory in bytes in use by the validator module. Includes the key cache and
375 negative cache.
376 .TP
377 .I histogram.<sec>.<usec>.to.<sec>.<usec>
378 Shows a histogram, summed over all threads. Every element counts the
379 recursive queries whose reply time fit between the lower and upper bound.
380 Times larger or equal to the lowerbound, and smaller than the upper bound.
381 There are 40 buckets, with bucket sizes doubling.
382 .TP
383 .I num.query.type.A
384 The total number of queries over all threads with query type A.
385 Printed for the other query types as well, but only for the types for which
386 queries were received, thus =0 entries are omitted for brevity.
387 .TP
388 .I num.query.type.other
389 Number of queries with query types 256\-65535.
390 .TP
391 .I num.query.class.IN
392 The total number of queries over all threads with query class IN (internet).
393 Also printed for other classes (such as CH (CHAOS) sometimes used for
394 debugging), or NONE, ANY, used by dynamic update.
395 num.query.class.other is printed for classes 256\-65535.
396 .TP
397 .I num.query.opcode.QUERY
398 The total number of queries over all threads with query opcode QUERY.
399 Also printed for other opcodes, UPDATE, ...
400 .TP
401 .I num.query.tcp
402 Number of queries that were made using TCP towards the unbound server.
403 .TP
404 .I num.query.ipv6
405 Number of queries that were made using IPv6 towards the unbound server.
406 .TP
407 .I num.query.flags.RD
408 The number of queries that had the RD flag set in the header.
409 Also printed for flags QR, AA, TC, RA, Z, AD, CD.
410 Note that queries with flags QR, AA or TC may have been rejected 
411 because of that.
412 .TP
413 .I num.query.edns.present
414 number of queries that had an EDNS OPT record present.
415 .TP
416 .I num.query.edns.DO
417 number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set.
418 These queries are also included in the num.query.edns.present number.
419 .TP
420 .I num.answer.rcode.NXDOMAIN
421 The number of answers to queries, from cache or from recursion, that had the
422 return code NXDOMAIN. Also printed for the other return codes.
423 .TP
424 .I num.answer.rcode.nodata
425 The number of answers to queries that had the pseudo return code nodata.
426 This means the actual return code was NOERROR, but additionally, no data was
427 carried in the answer (making what is called a NOERROR/NODATA answer).
428 These queries are also included in the num.answer.rcode.NOERROR number.
429 Common for AAAA lookups when an A record exists, and no AAAA.
430 .TP
431 .I num.answer.secure
432 Number of answers that were secure.  The answer validated correctly. 
433 The AD bit might have been set in some of these answers, where the client
434 signalled (with DO or AD bit in the query) that they were ready to accept
435 the AD bit in the answer.
436 .TP
437 .I num.answer.bogus
438 Number of answers that were bogus.  These answers resulted in SERVFAIL
439 to the client because the answer failed validation.
440 .TP
441 .I num.rrset.bogus
442 The number of rrsets marked bogus by the validator.  Increased for every
443 RRset inspection that fails.
444 .TP
445 .I unwanted.queries
446 Number of queries that were refused or dropped because they failed the
447 access control settings.
448 .TP
449 .I unwanted.replies
450 Replies that were unwanted or unsolicited.  Could have been random traffic,
451 delayed duplicates, very late answers, or could be spoofing attempts.
452 Some low level of late answers and delayed duplicates are to be expected
453 with the UDP protocol.  Very high values could indicate a threat (spoofing).
454 .SH "FILES"
455 .TP
456 .I @ub_conf_file@
457 unbound configuration file.
458 .TP
459 .I @UNBOUND_RUN_DIR@
460 directory with private keys (unbound_server.key and unbound_control.key) and
461 self\-signed certificates (unbound_server.pem and unbound_control.pem).
462 .SH "SEE ALSO"
463 \fIunbound.conf\fR(5), 
464 \fIunbound\fR(8).