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