]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/unbound/doc/unbound-control.8
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / contrib / unbound / doc / unbound-control.8
1 .TH "unbound-control" "8" "Mar 21, 2013" "NLnet Labs" "unbound 1.4.20"
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 /var/unbound/unbound.conf 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.
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 forward_add \fR[\fI+i\fR] \fIzone addr ...
200 Add a new forward zone to running unbound.  With +i option also adds a
201 \fIdomain\-insecure\fR for the zone (so it can resolve insecurely if you have
202 a DNSSEC root trust anchor configured for other names).
203 The addr can be IP4, IP6 or nameserver names, like \fIforward-zone\fR config
204 in unbound.conf.
205 .TP
206 .B forward_remove \fR[\fI+i\fR] \fIzone
207 Remove a forward zone from running unbound.  The +i also removes a
208 \fIdomain\-insecure\fR for the zone.
209 .TP
210 .B stub_add \fR[\fI+ip\fR] \fIzone addr ...
211 Add a new stub zone to running unbound.  With +i option also adds a
212 \fIdomain\-insecure\fR for the zone.  With +p the stub zone is set to prime,
213 without it it is set to notprime.  The addr can be IP4, IP6 or nameserver
214 names, like the \fIstub-zone\fR config in unbound.conf.
215 .TP
216 .B stub_remove \fR[\fI+i\fR] \fIzone
217 Remove a stub zone from running unbound.  The +i also removes a
218 \fIdomain\-insecure\fR for the zone.
219 .TP
220 .B forward \fR[\fIoff\fR | \fIaddr ...\fR ]
221 Setup forwarding mode.  Configures if the server should ask other upstream
222 nameservers, should go to the internet root nameservers itself, or show 
223 the current config.  You could pass the nameservers after a DHCP update.
224 .IP
225 Without arguments the current list of addresses used to forward all queries
226 to is printed.  On startup this is from the forward\-zone "." configuration.
227 Afterwards it shows the status.  It prints off when no forwarding is used.
228 .IP
229 If \fIoff\fR is passed, forwarding is disabled and the root nameservers
230 are used.  This can be used to avoid to avoid buggy or non\-DNSSEC supporting
231 nameservers returned from DHCP.  But may not work in hotels or hotspots.
232 .IP
233 If one or more IPv4 or IPv6 addresses are given, those are then used to forward
234 queries to.  The addresses must be separated with spaces.  With '@port' the
235 port number can be set explicitly (default port is 53 (DNS)).
236 .IP
237 By default the forwarder information from the config file for the root "." is
238 used.  The config file is not changed, so after a reload these changes are
239 gone.  Other forward zones from the config file are not affected by this command.
240 .SH "EXIT CODE"
241 The unbound\-control program exits with status code 1 on error, 0 on success.
242 .SH "SET UP"
243 The setup requires a self\-signed certificate and private keys for both 
244 the server and client.  The script \fIunbound\-control\-setup\fR generates
245 these in the default run directory, or with \-d in another directory.
246 If you change the access control permissions on the key files you can decide
247 who can use unbound\-control, by default owner and group but not all users.
248 Run the script under the same username as you have configured in unbound.conf
249 or as root, so that the daemon is permitted to read the files, for example with:
250 .nf
251     sudo \-u unbound unbound\-control\-setup
252 .fi
253 If you have not configured
254 a username in unbound.conf, the keys need read permission for the user
255 credentials under which the daemon is started.
256 The script preserves private keys present in the directory.
257 After running the script as root, turn on \fBcontrol\-enable\fR in 
258 \fIunbound.conf\fR.
259 .SH "STATISTIC COUNTERS"
260 The \fIstats\fR command shows a number of statistic counters.
261 .TP
262 .I threadX.num.queries
263 number of queries received by thread
264 .TP
265 .I threadX.num.cachehits
266 number of queries that were successfully answered using a cache lookup
267 .TP
268 .I threadX.num.cachemiss
269 number of queries that needed recursive processing
270 .TP
271 .I threadX.num.prefetch
272 number of cache prefetches performed.  This number is included in
273 cachehits, as the original query had the unprefetched answer from cache,
274 and resulted in recursive processing, taking a slot in the requestlist.
275 Not part of the recursivereplies (or the histogram thereof) or cachemiss,
276 as a cache response was sent.
277 .TP
278 .I threadX.num.recursivereplies
279 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.
280 .TP
281 .I threadX.requestlist.avg
282 The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.
283 .TP
284 .I threadX.requestlist.max
285 Maximum size attained by the internal recursive processing request list.
286 .TP
287 .I threadX.requestlist.overwritten
288 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.
289 .TP
290 .I threadX.requestlist.exceeded
291 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.
292 .TP
293 .I threadX.requestlist.current.all
294 Current size of the request list, includes internally generated queries (such
295 as priming queries and glue lookups).
296 .TP
297 .I threadX.requestlist.current.user
298 Current size of the request list, only the requests from client queries.
299 .TP
300 .I threadX.recursion.time.avg
301 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.
302 .TP
303 .I threadX.recursion.time.median
304 The median of the time it took to answer queries that needed recursive
305 processing.  The median means that 50% of the user queries were answered in 
306 less than this time.  Because of big outliers (usually queries to non 
307 responsive servers), the average can be bigger than the median.  This median
308 has been calculated by interpolation from a histogram.
309 .TP
310 .I total.num.queries
311 summed over threads.
312 .TP
313 .I total.num.cachehits
314 summed over threads.
315 .TP
316 .I total.num.cachemiss
317 summed over threads.
318 .TP
319 .I total.num.prefetch
320 summed over threads.
321 .TP
322 .I total.num.recursivereplies
323 summed over threads.
324 .TP
325 .I total.requestlist.avg
326 averaged over threads.
327 .TP
328 .I total.requestlist.max
329 the maximum of the thread requestlist.max values.
330 .TP
331 .I total.requestlist.overwritten
332 summed over threads.
333 .TP
334 .I total.requestlist.exceeded
335 summed over threads.
336 .TP
337 .I total.requestlist.current.all
338 summed over threads.
339 .TP
340 .I total.recursion.time.median
341 averaged over threads.
342 .TP
343 .I time.now
344 current time in seconds since 1970.
345 .TP
346 .I time.up
347 uptime since server boot in seconds.
348 .TP
349 .I time.elapsed
350 time since last statistics printout, in seconds.
351 .SH EXTENDED STATISTICS
352 .TP
353 .I mem.total.sbrk
354 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.
355 .TP
356 .I mem.cache.rrset
357 Memory in bytes in use by the RRset cache.
358 .TP
359 .I mem.cache.message
360 Memory in bytes in use by the message cache.
361 .TP
362 .I mem.mod.iterator
363 Memory in bytes in use by the iterator module.
364 .TP
365 .I mem.mod.validator
366 Memory in bytes in use by the validator module. Includes the key cache and
367 negative cache.
368 .TP
369 .I histogram.<sec>.<usec>.to.<sec>.<usec>
370 Shows a histogram, summed over all threads. Every element counts the
371 recursive queries whose reply time fit between the lower and upper bound.
372 Times larger or equal to the lowerbound, and smaller than the upper bound.
373 There are 40 buckets, with bucket sizes doubling.
374 .TP
375 .I num.query.type.A
376 The total number of queries over all threads with query type A.
377 Printed for the other query types as well, but only for the types for which
378 queries were received, thus =0 entries are omitted for brevity.
379 .TP
380 .I num.query.type.other
381 Number of queries with query types 256\-65535.
382 .TP
383 .I num.query.class.IN
384 The total number of queries over all threads with query class IN (internet).
385 Also printed for other classes (such as CH (CHAOS) sometimes used for
386 debugging), or NONE, ANY, used by dynamic update.
387 num.query.class.other is printed for classes 256\-65535.
388 .TP
389 .I num.query.opcode.QUERY
390 The total number of queries over all threads with query opcode QUERY.
391 Also printed for other opcodes, UPDATE, ...
392 .TP
393 .I num.query.tcp
394 Number of queries that were made using TCP towards the unbound server.
395 .TP
396 .I num.query.ipv6
397 Number of queries that were made using IPv6 towards the unbound server.
398 .TP
399 .I num.query.flags.RD
400 The number of queries that had the RD flag set in the header.
401 Also printed for flags QR, AA, TC, RA, Z, AD, CD.
402 Note that queries with flags QR, AA or TC may have been rejected 
403 because of that.
404 .TP
405 .I num.query.edns.present
406 number of queries that had an EDNS OPT record present.
407 .TP
408 .I num.query.edns.DO
409 number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set.
410 These queries are also included in the num.query.edns.present number.
411 .TP
412 .I num.answer.rcode.NXDOMAIN
413 The number of answers to queries, from cache or from recursion, that had the
414 return code NXDOMAIN. Also printed for the other return codes.
415 .TP
416 .I num.answer.rcode.nodata
417 The number of answers to queries that had the pseudo return code nodata.
418 This means the actual return code was NOERROR, but additionally, no data was
419 carried in the answer (making what is called a NOERROR/NODATA answer).
420 These queries are also included in the num.answer.rcode.NOERROR number.
421 Common for AAAA lookups when an A record exists, and no AAAA.
422 .TP
423 .I num.answer.secure
424 Number of answers that were secure.  The answer validated correctly. 
425 The AD bit might have been set in some of these answers, where the client
426 signalled (with DO or AD bit in the query) that they were ready to accept
427 the AD bit in the answer.
428 .TP
429 .I num.answer.bogus
430 Number of answers that were bogus.  These answers resulted in SERVFAIL
431 to the client because the answer failed validation.
432 .TP
433 .I num.rrset.bogus
434 The number of rrsets marked bogus by the validator.  Increased for every
435 RRset inspection that fails.
436 .TP
437 .I unwanted.queries
438 Number of queries that were refused or dropped because they failed the
439 access control settings.
440 .TP
441 .I unwanted.replies
442 Replies that were unwanted or unsolicited.  Could have been random traffic,
443 delayed duplicates, very late answers, or could be spoofing attempts.
444 Some low level of late answers and delayed duplicates are to be expected
445 with the UDP protocol.  Very high values could indicate a threat (spoofing).
446 .SH "FILES"
447 .TP
448 .I /var/unbound/unbound.conf
449 unbound configuration file.
450 .TP
451 .I /var/unbound
452 directory with private keys (unbound_server.key and unbound_control.key) and
453 self\-signed certificates (unbound_server.pem and unbound_control.pem).
454 .SH "SEE ALSO"
455 \fIunbound.conf\fR(5), 
456 \fIunbound\fR(8).