unbound

package: unbound

title: unbound(8)

summary: Unbound DNS validating resolver 1.25.1.

text:
# unbound(8)

## NAME
unbound - Unbound DNS validating resolver 1.25.1.

## SYNOPSIS
unbound [-hdpVv] [-c <cfgfile>]

## DESCRIPTION
unbound is a caching DNS resolver.

It uses a built in list of authoritative nameservers for the root zone (.), the so called root hints. On receiving a DNS query it will ask the root nameservers for an answer and will in almost all cases receive a delegation to a top level domain (TLD) authoritative nameserver. It will then ask that nameserver for an answer. It will recursively continue until an answer is found or no answer is available (NXDOMAIN). For performance and efficiency reasons that answer is cached for a certain time (the answer's time-to-live or TTL). A second query for the same name will then be answered from the cache. Unbound can also do DNSSEC validation.

To use a locally running Unbound for resolving put:

```
nameserver 127.0.0.1
```

into resolv.conf(5).

If authoritative DNS is needed as well using nsd(8), careful setup is required because authoritative nameservers and resolvers are using the same port number (53).

The available options are:

-h

Show the version number and commandline option help, and exit.

-c <cfgfile>

Set the config file with settings for unbound to read instead of reading the file at the default location, /var/lib/unbound/unbound.conf. The syntax is described in unbound.conf(5).

-d

Debug flag: do not fork into the background, but stay attached to the console. This flag will also delay writing to the log file until the thread-spawn time, so that most config and setup errors appear on stderr. If given twice or more, logging does not switch to the log file or to syslog, but the log messages are printed to stderr all the time.

-p

Don't use a pidfile. This argument should only be used by supervision systems which can ensure that only one instance of Unbound will run concurrently.

-v

Increase verbosity. If given multiple times, more information is logged. This is in addition to the verbosity (if any) from the config file.

-V

Show the version number and build options, and exit.

## SEE ALSO
unbound.conf(5), unbound-checkconf(8), nsd(8).

## AUTHOR
Unbound developers are mentioned in the CREDITS file in the distribution.

## COPYRIGHT
1999-2026, NLnet Labs


unbound-checkconf

title: unbound-checkconf(8)

text:
# unbound-checkconf(8)

## NAME
unbound-checkconf - Check Unbound 1.25.1 configuration file for errors.

## SYNOPSIS
unbound-checkconf [-hf] [-o option] [cfgfile]

## DESCRIPTION
unbound-checkconf checks the configuration file for the unbound(8) DNS resolver for syntax and other errors. The config file syntax is described in unbound.conf(5).

The available options are:

-h

Show the version and commandline option help.

-f

Print full pathname, with chroot applied to it. Use with the -o option.

-q

Make the operation quiet, suppress output on success.

-o <option>

If given, after checking the config file the value of this option is printed to stdout. For "" (disabled) options an empty line is printed.

cfgfile

The config file to read with settings for Unbound. It is checked. If omitted, the config file at the default location is checked.

## EXIT CODE
The unbound-checkconf program exits with status code 1 on error, 0 for a correct config file.

## FILES
/var/lib/unbound/unbound.conf

Unbound configuration file.

## SEE ALSO
unbound.conf(5), unbound(8).

## AUTHOR
Unbound developers are mentioned in the CREDITS file in the distribution.

## COPYRIGHT
1999-2026, NLnet Labs


unbound-control-setup

title: unbound-control-setup(8)

text:
# unbound-control-setup(8)

## NAME
unbound-control - Unbound 1.25.1 remote server control utility.

## SYNOPSIS
unbound-control [-hq] [-c cfgfile] [-s server] command

## DESCRIPTION
unbound-control performs remote administration on the unbound(8) DNS server. It reads the configuration file, contacts the Unbound server over TLS sends the command and displays the result.

The available options are:

-h

Show the version and commandline option help.

-c <cfgfile>

The config file to read with settings. If not given the default config file /var/lib/unbound/unbound.conf is used.

-s <server[@port]>

IPv4 or IPv6 address of the server to contact. If not given, the address is read from the config file.

-q

Quiet, if the option is given it does not print anything if it works ok.

## COMMANDS
There are several commands that the server understands.

start

Start the server. Simply execs unbound(8). The unbound executable is searched for in the PATH set in the environment. It is started with the config file specified using -c or the default config file.

stop

Stop the server. The server daemon exits.

reload

Reload the server. This flushes the cache and reads the config file fresh.

reload_keep_cache

Reload the server but try to keep the RRset and message cache if (re)configuration allows for it. That means the caches sizes and the number of threads must not change between reloads.

fast_reload [+dpv]

Reload the server, but keep downtime to a minimum, so that user queries keep seeing service. This needs the code compiled with threads. The config is loaded in a thread, and prepared, then it briefly pauses the existing server and updates config options. The intent is that the pause does not impact the service of user queries. The cache is kept. Also user queries worked on are kept and continue, but with the new config options. NOTE:

This command is experimental at this time.

The amount of temporal memory needed during a fast_reload is twice the amount needed for configuration. This is because Unbound temporarily needs to store both current configuration values and new ones while trying to fast_reload. Zones loaded from disk (authority zones and RPZ zones) are included in such memory needs.

Options that can be changed are for forwards, stubs, views, authority zones, RPZ zones and local zones.

Also access-control and similar options, interface-action and similar options and tcp-connection-limit. It can reload some define-tag changes, more on that below. Further options include insecure-lan-zones, domain-insecure, trust-anchor-file, trust-anchor, trusted-keys-file, auto-trust-anchor-file, edns-client-string, ipset, log-identity, infra-cache-numhosts, msg-cache-size, rrset-cache-size, key-cache-size, ratelimit-size, neg-cache-size, num-queries-per-thread, jostle-timeout, use-caps-for-id, unwanted-reply-threshold, tls-use-sni, outgoing-tcp-mss, ip-dscp, max-reuse-tcp-queries, tcp-reuse-timeout, tcp-auth-query-timeout, delay-close. iter-scrub-promiscuous. tls-service-key. tls-service-pem.

It does not work with interface and outgoing-interface changes, also not with remote control, outgoing-port-permit, outgoing-port-avoid, msg-buffer-size, any *-slabs options and statistics-interval changes.

For dnstap these options can be changed: dnstap-log-resolver-query-messages, dnstap-log-resolver-response-messages, dnstap-log-client-query-messages, dnstap-log-client-response-messages, dnstap-log-forwarder-query-messages and dnstap-log-forwarder-response-messages.

It does not work with these options: dnstap-enable, dnstap-bidirectional, dnstap-socket-path, dnstap-ip, dnstap-tls, dnstap-tls-server-name, dnstap-tls-cert-bundle, dnstap-tls-client-key-file and dnstap-tls-client-cert-file.

The options dnstap-send-identity, dnstap-send-version, dnstap-identity, and dnstap-version can be loaded when +p is not used.

The +v option makes the output verbose which includes the time it took to do the reload. With +vv it is more verbose which includes the amount of memory that was allocated temporarily to perform the reload; this amount of memory can be big if the config has large contents. In the timing output the 'reload' time is the time during which the server was paused.

The +p option makes the reload not pause threads, they keep running. Locks are acquired, but items are updated in sequence, so it is possible for threads to see an inconsistent state with some options from the old and some options from the new config, such as cache TTL parameters from the old config and forwards from the new config. The stubs and forwards are updated at the same time, so that they are viewed consistently, either old or new values together. The option makes the reload time take eg. 3 microseconds instead of 0.3 milliseconds during which the worker threads are interrupted. So, the interruption is much shorter, at the expense of some inconsistency. After the reload itself, every worker thread is briefly contacted to make them release resources, this makes the delete timing a little longer, and takes up time from the remote control servicing worker thread.

With the nopause option (+p), the reload does not work to reload some options, that fast reload works on without the nopause option: val-bogus-ttl, val-override-date, val-sig-skew-min, val-sig-skew-max, val-max-restart, val-nsec3-keysize-iterations, target-fetch-policy, outbound-msg-retry, max-sent-count, max-query-restarts, do-not-query-address, do-not-query-localhost, private-address, private-domain, caps-exempt, nat64-prefix, do-nat64, infra-host-ttl, infra-keep-probing, ratelimit, ip-ratelimit, ip-ratelimit-cookie, wait-limit-netblock, wait-limit-cookie-netblock, ratelimit-below-domain, ratelimit-for-domain.

The +d option makes the reload drop queries that the worker threads are working on. This is like flush_requestlist. Without it the queries are kept so that users keep getting answers for those queries that are currently processed. The drop makes it so that queries during the life time of the query processing see only old, or only new config options.

When there are changes to the config tags, from the define-tag option, then the +d option is implicitly turned on with a warning printout, and queries are dropped. This is to stop references to the old tag information, by the old queries. If the number of tags is increased in the newly loaded config, by adding tags at the end, then the implicit +d option is not needed.

For response ip, that is actions associated with IP addresses, and perhaps intersected with access control tag and action information, those settings are stored with a query when it comes in based on its source IP address. The old information is kept with the query until the queries are done. This is gone when those queries are resolved and finished, or it is possible to flush the requestlist with +d.

verbosity number

Change verbosity value for logging. Same values as the verbosity: keyword in unbound.conf(5). This new setting lasts until the server is issued a reload (taken from config file again), or the next verbosity control command.

log_reopen

Reopen the logfile, close and open it. Useful for logrotation to make the daemon release the file it is logging to. If you are using syslog it will attempt to close and open the syslog (which may not work if chrooted).

stats

Print statistics. Resets the internal counters to zero, this can be controlled using the statistics-cumulative: config statement. Statistics are printed with one [name]: [value] per line.

stats_noreset

Peek at statistics. Prints them like the stats command does, but does not reset the internal counters to zero.

status

Display server status. Exit code 3 if not running (the connection to the port is refused), 1 on error, 0 if running.

local_zone name type

Add new local zone with name and type. Like local-zone config statement. If the zone already exists, the type is changed to the given argument.

local_zone_remove name

Remove the local zone with the given name. Removes all local data inside it. If the zone does not exist, the command succeeds.

local_data RR data...

Add new local data, the given resource record. Like local-data: keyword, except for when no covering zone exists. In that case this remote control command creates a transparent zone with the same name as this record.

local_data_remove name

Remove all RR data from local name. If the name already has no items, nothing happens. Often results in NXDOMAIN for the name (in a static zone), but if the name has become an empty nonterminal (there is still data in domain names below the removed name), NOERROR nodata answers are the result for that name.

local_zones

Add local zones read from stdin of unbound-control. Input is read per line, with name space type on a line. For bulk additions.

local_zones_remove

Remove local zones read from stdin of unbound-control. Input is one name per line. For bulk removals.

local_datas

Add local data RRs read from stdin of unbound-control. Input is one RR per line. For bulk additions.

local_datas_remove

Remove local data RRs read from stdin of unbound-control. Input is one name per line. For bulk removals.

dump_cache

The contents of the cache is printed in a text format to stdout. You can redirect it to a file to store the cache in a file. Not supported in remote Unbounds in multi-process operation.

load_cache

The contents of the cache is loaded from stdin. Uses the same format as dump_cache uses. Loading the cache with old, or wrong data can result in old or wrong data returned to clients. Loading data into the cache in this way is supported in order to aid with debugging. Not supported in remote Unbounds in multi-process operation.

cache_lookup [+t] names

Print to stdout the RRsets and messages that are in the cache. For every name listed the content at or under the name is printed. Several names separated by spaces can be given, each is printed. When subnetcache is enabled, also matching entries from the subnet cache are printed. The +t option allows tld and root names. With it names like 'com' and '.' can be used, but it takes a lot of effort to look up in the cache.

lookup name

Print to stdout the name servers that would be used to look up the name specified.

flush [+c] name

Remove the name from the cache. Removes the types A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR, SVCB and HTTPS. Because that is fast to do. Other record types can be removed using flush_type or flush_zone. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_type [+c] name type

Remove the name, type information from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_zone [+c] name

Remove all information at or below the name from the cache. The rrsets and key entries are removed so that new lookups will be performed. This needs to walk and inspect the entire cache, and is a slow operation. The entries are set to expired in the implementation of this command (so, with serve-expired enabled, it'll serve that information but schedule a prefetch for new information). The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_bogus [+c]

Remove all bogus data from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_negative [+c]

Remove all negative data from the cache. This is nxdomain answers, nodata answers and servfail answers. Also removes bad key entries (which could be due to failed lookups) from the dnssec key cache, and iterator last-resort lookup failures from the rrset cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_stats

Reset statistics to zero.

flush_requestlist

Drop the queries that are worked on. Stops working on the queries that the server is working on now. The cache is unaffected. No reply is sent for those queries, probably making those users request again later. Useful to make the server restart working on queries with new settings, such as a higher verbosity level.

dump_requestlist

Show what is worked on. Prints all queries that the server is currently working on. Prints the time that users have been waiting. For internal requests, no time is printed. And then prints out the module status. This prints the queries from the first thread, and not queries that are being serviced from other threads.

flush_infra all|IP

If all then entire infra cache is emptied. If a specific IP address, the entry for that address is removed from the cache. It contains EDNS, ping and lameness data.

dump_infra

Show the contents of the infra cache.

set_option opt: val

Set the option to the given value without a reload. The cache is therefore not flushed. The option must end with a ':' and whitespace must be between the option and the value. Some values may not have an effect if set this way, the new values are not written to the config file, not all options are supported. This is different from the set_option call in libunbound, where all values work because Unbound has not been initialized. The values that work are: statistics-interval, statistics-cumulative, do-not-query-localhost, harden-short-bufsize, harden-large-queries, harden-glue, harden-dnssec-stripped, harden-below-nxdomain, harden-referral-path, prefetch, prefetch-key, log-queries, hide-identity, hide-version, identity, version, val-log-level, val-log-squelch, ignore-cd-flag, add-holddown, del-holddown, keep-missing, tcp-upstream, ssl-upstream, max-udp-size, ratelimit, ip-ratelimit, cache-max-ttl, cache-min-ttl, cache-max-negative-ttl.

get_option opt

Get the value of the option. Give the option name without a trailing ':'. The value is printed. If the value is "", nothing is printed and the connection closes. On error 'error ...' is printed (it gives a syntax error on unknown option). For some options a list of values, one on each line, is printed. The options are shown from the config file as modified with set_option. For some options an override may have been taken that does not show up with this command, not results from e.g. the verbosity and forward control commands. Not all options work, see list_stubs, list_forwards, list_local_zones and list_local_data for those.

list_stubs

List the stub zones in use. These are printed one by one to the output. This includes the root hints in use.

list_forwards

List the forward zones in use. These are printed zone by zone to the output.

list_insecure

List the zones with domain-insecure.

list_local_zones

List the local zones in use. These are printed one per line with zone type.

list_local_data

List the local data RRs in use. The resource records are printed.

insecure_add zone

Add a domain-insecure for the given zone, like the statement in unbound.conf. Adds to the running Unbound without affecting the cache contents (which may still be bogus, use flush_zone to remove it), does not affect the config file.

insecure_remove zone

Removes domain-insecure for the given zone.

forward_add [+it] zone addr ...

Add a new forward zone to running Unbound. With +i option also adds a domain-insecure for the zone (so it can resolve insecurely if you have a DNSSEC root trust anchor configured for other names). The addr can be IP4, IP6 or nameserver names, like forward-zone config in unbound.conf. The +t option sets it to use TLS upstream, like forward-tls-upstream: yes.

forward_remove [+i] zone

Remove a forward zone from running Unbound. The +i also removes a domain-insecure for the zone.

stub_add [+ipt] zone addr ...

Add a new stub zone to running Unbound. With +i option also adds a domain-insecure for the zone. With +p the stub zone is set to prime, without it it is set to notprime. The addr can be IP4, IP6 or nameserver names, like the stub-zone: config in unbound.conf. The +t option sets it to use TLS upstream, like stub-tls-upstream: yes.

stub_remove [+i] zone

Remove a stub zone from running Unbound. The +i also removes a domain-insecure for the zone.

forward [off | addr ... ]

Setup forwarding mode. Configures if the server should ask other upstream nameservers, should go to the internet root nameservers itself, or show the current config. You could pass the nameservers after a DHCP update. Without arguments the current list of addresses used to forward all queries to is printed. On startup this is from the forward-zone "." configuration. Afterwards it shows the status. It prints off when no forwarding is used.

If off is passed, forwarding is disabled and the root nameservers are used. This can be used to avoid to avoid buggy or non-DNSSEC supporting nameservers returned from DHCP. But may not work in hotels or hotspots.

If one or more IPv4 or IPv6 addresses are given, those are then used to forward queries to. The addresses must be separated with spaces. With '@port' the port number can be set explicitly (default port is 53 (DNS)).

By default the forwarder information from the config file for the root "." is used. The config file is not changed, so after a reload these changes are gone. Other forward zones from the config file are not affected by this command.

ratelimit_list [+a]

List the domains that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all domains, not just the ratelimited domains, with their estimated qps. The ratelimited domains return an error for uncached (new) queries, but cached queries work as normal.

ip_ratelimit_list [+a]

List the ip addresses that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all ips, not just the ratelimited ips, with their estimated qps. The ratelimited ips are dropped before checking the cache.

list_auth_zones

List the auth zones that are configured. Printed one per line with a status, indicating if the zone is expired and current serial number. Configured RPZ zones are included.

auth_zone_reload zone

Reload the auth zone (or RPZ zone) from zonefile. The zonefile is read in overwriting the current contents of the zone in memory. This changes the auth zone contents itself, not the cache contents. Such cache contents exists if you set Unbound to validate with for-upstream: yes and that can be cleared with flush_zone zone.

auth_zone_transfer zone

Transfer the auth zone (or RPZ zone) from master. The auth zone probe sequence is started, where the masters are probed to see if they have an updated zone (with the SOA serial check). And then the zone is transferred for a newer zone version.

rpz_enable zone

Enable the RPZ zone if it had previously been disabled.

rpz_disable zone

Disable the RPZ zone.

view_list_local_zones view

list_local_zones for given view.

view_local_zone view name type

local_zone for given view.

view_local_zone_remove view name

local_zone_remove for given view.

view_list_local_data view

list_local_data for given view.

view_local_data view RR data...

local_data for given view.

view_local_data_remove view name

local_data_remove for given view.

view_local_datas_remove view

Remove a list of local_data for given view from stdin. Like local_datas_remove.

view_local_datas view

Add a list of local_data for given view from stdin. Like local_datas.

add_cookie_secret secret

Add or replace a cookie secret persistently. secret needs to be an 128 bit hex string. Cookie secrets can be either active or staging. Active cookie secrets are used to create DNS Cookies, but verification of a DNS Cookie succeeds with any of the active or staging cookie secrets. The state of the current cookie secrets can be printed with the print_cookie_secrets command.

When there are no cookie secrets configured yet, the secret is added as active. If there is already an active cookie secret, the secret is added as staging or replacing an existing staging secret.

To "roll" a cookie secret used in an anycast set. The new secret has to be added as staging secret to all nodes in the anycast set. When all nodes can verify DNS Cookies with the new secret, the new secret can be activated with the activate_cookie_secret command. After all nodes have the new secret active for at least one hour, the previous secret can be dropped with the drop_cookie_secret command.

Persistence is accomplished by writing to a file which is configured with the cookie-secret-file option in the server section of the config file. This is disabled by default, "".

drop_cookie_secret

Drop the staging cookie secret.

activate_cookie_secret

Make the current staging cookie secret active, and the current active cookie secret staging.

print_cookie_secrets

Show the current configured cookie secrets with their status.

## EXIT CODE
The unbound-control program exits with status code 1 on error, 0 on success.

## SET UP
The setup requires a self-signed certificate and private keys for both the server and client. The script unbound-control-setup generates these in the default run directory, or with -d in another directory. If you change the access control permissions on the key files you can decide who can use unbound-control, by default owner and group but not all users. Run the script under the same username as you have configured in unbound.conf or as root, so that the daemon is permitted to read the files, for example with:

```
sudo -u unbound unbound-control-setup
```

If you have not configured a username in unbound.conf, the keys need read permission for the user credentials under which the daemon is started. The script preserves private keys present in the directory. After running the script as root, turn on control-enable in unbound.conf.

## STATISTIC COUNTERS
The stats and stats_noreset commands show a number of statistic counters:

threadX.num.queries

number of queries received by thread

threadX.num.queries_ip_ratelimited

number of queries rate limited by thread

threadX.num.queries_cookie_valid

number of queries with a valid DNS Cookie by thread

threadX.num.queries_cookie_client

number of queries with a client part only DNS Cookie by thread

threadX.num.queries_cookie_invalid

number of queries with an invalid DNS Cookie by thread

threadX.num.queries_discard_timeout

number of queries removed due to discard-timeout by thread

threadX.num.queries_replyaddr_limit

number of queries removed due to replyaddr limits by thread

threadX.num.queries_wait_limit

number of queries removed due to wait-limit by thread

threadX.num.cachehits

number of queries that were successfully answered using a cache lookup

threadX.num.cachemiss

number of queries that needed recursive processing

threadX.num.dnscrypt.crypted

number of queries that were encrypted and successfully decapsulated by dnscrypt.

threadX.num.dnscrypt.cert

number of queries that were requesting dnscrypt certificates.

threadX.num.dnscrypt.cleartext

number of queries received on dnscrypt port that were cleartext and not a request for certificates.

threadX.num.dnscrypt.malformed

number of request that were neither cleartext, not valid dnscrypt messages.

threadX.num.dns_error_reports

number of DNS Error Reports generated by thread

threadX.num.prefetch

number of cache prefetches performed. This number is included in cachehits, as the original query had the unprefetched answer from cache, and resulted in recursive processing, taking a slot in the requestlist. Not part of the recursivereplies (or the histogram thereof) or cachemiss, as a cache response was sent.

threadX.num.expired

number of replies that served an expired cache entry.

threadX.num.queries_timed_out

number of queries that are dropped because they waited in the UDP socket buffer for too long.

threadX.query.queue_time_us.max

The maximum wait time for packets in the socket buffer, in microseconds. This is only reported when sock-queue-timeout is enabled.

threadX.num.recursivereplies

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.

threadX.requestlist.avg

The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.

threadX.requestlist.max

Maximum size attained by the internal recursive processing request list.

threadX.requestlist.overwritten

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. The counter is increased when during the flood the jostle-timeout allows a query to be removed in favor of a new incoming query. The older query is then dropped to make space.

threadX.requestlist.exceeded

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. The counter is increased when during the flood there is no space to be made with the jostle out of an older query, and the new query is dropped. Since no older queries are removed, see jostle-timeout setting, there is no space for the new query.

threadX.requestlist.current.all

Current size of the request list, includes internally generated queries (such as priming queries and glue lookups).

threadX.requestlist.current.user

Current size of the request list, only the requests from client queries.

threadX.requestlist.current.replies

Current count of the number of reply entries waiting on request list entries. Because a request list entry can send results to multiple reply addresses, this number may be larger than the size of the request list.

threadX.recursion.time.avg

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.

threadX.recursion.time.median

The median of the time it took to answer queries that needed recursive processing. The median means that 50% of the user queries were answered in less than this time. Because of big outliers (usually queries to non responsive servers), the average can be bigger than the median. This median has been calculated by interpolation from a histogram.

threadX.tcpusage

The currently held tcp buffers for incoming connections. A spot value on the time of the request. This helps you spot if the incoming-num-tcp buffers are full.

total.num.queries

summed over threads.

total.num.queries_ip_ratelimited

summed over threads.

total.num.queries_cookie_valid

summed over threads.

total.num.queries_cookie_client

summed over threads.

total.num.queries_cookie_invalid

summed over threads.

total.num.queries_discard_timeout

summed over threads.

total.num.queries_replyaddr_limit

summed over threads.

total.num.queries_wait_limit

summed over threads.

total.num.cachehits

summed over threads.

total.num.cachemiss

summed over threads.

total.num.dnscrypt.crypted

summed over threads.

total.num.dnscrypt.cert

summed over threads.

total.num.dnscrypt.cleartext

summed over threads.

total.num.dnscrypt.malformed

summed over threads.

total.num.dns_error_reports

summed over threads.

total.num.prefetch

summed over threads.

total.num.expired

summed over threads.

total.num.queries_timed_out

summed over threads.

total.query.queue_time_us.max

the maximum of the thread values.

total.num.recursivereplies

summed over threads.

total.requestlist.avg

averaged over threads.

total.requestlist.max

the maximum of the thread requestlist.max values.

total.requestlist.overwritten

summed over threads.

total.requestlist.exceeded

summed over threads.

total.requestlist.current.all

summed over threads.

total.requestlist.current.user

summed over threads.

total.requestlist.current.replies

summed over threads.

total.recursion.time.median

averaged over threads.

total.tcpusage

summed over threads.

time.now

current time in seconds since 1970.

time.up

uptime since server boot in seconds.

time.elapsed

time since last statistics printout, in seconds.

## EXTENDED STATISTICS
mem.cache.rrset

Memory in bytes in use by the RRset cache.

mem.cache.message

Memory in bytes in use by the message cache.

mem.cache.dnscrypt_shared_secret

Memory in bytes in use by the dnscrypt shared secrets cache.

mem.cache.dnscrypt_nonce

Memory in bytes in use by the dnscrypt nonce cache.

mem.mod.iterator

Memory in bytes in use by the iterator module.

mem.mod.validator

Memory in bytes in use by the validator module. Includes the key cache and negative cache.

mem.streamwait

Memory in bytes in used by the TCP and TLS stream wait buffers. These are answers waiting to be written back to the clients.

mem.http.query_buffer

Memory in bytes used by the HTTP/2 query buffers. Containing (partial) DNS queries waiting for request stream completion.

mem.http.response_buffer

Memory in bytes used by the HTTP/2 response buffers. Containing DNS responses waiting to be written back to the clients.

mem.quic

Memory in bytes used by QUIC. Containing connection information, stream information, queries read and responses written back to the clients.

histogram.<sec>.<usec>.to.<sec>.<usec>

Shows a histogram, summed over all threads. Every element counts the recursive queries whose reply time fit between the lower and upper bound. Times larger or equal to the lowerbound, and smaller than the upper bound. There are 40 buckets, with bucket sizes doubling.

num.query.type.A

The total number of queries over all threads with query type A. Printed for the other query types as well, but only for the types for which queries were received, thus =0 entries are omitted for brevity.

num.query.type.other

Number of queries with query types 256-65535.

num.query.class.IN

The total number of queries over all threads with query class IN (internet). Also printed for other classes (such as CH (CHAOS) sometimes used for debugging), or NONE, ANY, used by dynamic update. num.query.class.other is printed for classes 256-65535.

num.query.opcode.QUERY

The total number of queries over all threads with query opcode QUERY. Also printed for other opcodes, UPDATE, ...

num.query.tcp

Number of queries that were made using TCP towards the Unbound server.

num.query.tcpout

Number of queries that the Unbound server made using TCP outgoing towards other servers.

num.query.udpout

Number of queries that the Unbound server made using UDP outgoing towards other servers.

num.query.tls

Number of queries that were made using TLS towards the Unbound server. These are also counted in num.query.tcp, because TLS uses TCP.

num.query.tls.resume

Number of TLS session resumptions, these are queries over TLS towards the Unbound server where the client negotiated a TLS session resumption key.

num.query.https

Number of queries that were made using HTTPS towards the Unbound server. These are also counted in num.query.tcp and num.query.tls, because HTTPS uses TLS and TCP.

num.query.quic

Number of queries that were made using QUIC towards the Unbound server. These are also counted in num.query.tls, because TLS is used for these queries.

num.query.ipv6

Number of queries that were made using IPv6 towards the Unbound server.

num.query.flags.RD

The number of queries that had the RD flag set in the header. Also printed for flags QR, AA, TC, RA, Z, AD, CD. Note that queries with flags QR, AA or TC may have been rejected because of that.

num.query.edns.present

number of queries that had an EDNS OPT record present.

num.query.edns.DO

number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set. These queries are also included in the num.query.edns.present number.

num.query.ratelimited

The number of queries that are turned away from being send to nameserver due to ratelimiting.

num.query.dnscrypt.shared_secret.cachemiss

The number of dnscrypt queries that did not find a shared secret in the cache. This can be use to compute the shared secret hitrate.

num.query.dnscrypt.replay

The number of dnscrypt queries that found a nonce hit in the nonce cache and hence are considered a query replay.

num.answer.rcode.NXDOMAIN

The number of answers to queries, from cache or from recursion, that had the return code NXDOMAIN. Also printed for the other return codes.

num.answer.rcode.nodata

The number of answers to queries that had the pseudo return code nodata. This means the actual return code was NOERROR, but additionally, no data was carried in the answer (making what is called a NOERROR/NODATA answer). These queries are also included in the num.answer.rcode.NOERROR number. Common for AAAA lookups when an A record exists, and no AAAA.

num.answer.secure

Number of answers that were secure. The answer validated correctly. The AD bit might have been set in some of these answers, where the client signalled (with DO or AD bit in the query) that they were ready to accept the AD bit in the answer.

num.answer.bogus

Number of answers that were bogus. These answers resulted in SERVFAIL to the client because the answer failed validation.

num.rrset.bogus

The number of rrsets marked bogus by the validator. Increased for every RRset inspection that fails.

num.valops

The number of validation operations performed by the validator. Increased for every RRSIG verification operation regardless of the validation result. The RRSIG and key combination needs to first pass some sanity checks before Unbound even performs the verification, e.g., length/protocol checks.

unwanted.queries

Number of queries that were refused or dropped because they failed the access control settings.

unwanted.replies

Replies that were unwanted or unsolicited. Could have been random traffic, delayed duplicates, very late answers, or could be spoofing attempts. Some low level of late answers and delayed duplicates are to be expected with the UDP protocol. Very high values could indicate a threat (spoofing).

msg.cache.count

The number of items (DNS replies) in the message cache.

rrset.cache.count

The number of RRsets in the rrset cache. This includes rrsets used by the messages in the message cache, but also delegation information.

infra.cache.count

The number of items in the infra cache. These are IP addresses with their timing and protocol support information.

key.cache.count

The number of items in the key cache. These are DNSSEC keys, one item per delegation point, and their validation status.

msg.cache.max_collisions

The maximum number of hash table collisions in the msg cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

rrset.cache.max_collisions

The maximum number of hash table collisions in the rrset cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

dnscrypt_shared_secret.cache.count

The number of items in the shared secret cache. These are precomputed shared secrets for a given client public key/server secret key pair. Shared secrets are CPU intensive and this cache allows Unbound to avoid recomputing the shared secret when multiple dnscrypt queries are sent from the same client.

dnscrypt_nonce.cache.count

The number of items in the client nonce cache. This cache is used to prevent dnscrypt queries replay. The client nonce must be unique for each client public key/server secret key pair. This cache should be able to host QPS * replay window interval keys to prevent replay of a query during replay window seconds.

num.query.authzone.up

The number of queries answered from auth-zone data, upstream queries. These queries would otherwise have been sent (with fallback enabled) to the internet, but are now answered from the auth zone.

num.query.authzone.down

The number of queries for downstream answered from auth-zone data. These queries are from downstream clients, and have had an answer from the data in the auth zone.

num.query.aggressive.NOERROR

The number of queries answered using cached NSEC records with NODATA RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.aggressive.NXDOMAIN

The number of queries answered using cached NSEC records with NXDOMAIN RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.subnet

Number of queries that got an answer that contained EDNS client subnet data.

num.query.subnet_cache

Number of queries answered from the edns client subnet cache. These are counted as cachemiss by the main counters, but hit the client subnet specific cache after getting processed by the edns client subnet module.

num.query.cachedb

Number of queries answered from the external cache of cachedb. These are counted as cachemiss by the main counters, but hit the cachedb external cache after getting processed by the cachedb module.

num.rpz.action.<rpz_action>

Number of queries answered using configured RPZ policy, per RPZ action type. Possible actions are: nxdomain, nodata, passthru, drop, tcp-only, local-data, disabled, and cname-override.

## FILES
/var/lib/unbound/unbound.conf

Unbound configuration file.

/var/lib/unbound

directory with private keys (unbound_server.key and unbound_control.key) and self-signed certificates (unbound_server.pem and unbound_control.pem).

## SEE ALSO
unbound.conf(5), unbound(8).

## AUTHOR
Unbound developers are mentioned in the CREDITS file in the distribution.

## COPYRIGHT
1999-2026, NLnet Labs


unbound-control

package: unbound-control

title: unbound-control(8)

text:
# unbound-control(8)

## NAME
unbound-control - Unbound 1.25.1 remote server control utility.

## SYNOPSIS
unbound-control [-hq] [-c cfgfile] [-s server] command

## DESCRIPTION
unbound-control performs remote administration on the unbound(8) DNS server. It reads the configuration file, contacts the Unbound server over TLS sends the command and displays the result.

The available options are:

-h

Show the version and commandline option help.

-c <cfgfile>

The config file to read with settings. If not given the default config file /var/lib/unbound/unbound.conf is used.

-s <server[@port]>

IPv4 or IPv6 address of the server to contact. If not given, the address is read from the config file.

-q

Quiet, if the option is given it does not print anything if it works ok.

## COMMANDS
There are several commands that the server understands.

start

Start the server. Simply execs unbound(8). The unbound executable is searched for in the PATH set in the environment. It is started with the config file specified using -c or the default config file.

stop

Stop the server. The server daemon exits.

reload

Reload the server. This flushes the cache and reads the config file fresh.

reload_keep_cache

Reload the server but try to keep the RRset and message cache if (re)configuration allows for it. That means the caches sizes and the number of threads must not change between reloads.

fast_reload [+dpv]

Reload the server, but keep downtime to a minimum, so that user queries keep seeing service. This needs the code compiled with threads. The config is loaded in a thread, and prepared, then it briefly pauses the existing server and updates config options. The intent is that the pause does not impact the service of user queries. The cache is kept. Also user queries worked on are kept and continue, but with the new config options. NOTE:

This command is experimental at this time.

The amount of temporal memory needed during a fast_reload is twice the amount needed for configuration. This is because Unbound temporarily needs to store both current configuration values and new ones while trying to fast_reload. Zones loaded from disk (authority zones and RPZ zones) are included in such memory needs.

Options that can be changed are for forwards, stubs, views, authority zones, RPZ zones and local zones.

Also access-control and similar options, interface-action and similar options and tcp-connection-limit. It can reload some define-tag changes, more on that below. Further options include insecure-lan-zones, domain-insecure, trust-anchor-file, trust-anchor, trusted-keys-file, auto-trust-anchor-file, edns-client-string, ipset, log-identity, infra-cache-numhosts, msg-cache-size, rrset-cache-size, key-cache-size, ratelimit-size, neg-cache-size, num-queries-per-thread, jostle-timeout, use-caps-for-id, unwanted-reply-threshold, tls-use-sni, outgoing-tcp-mss, ip-dscp, max-reuse-tcp-queries, tcp-reuse-timeout, tcp-auth-query-timeout, delay-close. iter-scrub-promiscuous. tls-service-key. tls-service-pem.

It does not work with interface and outgoing-interface changes, also not with remote control, outgoing-port-permit, outgoing-port-avoid, msg-buffer-size, any *-slabs options and statistics-interval changes.

For dnstap these options can be changed: dnstap-log-resolver-query-messages, dnstap-log-resolver-response-messages, dnstap-log-client-query-messages, dnstap-log-client-response-messages, dnstap-log-forwarder-query-messages and dnstap-log-forwarder-response-messages.

It does not work with these options: dnstap-enable, dnstap-bidirectional, dnstap-socket-path, dnstap-ip, dnstap-tls, dnstap-tls-server-name, dnstap-tls-cert-bundle, dnstap-tls-client-key-file and dnstap-tls-client-cert-file.

The options dnstap-send-identity, dnstap-send-version, dnstap-identity, and dnstap-version can be loaded when +p is not used.

The +v option makes the output verbose which includes the time it took to do the reload. With +vv it is more verbose which includes the amount of memory that was allocated temporarily to perform the reload; this amount of memory can be big if the config has large contents. In the timing output the 'reload' time is the time during which the server was paused.

The +p option makes the reload not pause threads, they keep running. Locks are acquired, but items are updated in sequence, so it is possible for threads to see an inconsistent state with some options from the old and some options from the new config, such as cache TTL parameters from the old config and forwards from the new config. The stubs and forwards are updated at the same time, so that they are viewed consistently, either old or new values together. The option makes the reload time take eg. 3 microseconds instead of 0.3 milliseconds during which the worker threads are interrupted. So, the interruption is much shorter, at the expense of some inconsistency. After the reload itself, every worker thread is briefly contacted to make them release resources, this makes the delete timing a little longer, and takes up time from the remote control servicing worker thread.

With the nopause option (+p), the reload does not work to reload some options, that fast reload works on without the nopause option: val-bogus-ttl, val-override-date, val-sig-skew-min, val-sig-skew-max, val-max-restart, val-nsec3-keysize-iterations, target-fetch-policy, outbound-msg-retry, max-sent-count, max-query-restarts, do-not-query-address, do-not-query-localhost, private-address, private-domain, caps-exempt, nat64-prefix, do-nat64, infra-host-ttl, infra-keep-probing, ratelimit, ip-ratelimit, ip-ratelimit-cookie, wait-limit-netblock, wait-limit-cookie-netblock, ratelimit-below-domain, ratelimit-for-domain.

The +d option makes the reload drop queries that the worker threads are working on. This is like flush_requestlist. Without it the queries are kept so that users keep getting answers for those queries that are currently processed. The drop makes it so that queries during the life time of the query processing see only old, or only new config options.

When there are changes to the config tags, from the define-tag option, then the +d option is implicitly turned on with a warning printout, and queries are dropped. This is to stop references to the old tag information, by the old queries. If the number of tags is increased in the newly loaded config, by adding tags at the end, then the implicit +d option is not needed.

For response ip, that is actions associated with IP addresses, and perhaps intersected with access control tag and action information, those settings are stored with a query when it comes in based on its source IP address. The old information is kept with the query until the queries are done. This is gone when those queries are resolved and finished, or it is possible to flush the requestlist with +d.

verbosity number

Change verbosity value for logging. Same values as the verbosity: keyword in unbound.conf(5). This new setting lasts until the server is issued a reload (taken from config file again), or the next verbosity control command.

log_reopen

Reopen the logfile, close and open it. Useful for logrotation to make the daemon release the file it is logging to. If you are using syslog it will attempt to close and open the syslog (which may not work if chrooted).

stats

Print statistics. Resets the internal counters to zero, this can be controlled using the statistics-cumulative: config statement. Statistics are printed with one [name]: [value] per line.

stats_noreset

Peek at statistics. Prints them like the stats command does, but does not reset the internal counters to zero.

status

Display server status. Exit code 3 if not running (the connection to the port is refused), 1 on error, 0 if running.

local_zone name type

Add new local zone with name and type. Like local-zone config statement. If the zone already exists, the type is changed to the given argument.

local_zone_remove name

Remove the local zone with the given name. Removes all local data inside it. If the zone does not exist, the command succeeds.

local_data RR data...

Add new local data, the given resource record. Like local-data: keyword, except for when no covering zone exists. In that case this remote control command creates a transparent zone with the same name as this record.

local_data_remove name

Remove all RR data from local name. If the name already has no items, nothing happens. Often results in NXDOMAIN for the name (in a static zone), but if the name has become an empty nonterminal (there is still data in domain names below the removed name), NOERROR nodata answers are the result for that name.

local_zones

Add local zones read from stdin of unbound-control. Input is read per line, with name space type on a line. For bulk additions.

local_zones_remove

Remove local zones read from stdin of unbound-control. Input is one name per line. For bulk removals.

local_datas

Add local data RRs read from stdin of unbound-control. Input is one RR per line. For bulk additions.

local_datas_remove

Remove local data RRs read from stdin of unbound-control. Input is one name per line. For bulk removals.

dump_cache

The contents of the cache is printed in a text format to stdout. You can redirect it to a file to store the cache in a file. Not supported in remote Unbounds in multi-process operation.

load_cache

The contents of the cache is loaded from stdin. Uses the same format as dump_cache uses. Loading the cache with old, or wrong data can result in old or wrong data returned to clients. Loading data into the cache in this way is supported in order to aid with debugging. Not supported in remote Unbounds in multi-process operation.

cache_lookup [+t] names

Print to stdout the RRsets and messages that are in the cache. For every name listed the content at or under the name is printed. Several names separated by spaces can be given, each is printed. When subnetcache is enabled, also matching entries from the subnet cache are printed. The +t option allows tld and root names. With it names like 'com' and '.' can be used, but it takes a lot of effort to look up in the cache.

lookup name

Print to stdout the name servers that would be used to look up the name specified.

flush [+c] name

Remove the name from the cache. Removes the types A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR, SVCB and HTTPS. Because that is fast to do. Other record types can be removed using flush_type or flush_zone. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_type [+c] name type

Remove the name, type information from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_zone [+c] name

Remove all information at or below the name from the cache. The rrsets and key entries are removed so that new lookups will be performed. This needs to walk and inspect the entire cache, and is a slow operation. The entries are set to expired in the implementation of this command (so, with serve-expired enabled, it'll serve that information but schedule a prefetch for new information). The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_bogus [+c]

Remove all bogus data from the cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_negative [+c]

Remove all negative data from the cache. This is nxdomain answers, nodata answers and servfail answers. Also removes bad key entries (which could be due to failed lookups) from the dnssec key cache, and iterator last-resort lookup failures from the rrset cache. The +c option removes the items also from the cachedb cache. If cachedb is in use.

flush_stats

Reset statistics to zero.

flush_requestlist

Drop the queries that are worked on. Stops working on the queries that the server is working on now. The cache is unaffected. No reply is sent for those queries, probably making those users request again later. Useful to make the server restart working on queries with new settings, such as a higher verbosity level.

dump_requestlist

Show what is worked on. Prints all queries that the server is currently working on. Prints the time that users have been waiting. For internal requests, no time is printed. And then prints out the module status. This prints the queries from the first thread, and not queries that are being serviced from other threads.

flush_infra all|IP

If all then entire infra cache is emptied. If a specific IP address, the entry for that address is removed from the cache. It contains EDNS, ping and lameness data.

dump_infra

Show the contents of the infra cache.

set_option opt: val

Set the option to the given value without a reload. The cache is therefore not flushed. The option must end with a ':' and whitespace must be between the option and the value. Some values may not have an effect if set this way, the new values are not written to the config file, not all options are supported. This is different from the set_option call in libunbound, where all values work because Unbound has not been initialized. The values that work are: statistics-interval, statistics-cumulative, do-not-query-localhost, harden-short-bufsize, harden-large-queries, harden-glue, harden-dnssec-stripped, harden-below-nxdomain, harden-referral-path, prefetch, prefetch-key, log-queries, hide-identity, hide-version, identity, version, val-log-level, val-log-squelch, ignore-cd-flag, add-holddown, del-holddown, keep-missing, tcp-upstream, ssl-upstream, max-udp-size, ratelimit, ip-ratelimit, cache-max-ttl, cache-min-ttl, cache-max-negative-ttl.

get_option opt

Get the value of the option. Give the option name without a trailing ':'. The value is printed. If the value is "", nothing is printed and the connection closes. On error 'error ...' is printed (it gives a syntax error on unknown option). For some options a list of values, one on each line, is printed. The options are shown from the config file as modified with set_option. For some options an override may have been taken that does not show up with this command, not results from e.g. the verbosity and forward control commands. Not all options work, see list_stubs, list_forwards, list_local_zones and list_local_data for those.

list_stubs

List the stub zones in use. These are printed one by one to the output. This includes the root hints in use.

list_forwards

List the forward zones in use. These are printed zone by zone to the output.

list_insecure

List the zones with domain-insecure.

list_local_zones

List the local zones in use. These are printed one per line with zone type.

list_local_data

List the local data RRs in use. The resource records are printed.

insecure_add zone

Add a domain-insecure for the given zone, like the statement in unbound.conf. Adds to the running Unbound without affecting the cache contents (which may still be bogus, use flush_zone to remove it), does not affect the config file.

insecure_remove zone

Removes domain-insecure for the given zone.

forward_add [+it] zone addr ...

Add a new forward zone to running Unbound. With +i option also adds a domain-insecure for the zone (so it can resolve insecurely if you have a DNSSEC root trust anchor configured for other names). The addr can be IP4, IP6 or nameserver names, like forward-zone config in unbound.conf. The +t option sets it to use TLS upstream, like forward-tls-upstream: yes.

forward_remove [+i] zone

Remove a forward zone from running Unbound. The +i also removes a domain-insecure for the zone.

stub_add [+ipt] zone addr ...

Add a new stub zone to running Unbound. With +i option also adds a domain-insecure for the zone. With +p the stub zone is set to prime, without it it is set to notprime. The addr can be IP4, IP6 or nameserver names, like the stub-zone: config in unbound.conf. The +t option sets it to use TLS upstream, like stub-tls-upstream: yes.

stub_remove [+i] zone

Remove a stub zone from running Unbound. The +i also removes a domain-insecure for the zone.

forward [off | addr ... ]

Setup forwarding mode. Configures if the server should ask other upstream nameservers, should go to the internet root nameservers itself, or show the current config. You could pass the nameservers after a DHCP update. Without arguments the current list of addresses used to forward all queries to is printed. On startup this is from the forward-zone "." configuration. Afterwards it shows the status. It prints off when no forwarding is used.

If off is passed, forwarding is disabled and the root nameservers are used. This can be used to avoid to avoid buggy or non-DNSSEC supporting nameservers returned from DHCP. But may not work in hotels or hotspots.

If one or more IPv4 or IPv6 addresses are given, those are then used to forward queries to. The addresses must be separated with spaces. With '@port' the port number can be set explicitly (default port is 53 (DNS)).

By default the forwarder information from the config file for the root "." is used. The config file is not changed, so after a reload these changes are gone. Other forward zones from the config file are not affected by this command.

ratelimit_list [+a]

List the domains that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all domains, not just the ratelimited domains, with their estimated qps. The ratelimited domains return an error for uncached (new) queries, but cached queries work as normal.

ip_ratelimit_list [+a]

List the ip addresses that are ratelimited. Printed one per line with current estimated qps and qps limit from config. With +a it prints all ips, not just the ratelimited ips, with their estimated qps. The ratelimited ips are dropped before checking the cache.

list_auth_zones

List the auth zones that are configured. Printed one per line with a status, indicating if the zone is expired and current serial number. Configured RPZ zones are included.

auth_zone_reload zone

Reload the auth zone (or RPZ zone) from zonefile. The zonefile is read in overwriting the current contents of the zone in memory. This changes the auth zone contents itself, not the cache contents. Such cache contents exists if you set Unbound to validate with for-upstream: yes and that can be cleared with flush_zone zone.

auth_zone_transfer zone

Transfer the auth zone (or RPZ zone) from master. The auth zone probe sequence is started, where the masters are probed to see if they have an updated zone (with the SOA serial check). And then the zone is transferred for a newer zone version.

rpz_enable zone

Enable the RPZ zone if it had previously been disabled.

rpz_disable zone

Disable the RPZ zone.

view_list_local_zones view

list_local_zones for given view.

view_local_zone view name type

local_zone for given view.

view_local_zone_remove view name

local_zone_remove for given view.

view_list_local_data view

list_local_data for given view.

view_local_data view RR data...

local_data for given view.

view_local_data_remove view name

local_data_remove for given view.

view_local_datas_remove view

Remove a list of local_data for given view from stdin. Like local_datas_remove.

view_local_datas view

Add a list of local_data for given view from stdin. Like local_datas.

add_cookie_secret secret

Add or replace a cookie secret persistently. secret needs to be an 128 bit hex string. Cookie secrets can be either active or staging. Active cookie secrets are used to create DNS Cookies, but verification of a DNS Cookie succeeds with any of the active or staging cookie secrets. The state of the current cookie secrets can be printed with the print_cookie_secrets command.

When there are no cookie secrets configured yet, the secret is added as active. If there is already an active cookie secret, the secret is added as staging or replacing an existing staging secret.

To "roll" a cookie secret used in an anycast set. The new secret has to be added as staging secret to all nodes in the anycast set. When all nodes can verify DNS Cookies with the new secret, the new secret can be activated with the activate_cookie_secret command. After all nodes have the new secret active for at least one hour, the previous secret can be dropped with the drop_cookie_secret command.

Persistence is accomplished by writing to a file which is configured with the cookie-secret-file option in the server section of the config file. This is disabled by default, "".

drop_cookie_secret

Drop the staging cookie secret.

activate_cookie_secret

Make the current staging cookie secret active, and the current active cookie secret staging.

print_cookie_secrets

Show the current configured cookie secrets with their status.

## EXIT CODE
The unbound-control program exits with status code 1 on error, 0 on success.

## SET UP
The setup requires a self-signed certificate and private keys for both the server and client. The script unbound-control-setup generates these in the default run directory, or with -d in another directory. If you change the access control permissions on the key files you can decide who can use unbound-control, by default owner and group but not all users. Run the script under the same username as you have configured in unbound.conf or as root, so that the daemon is permitted to read the files, for example with:

```
sudo -u unbound unbound-control-setup
```

If you have not configured a username in unbound.conf, the keys need read permission for the user credentials under which the daemon is started. The script preserves private keys present in the directory. After running the script as root, turn on control-enable in unbound.conf.

## STATISTIC COUNTERS
The stats and stats_noreset commands show a number of statistic counters:

threadX.num.queries

number of queries received by thread

threadX.num.queries_ip_ratelimited

number of queries rate limited by thread

threadX.num.queries_cookie_valid

number of queries with a valid DNS Cookie by thread

threadX.num.queries_cookie_client

number of queries with a client part only DNS Cookie by thread

threadX.num.queries_cookie_invalid

number of queries with an invalid DNS Cookie by thread

threadX.num.queries_discard_timeout

number of queries removed due to discard-timeout by thread

threadX.num.queries_replyaddr_limit

number of queries removed due to replyaddr limits by thread

threadX.num.queries_wait_limit

number of queries removed due to wait-limit by thread

threadX.num.cachehits

number of queries that were successfully answered using a cache lookup

threadX.num.cachemiss

number of queries that needed recursive processing

threadX.num.dnscrypt.crypted

number of queries that were encrypted and successfully decapsulated by dnscrypt.

threadX.num.dnscrypt.cert

number of queries that were requesting dnscrypt certificates.

threadX.num.dnscrypt.cleartext

number of queries received on dnscrypt port that were cleartext and not a request for certificates.

threadX.num.dnscrypt.malformed

number of request that were neither cleartext, not valid dnscrypt messages.

threadX.num.dns_error_reports

number of DNS Error Reports generated by thread

threadX.num.prefetch

number of cache prefetches performed. This number is included in cachehits, as the original query had the unprefetched answer from cache, and resulted in recursive processing, taking a slot in the requestlist. Not part of the recursivereplies (or the histogram thereof) or cachemiss, as a cache response was sent.

threadX.num.expired

number of replies that served an expired cache entry.

threadX.num.queries_timed_out

number of queries that are dropped because they waited in the UDP socket buffer for too long.

threadX.query.queue_time_us.max

The maximum wait time for packets in the socket buffer, in microseconds. This is only reported when sock-queue-timeout is enabled.

threadX.num.recursivereplies

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.

threadX.requestlist.avg

The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.

threadX.requestlist.max

Maximum size attained by the internal recursive processing request list.

threadX.requestlist.overwritten

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. The counter is increased when during the flood the jostle-timeout allows a query to be removed in favor of a new incoming query. The older query is then dropped to make space.

threadX.requestlist.exceeded

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. The counter is increased when during the flood there is no space to be made with the jostle out of an older query, and the new query is dropped. Since no older queries are removed, see jostle-timeout setting, there is no space for the new query.

threadX.requestlist.current.all

Current size of the request list, includes internally generated queries (such as priming queries and glue lookups).

threadX.requestlist.current.user

Current size of the request list, only the requests from client queries.

threadX.requestlist.current.replies

Current count of the number of reply entries waiting on request list entries. Because a request list entry can send results to multiple reply addresses, this number may be larger than the size of the request list.

threadX.recursion.time.avg

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.

threadX.recursion.time.median

The median of the time it took to answer queries that needed recursive processing. The median means that 50% of the user queries were answered in less than this time. Because of big outliers (usually queries to non responsive servers), the average can be bigger than the median. This median has been calculated by interpolation from a histogram.

threadX.tcpusage

The currently held tcp buffers for incoming connections. A spot value on the time of the request. This helps you spot if the incoming-num-tcp buffers are full.

total.num.queries

summed over threads.

total.num.queries_ip_ratelimited

summed over threads.

total.num.queries_cookie_valid

summed over threads.

total.num.queries_cookie_client

summed over threads.

total.num.queries_cookie_invalid

summed over threads.

total.num.queries_discard_timeout

summed over threads.

total.num.queries_replyaddr_limit

summed over threads.

total.num.queries_wait_limit

summed over threads.

total.num.cachehits

summed over threads.

total.num.cachemiss

summed over threads.

total.num.dnscrypt.crypted

summed over threads.

total.num.dnscrypt.cert

summed over threads.

total.num.dnscrypt.cleartext

summed over threads.

total.num.dnscrypt.malformed

summed over threads.

total.num.dns_error_reports

summed over threads.

total.num.prefetch

summed over threads.

total.num.expired

summed over threads.

total.num.queries_timed_out

summed over threads.

total.query.queue_time_us.max

the maximum of the thread values.

total.num.recursivereplies

summed over threads.

total.requestlist.avg

averaged over threads.

total.requestlist.max

the maximum of the thread requestlist.max values.

total.requestlist.overwritten

summed over threads.

total.requestlist.exceeded

summed over threads.

total.requestlist.current.all

summed over threads.

total.requestlist.current.user

summed over threads.

total.requestlist.current.replies

summed over threads.

total.recursion.time.median

averaged over threads.

total.tcpusage

summed over threads.

time.now

current time in seconds since 1970.

time.up

uptime since server boot in seconds.

time.elapsed

time since last statistics printout, in seconds.

## EXTENDED STATISTICS
mem.cache.rrset

Memory in bytes in use by the RRset cache.

mem.cache.message

Memory in bytes in use by the message cache.

mem.cache.dnscrypt_shared_secret

Memory in bytes in use by the dnscrypt shared secrets cache.

mem.cache.dnscrypt_nonce

Memory in bytes in use by the dnscrypt nonce cache.

mem.mod.iterator

Memory in bytes in use by the iterator module.

mem.mod.validator

Memory in bytes in use by the validator module. Includes the key cache and negative cache.

mem.streamwait

Memory in bytes in used by the TCP and TLS stream wait buffers. These are answers waiting to be written back to the clients.

mem.http.query_buffer

Memory in bytes used by the HTTP/2 query buffers. Containing (partial) DNS queries waiting for request stream completion.

mem.http.response_buffer

Memory in bytes used by the HTTP/2 response buffers. Containing DNS responses waiting to be written back to the clients.

mem.quic

Memory in bytes used by QUIC. Containing connection information, stream information, queries read and responses written back to the clients.

histogram.<sec>.<usec>.to.<sec>.<usec>

Shows a histogram, summed over all threads. Every element counts the recursive queries whose reply time fit between the lower and upper bound. Times larger or equal to the lowerbound, and smaller than the upper bound. There are 40 buckets, with bucket sizes doubling.

num.query.type.A

The total number of queries over all threads with query type A. Printed for the other query types as well, but only for the types for which queries were received, thus =0 entries are omitted for brevity.

num.query.type.other

Number of queries with query types 256-65535.

num.query.class.IN

The total number of queries over all threads with query class IN (internet). Also printed for other classes (such as CH (CHAOS) sometimes used for debugging), or NONE, ANY, used by dynamic update. num.query.class.other is printed for classes 256-65535.

num.query.opcode.QUERY

The total number of queries over all threads with query opcode QUERY. Also printed for other opcodes, UPDATE, ...

num.query.tcp

Number of queries that were made using TCP towards the Unbound server.

num.query.tcpout

Number of queries that the Unbound server made using TCP outgoing towards other servers.

num.query.udpout

Number of queries that the Unbound server made using UDP outgoing towards other servers.

num.query.tls

Number of queries that were made using TLS towards the Unbound server. These are also counted in num.query.tcp, because TLS uses TCP.

num.query.tls.resume

Number of TLS session resumptions, these are queries over TLS towards the Unbound server where the client negotiated a TLS session resumption key.

num.query.https

Number of queries that were made using HTTPS towards the Unbound server. These are also counted in num.query.tcp and num.query.tls, because HTTPS uses TLS and TCP.

num.query.quic

Number of queries that were made using QUIC towards the Unbound server. These are also counted in num.query.tls, because TLS is used for these queries.

num.query.ipv6

Number of queries that were made using IPv6 towards the Unbound server.

num.query.flags.RD

The number of queries that had the RD flag set in the header. Also printed for flags QR, AA, TC, RA, Z, AD, CD. Note that queries with flags QR, AA or TC may have been rejected because of that.

num.query.edns.present

number of queries that had an EDNS OPT record present.

num.query.edns.DO

number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set. These queries are also included in the num.query.edns.present number.

num.query.ratelimited

The number of queries that are turned away from being send to nameserver due to ratelimiting.

num.query.dnscrypt.shared_secret.cachemiss

The number of dnscrypt queries that did not find a shared secret in the cache. This can be use to compute the shared secret hitrate.

num.query.dnscrypt.replay

The number of dnscrypt queries that found a nonce hit in the nonce cache and hence are considered a query replay.

num.answer.rcode.NXDOMAIN

The number of answers to queries, from cache or from recursion, that had the return code NXDOMAIN. Also printed for the other return codes.

num.answer.rcode.nodata

The number of answers to queries that had the pseudo return code nodata. This means the actual return code was NOERROR, but additionally, no data was carried in the answer (making what is called a NOERROR/NODATA answer). These queries are also included in the num.answer.rcode.NOERROR number. Common for AAAA lookups when an A record exists, and no AAAA.

num.answer.secure

Number of answers that were secure. The answer validated correctly. The AD bit might have been set in some of these answers, where the client signalled (with DO or AD bit in the query) that they were ready to accept the AD bit in the answer.

num.answer.bogus

Number of answers that were bogus. These answers resulted in SERVFAIL to the client because the answer failed validation.

num.rrset.bogus

The number of rrsets marked bogus by the validator. Increased for every RRset inspection that fails.

num.valops

The number of validation operations performed by the validator. Increased for every RRSIG verification operation regardless of the validation result. The RRSIG and key combination needs to first pass some sanity checks before Unbound even performs the verification, e.g., length/protocol checks.

unwanted.queries

Number of queries that were refused or dropped because they failed the access control settings.

unwanted.replies

Replies that were unwanted or unsolicited. Could have been random traffic, delayed duplicates, very late answers, or could be spoofing attempts. Some low level of late answers and delayed duplicates are to be expected with the UDP protocol. Very high values could indicate a threat (spoofing).

msg.cache.count

The number of items (DNS replies) in the message cache.

rrset.cache.count

The number of RRsets in the rrset cache. This includes rrsets used by the messages in the message cache, but also delegation information.

infra.cache.count

The number of items in the infra cache. These are IP addresses with their timing and protocol support information.

key.cache.count

The number of items in the key cache. These are DNSSEC keys, one item per delegation point, and their validation status.

msg.cache.max_collisions

The maximum number of hash table collisions in the msg cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

rrset.cache.max_collisions

The maximum number of hash table collisions in the rrset cache. This is the number of hashes that are identical when a new element is inserted in the hash table. If the value is very large, like hundreds, something is wrong with the performance of the hash table, hash values are incorrect or malicious.

dnscrypt_shared_secret.cache.count

The number of items in the shared secret cache. These are precomputed shared secrets for a given client public key/server secret key pair. Shared secrets are CPU intensive and this cache allows Unbound to avoid recomputing the shared secret when multiple dnscrypt queries are sent from the same client.

dnscrypt_nonce.cache.count

The number of items in the client nonce cache. This cache is used to prevent dnscrypt queries replay. The client nonce must be unique for each client public key/server secret key pair. This cache should be able to host QPS * replay window interval keys to prevent replay of a query during replay window seconds.

num.query.authzone.up

The number of queries answered from auth-zone data, upstream queries. These queries would otherwise have been sent (with fallback enabled) to the internet, but are now answered from the auth zone.

num.query.authzone.down

The number of queries for downstream answered from auth-zone data. These queries are from downstream clients, and have had an answer from the data in the auth zone.

num.query.aggressive.NOERROR

The number of queries answered using cached NSEC records with NODATA RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.aggressive.NXDOMAIN

The number of queries answered using cached NSEC records with NXDOMAIN RCODE. These queries would otherwise have been sent to the internet, but are now answered using cached data.

num.query.subnet

Number of queries that got an answer that contained EDNS client subnet data.

num.query.subnet_cache

Number of queries answered from the edns client subnet cache. These are counted as cachemiss by the main counters, but hit the client subnet specific cache after getting processed by the edns client subnet module.

num.query.cachedb

Number of queries answered from the external cache of cachedb. These are counted as cachemiss by the main counters, but hit the cachedb external cache after getting processed by the cachedb module.

num.rpz.action.<rpz_action>

Number of queries answered using configured RPZ policy, per RPZ action type. Possible actions are: nxdomain, nodata, passthru, drop, tcp-only, local-data, disabled, and cname-override.

## FILES
/var/lib/unbound/unbound.conf

Unbound configuration file.

/var/lib/unbound

directory with private keys (unbound_server.key and unbound_control.key) and self-signed certificates (unbound_server.pem and unbound_control.pem).

## SEE ALSO
unbound.conf(5), unbound(8).

## AUTHOR
Unbound developers are mentioned in the CREDITS file in the distribution.

## COPYRIGHT
1999-2026, NLnet Labs


unfsd

title: unfsd(8)

summary: NFS server process

text:
# unfsd(8)

## NAME
unfsd - NFS server process

## SYNOPSIS
/usr/sbin/unfsd [options]

## DESCRIPTION
The unfsd program implements the MOUNT and NFS version 3 protocols. It listens for client requests, performs them on the local filesystem of the server, and then returns the results of the operations to the clients.

At startup, unfsd reads the exports file, /etc/exports by default, to find out which directories are available to clients and what options are in effect (see EXPORTS FILE section below for syntax and possible options).

Normally, unfsd should be run as the root user. It will then switch its effective user and group id to the numbers listed in incoming NFS requests. This means filesystem operations will be performed as if done by a local user with the same ids. If the incoming request is for user or group id 0 (meaning root), unfsd will switch to the user and group id of the nobody user before performing filesystem operations (this is known as root squashing). If the user nobody does not exist on the system, a user and group id of 65534 will be used. This behavior can be modified by use of the no_root_squash and all_squash options in the exports file as well as the anonuid and anongid options on a per-share basis.

If unfsd is running as a normal unprivileged user, no switching of the effective user and group id will take place. Instead, all filesystem operations will be performed with the id of the user running unfsd.

## RESTRICTIONS
Some NFS clients may attempt to perform operations that unfsd cannot fully support.

Object Creation

When creating filesystem objects, it is only possible to specify the initial mode for the object. The initial user and group ownership, object size, and timestamps cannot be specified and will be set to default values.

File Locking

The network lock manager (NLM) protocol is not supported. This means that clients may have to mount with special mount options, disabling locking on the mounted NFS volume (nolock for Linux clients).

## OPTIONS
-h

Display a short option summary.

-e <file>

Use the given file as the exports file, instead of using /etc/exports. Note that the file needs to be specified using an absolute path.

-i <file>

Use the given file as pid file. When the daemon starts up, it will write its pid (process id) to the given file. Upon exit, the daemon will remove the file. Failure to create or remove the pid file is not considered fatal and only reported to syslog.

-u

Use an unprivileged port for NFS and MOUNT service. Normally, unfsd will use port number 2049, which is the standard port for NFS. When this option is in effect, arbitrary ports chosen by the RPC library will be used. You may need to use this option when running unfsd from a normal user account.

-n <port>

Use the specified port for the NFS service.

-m <port>

Use the specified port for the MOUNT service. The default is to use port number 2049, the same as for the NFS service. You can use the same port for both services if you want.

-t

TCP only operation. By default, unfsd provides its services to clients using either UDP or TCP as communications protocol. When this option is present, only TCP connections are serviced.

-p

Do not register with the portmapper. This will prevent other hosts from finding out the port numbers used for the MOUNT and NFS services by querying the portmap daemon. Clients will need to manually specify the port numbers to use (on Linux clients, use the mountport and port mount options).

-c

Enable cluster extensions. This feature is only available when unfsd was compiled with cluster support. When this option is enabled, so-called tagged files are handled differently from normal files, making it possible to serve different file contents to different clients for the same filename. See tags(7) for a description of tagged files. This option causes a performance hit.

-C <path>

Limit the use of cluster extensions to a list of colon-seperated directories. When this option is present, the performance hit caused by clustering extensions only applies to the listed directories and their subdirectories.

-s

Single user mode; activate basic uid translation. This option is useful when the server and client are using different user and group ids. All requests from the client will be served from the user id that started unfsd, no user id switching will take place (even if unfsd was started by root). Ownership is reported as follows: files belonging to the user id running unfsd will look as if they are owned by the client's user. Other files will look as if they are owned by root. The same principle applies to group ownership.

-b

Enable brute force file searching. Normally, when you rename a file across several directories on an NFS volume, the filehandle for that file becomes stale. When this option is enabled, unfsd will attempt a recursive search on the relevant server filesystem to find the file referenced by the filehandle. This can have a huge performance impact as this will also happen for files that were really deleted (by another NFS client) instead of moved, and cannot be found.

-l <addr>

Bind to interface with specified address. The default is to bind to all local interfaces.

-d

Debug mode. When this option is present, unfsd will not fork into the background at startup, and all messages that would normally go to the system log go to stdout instead.

-r

Report unreadable executables as readable. This applies both to returned attributes and ACCESS requests. Please note that READ requests for unreadable executables are always allowed, if unfsd is running as root, regardless of this option.

-T

Test exports file and exit. When this option is given, unfsd will try to parse the exports file and exit with status 0 if this is successful. If there is a syntax error in the exports file, a message is printed on standard error and unfsd exits with status 1.

## SIGNALS
SIGTERM and SIGINT

will cause unfsd to unregister itself from the portmapper and exit.

SIGHUP

will cause unfsd to re-read its configuration data. Currently, this means the program will query the passwd database to find out the user and group id of user nobody. unfsd will also attempt to reload the exports file. If the exports file contains errors, unfsd sends a warning message to the system log and nothing is exported until the situation is corrected and another SIGHUP is sent.

SIGUSR1

will cause unfsd to output statistics about its filehandle and file descriptor cache to the system log. For the filehandle cache, it will output the number of filehandles in the cache, the total number of cache accesses, and the number of hits and misses. For the file descriptor cache, it will output the number of currently held open READ and WRITE file descriptors.

## EXPORTS FILE
The exports file, /etc/exports by default, determines which directories on the server can be accessed from NFS clients. An example:

```
# sample NFS exports file
/home            trusted(rw,no_root_squash) (ro)
"/with spaces"   weirdo
/usr             1.2.3.4(rw) 192.168.2.0/24(ro,all_squash)
/home/foo        bar(rw) 10.0.0.0/255.0.0.0(root_squash)
/home/joe        joes_pc(anonuid=1100,anongid=1100,rw,all_squash)
```

Comments start with a # character and cause the rest of the line to be ignored. Extremely long exports can be split across multiple lines by escaping the intermediate newlines with a backslash character.

Each line starts with a directory that is to be exported. If the directory name contains whitespace, it must be enclosed in double quotes. To the right of the directory name, a list of client specifications can be given. If this list is missing, the directory is exported to everyone, using default options (ro and root_squash).

If the directory name contains symbolic links, they are expanded. This means that you have to force unfsd to reload the exports file if the symlinks happen to change.

Clients can be specified using either a hostname, an IP address, or an IP network. Networks can be given by specifying the number of leading 1 bits in the netmask or by giving the full netmask. If the hostname is empty, the directory is exported to everyone.

Options can follow a client specification and have to be enclosed in parenthesis, with the opening paren directly following the client name or address. If no options are given, ro and root_squash are enabled by default. The following options are supported by unfsd:

root_squash

Enable root squashing, mapping all NFS request done with a user id of 0 to the user id of the nobody user. This option is enabled by default.

no_root_squash

Disable root squashing. When this option is present, NFS requests done with a user id of 0 will be done as the root user of the server, effectively disabling all permissions checks.

all_squash

Squash all users. When this option is present, all NFS requests will be done as the nobody user of the server.

no_all_squash

Don't squash all users. This option is enabled by default.

rw

Allow read and write access on the exported directory. When this option is present, clients are allowed to modify files and directories on the server.

ro

Allow only read access on the exported directory. When this option is present, clients are not allowed to modify files and directories on the server. This option is enabled by default.

anonuid/anongid

Sets the uid and gid for anonymous mounts for this share - by default the uid for nobody will be used, but using these options you can change this on a per-share basis.

secure

Allow only mount requests coming from a source port below 1024. Using these ports requires super-user privileges on many operating systems. This option is enabled by default.

insecure

Allow mount requests coming from any source port.

removable

Consider this directory to be on a removable medium. When this option is present, unfsd will not keep files open across multiple read or write requests. This allows unmounting of the underlying filesystem on the server at any time. Also, unfsd will not require that the exported path exists at startup or mount time. If the path does not exist, an empty directory will be presented to the client. This is useful for exporting mount points handled by autofs.

fixed

Consider this directory to be on a fixed medium. This options is enabled by default and allows unfsd to keep files open between multiple read or write requests.

password=<password>

To be able to mount this export, the specified password is required. The password needs be given in the mount request, as in "mount yourhost:@password:gazonk/tmp /mnt". One time passwords are also supported. When using passwords, the file handles will include a hash of the password. This means that if you change the password, all clients will need to remount this export. See the file "doc/passwords.txt" in the source for more information.

If options not present on this list are encountered by unfsd, they are silently ignored.

## BUGS
There are a few possible race conditions with other processes on the server. They can happen if unfsd is performing an operation on a filesystem object while another process is simultaneously first (a) removing the object and then (b) creating a new object of the same name. If this happens, unfsd will attempt to perform the operation on the wrong, new object. The time window in which this can happen is small.

When a client does a CREATE EXCLUSIVE procedure call, unfsd stores the verifier data in the mtime and atime attributes of the created file. Malicious processes on the server could manipulate those attributes, breaking the semantics of the exclusive create operation. A process attempting to do so would need to be able to see the NFS network traffic.

unfsd always uses the "nohide" semantics, which means that clients will see all file systems mounted below the exported path. However, some NFS clients do not cope well with this situation as, for instance, it is then possible for two files in the one apparent filesystem to have the same inode number. To avoid this, make sure that the client mounts each exported file system.

Due to the way unfsd operates, it needs execute (lookup) and read permission on all directories from the root directory all the way up to exported directories. For example, if /usr/share is exported, unfsd is going to need permission for /, /usr, and /usr/share. Since root squashing can be in effect, unfsd may run as the nobody user, which normally means having to grant execute (lookup) and read permission for everybody on the server. In the above example, unfsd also needs permission to access /usr/share/.., which can be different from /usr for some special setups (for example when using bind mounts under Linux).

## FILES
/etc/exports

Default exports file.

## AUTHOR
Pascal Schmidt

## SEE ALSO
tags(7)


uni

package: uniconf-tools

title: uni(8)

text:
# uni(8)

## NAME
uni - a program to interface with the UniConf configuration system

## SYNOPSIS
uni get KEY [DEFAULT]

uni set KEY [VALUE]

uni xset KEY [VALUE]

uni keys KEY

uni hkeys KEY

uni xkeys KEY

uni dump KEY

uni hdump KEY

uni xdump KEY

## DESCRIPTION
UniConf is the One True Configuration system that includes all the others because it has plugin backends and frontends. Or, less grandiosely, it's a lightweight, distributed, cacheable tree of strings.

uni is used to interface directly with the UniConf system. It's primary use is for diagnostic purposes, but it can be used to add UniConf support to shell scripts.

## ENVIRONMENT VARIABLE
UNICONF

Before using uni, you must tell it which UniConf moinker you wish to query by setting this environment variable.

Monikers are used to contact UniConf back-ends, be they a uniconfd server, or a local file. For example, they could be:

• a filename (ini:/var/lib/app/config.ini),

• or a network address, (tcp:open.nit.ca:4111).

## COMMANDS
get

Retreive the VALUE associated with the provided KEY within the UniConf database. If a DEFAULT is provided, this will be returned if the KEY has no associated VALUE.

set

Assign the provided VALUE the the provided KEY. UniConf provides no guarentee that the entry committed throughout the database. The next “get” command for this KEY may not return the most recently “set” value due to caching, or the existance of a read-only generator.

xset

Assign, to the provided KEY, the contents of the standard-input stream. Use this command to pipe information into the UniConf database.

keys

List all the sub-keys contained within the provided KEY.

hkeys

List all the sub-keys, recursively, contained within the provided KEY. Since any KEY may contain sub-keys, UniConf provides no guarentee that there are no circular references.

xkeys

List all the sub-keys contained within the provided KEY, which can contain wildcards. See the WILDCARDS section.

dump

List all the sub-keys and their values, contained within the provided KEY.

hdump

List all the sub-keys and their values, recursively, contained within the provided KEY.

xdump

List all the sub-keys and their values, contained within the provided KEY, which can contain wildcards.

## WILDCARDS
A KEY looks just like a normal slash-delimited path. The root of the UniConf tree has a KEY named “/”. Sub-keys can be accessed by names such as “/software/myapp/version”.

With wildcards, you can access more than one key at a time.

*

To access a sub-key within any one level of keys, use the asterix like so: “/software/*/version”. This retrieves all keys of “version” that are one level beneath “/software”.

...

To access a sub-key anywhere beneath a key, use the ellipsis like so: “/.../version”. This retrieves all keys of “version” that are zero or more levels beneath the root (i.e. any appearance of “version” within the database.

## SEE ALSO
uniconfd(8)

## AUTHORS
This software was written by the hackers at Net Integration Technologies. Contact us at <wvstreams-dev@lists.nit.ca>


uniconfd

package: uniconfd

title: uniconfd(8)

text:
# uniconfd(8)

## NAME
uniconfd - a daemon program for the UniConf configuration system

## SYNOPSIS
uniconfd [ OPTIONS ] MOUNT ...

## DESCRIPTION
UniConf is the One True Configuration system that includes all the others because it has plugin backends and frontends. Or, less grandiosely, it's a lightweight, distributed, cacheable tree of strings.

It supports:

- retrieving, storing, and enumerating key/value pairs (where both keys and values are strings).

- multiple backends where the actual key/value pairs are stored.

- multiple frontends for tying it to other configuration architectures.

It operates locally, and across a network, allowing you to tie multiple different applications together for distributed computing. Also, it provides notifications in the form of callbacks, so your application can be notified if a configuration key has changed.

uniconfd is necessary when you have more than one application, or multiple instances of an application, sharing one configuration. UniConf-enabled applications contact uniconfd which provides notifications when any of their watched keys change.

You tell uniconfd which UniConf MOUNT you want it to manage. See the MOUNTS section for more information.

## OPTIONS
-f

Run in the foreground. Do not fork into a separate daemon process.

-d, -dd

Print debugging messages to the console. The second d increases the verbosity of the messages.

-V

Print the version number and exit.

-a

Require authentication on incoming connections.

-A

Check all accesses against a perms moniker.

-p port

Listen on a given TCP port. The default is 4111. If port is 0, then listening on TCP is disabled.

-s port

Listen on a given TCP port wrapped in SSL. The default is 4112. If port is 0, then listening on SSL-over-TCP is disabled.

-u filename

Listen on a given Unix socket filename. This is disabled by default.

## MOUNTS
Mounts are UniConf path monikers which are in the form:

/SUBTREE=GENERATORS:PATH

SUBTREE

This is the tree to manage. All trees are descended from the root tree, indicated by a bare slash (/).

GENERATORS

These are the generators used to read and write key/value pairs. You can chain them with colons. For example, the generator chain: cache:retry:ini will cache the configuration for speed, retry persistently if the data source disappears, and store the data in an INI-formatted file.

PATH

This is the location where the data is stored. It is dependent on which GENERATORS were specified. For instance, it could be: • a filename (ini:/var/lib/app/config.ini),

• a network address, (tcp:open.nit.ca:4111),

• or even an empty string (tmp:).

Examples:

/=tmp:

/ca/nit=ssl:open.nit.ca

/ca/nit/uniconfd=ini:/var/lib/uniconfd/uniconfd.ini

/apps=cache:retry:unix:/var/lib/apps/socket

## FILES
/etc/uniconfd.conf

/var/lib/uniconf/uniconfd.ini

/var/lib/uniconf/uniconf.ini

## AUTHORS
This software was written by the hackers at Net Integration Technologies. Contact us at <wvstreams-dev@lists.nit.ca>