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