1unbound.conf(5) unbound 1.7.3 unbound.conf(5)
2
3
4
6 unbound.conf - Unbound configuration file.
7
9 unbound.conf
10
12 unbound.conf is used to configure unbound(8). The file format has
13 attributes and values. Some attributes have attributes inside them.
14 The notation is: attribute: value.
15
16 Comments start with # and last to the end of line. Empty lines are
17 ignored as is whitespace at the beginning of a line.
18
19 The utility unbound-checkconf(8) can be used to check unbound.conf
20 prior to usage.
21
23 An example config file is shown below. Copy this to
24 /etc/unbound/unbound.conf and start the server with:
25
26 $ unbound -c /etc/unbound/unbound.conf
27
28 Most settings are the defaults. Stop the server with:
29
30 $ kill `cat /etc/unbound/unbound.pid`
31
32 Below is a minimal config file. The source distribution contains an
33 extensive example.conf file with all the options.
34
35 # unbound.conf(5) config file for unbound(8).
36 server:
37 directory: "/etc/unbound"
38 username: unbound
39 # make sure unbound can access entropy from inside the chroot.
40 # e.g. on linux the use these commands (on BSD, devfs(8) is used):
41 # mount --bind -n /dev/random /etc/unbound/dev/random
42 # and mount --bind -n /dev/log /etc/unbound/dev/log
43 chroot: "/etc/unbound"
44 # logfile: "/etc/unbound/unbound.log" #uncomment to use logfile.
45 pidfile: "/etc/unbound/unbound.pid"
46 # verbosity: 1 # uncomment and increase to get more logging.
47 # listen on all interfaces, answer queries from the local subnet.
48 interface: 0.0.0.0
49 interface: ::0
50 access-control: 10.0.0.0/8 allow
51 access-control: 2001:DB8::/64 allow
52
54 There must be whitespace between keywords. Attribute keywords end with
55 a colon ':'. An attribute is followed by its containing attributes, or
56 a value.
57
58 Files can be included using the include: directive. It can appear any‐
59 where, it accepts a single file name as argument. Processing continues
60 as if the text from the included file was copied into the config file
61 at that point. If also using chroot, using full path names for the
62 included files works, relative pathnames for the included names work if
63 the directory where the daemon is started equals its chroot/working
64 directory or is specified before the include statement with directory:
65 dir. Wildcards can be used to include multiple files, see glob(7).
66
67 Server Options
68 These options are part of the server: clause.
69
70 verbosity: <number>
71 The verbosity number, level 0 means no verbosity, only errors.
72 Level 1 gives operational information. Level 2 gives detailed
73 operational information. Level 3 gives query level information,
74 output per query. Level 4 gives algorithm level information.
75 Level 5 logs client identification for cache misses. Default is
76 level 1. The verbosity can also be increased from the command‐
77 line, see unbound(8).
78
79 statistics-interval: <seconds>
80 The number of seconds between printing statistics to the log for
81 every thread. Disable with value 0 or "". Default is disabled.
82 The histogram statistics are only printed if replies were sent
83 during the statistics interval, requestlist statistics are
84 printed for every interval (but can be 0). This is because the
85 median calculation requires data to be present.
86
87 statistics-cumulative: <yes or no>
88 If enabled, statistics are cumulative since starting unbound,
89 without clearing the statistics counters after logging the sta‐
90 tistics. Default is no.
91
92 extended-statistics: <yes or no>
93 If enabled, extended statistics are printed from unbound-con‐
94 trol(8). Default is off, because keeping track of more statis‐
95 tics takes time. The counters are listed in unbound-control(8).
96
97 num-threads: <number>
98 The number of threads to create to serve clients. Use 1 for no
99 threading.
100
101 port: <port number>
102 The port number, default 53, on which the server responds to
103 queries.
104
105 interface: <ip address[@port]>
106 Interface to use to connect to the network. This interface is
107 listened to for queries from clients, and answers to clients are
108 given from it. Can be given multiple times to work on several
109 interfaces. If none are given the default is to listen to local‐
110 host. The interfaces are not changed on a reload (kill -HUP)
111 but only on restart. A port number can be specified with @port
112 (without spaces between interface and port number), if not spec‐
113 ified the default port (from port) is used.
114
115 ip-address: <ip address[@port]>
116 Same as interface: (for easy of compatibility with nsd.conf).
117
118 interface-automatic: <yes or no>
119 Detect source interface on UDP queries and copy them to replies.
120 This feature is experimental, and needs support in your OS for
121 particular socket options. Default value is no.
122
123 outgoing-interface: <ip address or ip6 netblock>
124 Interface to use to connect to the network. This interface is
125 used to send queries to authoritative servers and receive their
126 replies. Can be given multiple times to work on several inter‐
127 faces. If none are given the default (all) is used. You can
128 specify the same interfaces in interface: and outgoing-inter‐
129 face: lines, the interfaces are then used for both purposes.
130 Outgoing queries are sent via a random outgoing interface to
131 counter spoofing.
132
133 If an IPv6 netblock is specified instead of an individual IPv6
134 address, outgoing UDP queries will use a randomised source
135 address taken from the netblock to counter spoofing. Requires
136 the IPv6 netblock to be routed to the host running unbound, and
137 requires OS support for unprivileged non-local binds (currently
138 only supported on Linux). Several netblocks may be specified
139 with multiple outgoing-interface: options, but do not specify
140 both an individual IPv6 address and an IPv6 netblock, or the
141 randomisation will be compromised. Consider combining with pre‐
142 fer-ip6: yes to increase the likelihood of IPv6 nameservers
143 being selected for queries. On Linux you need these two com‐
144 mands to be able to use the freebind socket option to receive
145 traffic for the ip6 netblock: ip -6 addr add mynetblock/64 dev
146 lo && ip -6 route add local mynetblock/64 dev lo
147
148 outgoing-range: <number>
149 Number of ports to open. This number of file descriptors can be
150 opened per thread. Must be at least 1. Default depends on com‐
151 pile options. Larger numbers need extra resources from the oper‐
152 ating system. For performance a very large value is best, use
153 libevent to make this possible.
154
155 outgoing-port-permit: <port number or range>
156 Permit unbound to open this port or range of ports for use to
157 send queries. A larger number of permitted outgoing ports
158 increases resilience against spoofing attempts. Make sure these
159 ports are not needed by other daemons. By default only ports
160 above 1024 that have not been assigned by IANA are used. Give a
161 port number or a range of the form "low-high", without spaces.
162
163 The outgoing-port-permit and outgoing-port-avoid statements are
164 processed in the line order of the config file, adding the per‐
165 mitted ports and subtracting the avoided ports from the set of
166 allowed ports. The processing starts with the non IANA allo‐
167 cated ports above 1024 in the set of allowed ports.
168
169 outgoing-port-avoid: <port number or range>
170 Do not permit unbound to open this port or range of ports for
171 use to send queries. Use this to make sure unbound does not grab
172 a port that another daemon needs. The port is avoided on all
173 outgoing interfaces, both IP4 and IP6. By default only ports
174 above 1024 that have not been assigned by IANA are used. Give a
175 port number or a range of the form "low-high", without spaces.
176
177 outgoing-num-tcp: <number>
178 Number of outgoing TCP buffers to allocate per thread. Default
179 is 10. If set to 0, or if do-tcp is "no", no TCP queries to
180 authoritative servers are done. For larger installations
181 increasing this value is a good idea.
182
183 incoming-num-tcp: <number>
184 Number of incoming TCP buffers to allocate per thread. Default
185 is 10. If set to 0, or if do-tcp is "no", no TCP queries from
186 clients are accepted. For larger installations increasing this
187 value is a good idea.
188
189 edns-buffer-size: <number>
190 Number of bytes size to advertise as the EDNS reassembly buffer
191 size. This is the value put into datagrams over UDP towards
192 peers. The actual buffer size is determined by msg-buffer-size
193 (both for TCP and UDP). Do not set higher than that value.
194 Default is 4096 which is RFC recommended. If you have fragmen‐
195 tation reassembly problems, usually seen as timeouts, then a
196 value of 1472 can fix it. Setting to 512 bypasses even the most
197 stringent path MTU problems, but is seen as extreme, since the
198 amount of TCP fallback generated is excessive (probably also for
199 this resolver, consider tuning the outgoing tcp number).
200
201 max-udp-size: <number>
202 Maximum UDP response size (not applied to TCP response). 65536
203 disables the udp response size maximum, and uses the choice from
204 the client, always. Suggested values are 512 to 4096. Default
205 is 4096.
206
207 msg-buffer-size: <number>
208 Number of bytes size of the message buffers. Default is 65552
209 bytes, enough for 64 Kb packets, the maximum DNS message size.
210 No message larger than this can be sent or received. Can be
211 reduced to use less memory, but some requests for DNS data, such
212 as for huge resource records, will result in a SERVFAIL reply to
213 the client.
214
215 msg-cache-size: <number>
216 Number of bytes size of the message cache. Default is 4
217 megabytes. A plain number is in bytes, append 'k', 'm' or 'g'
218 for kilobytes, megabytes or gigabytes (1024*1024 bytes in a
219 megabyte).
220
221 msg-cache-slabs: <number>
222 Number of slabs in the message cache. Slabs reduce lock con‐
223 tention by threads. Must be set to a power of 2. Setting
224 (close) to the number of cpus is a reasonable guess.
225
226 num-queries-per-thread: <number>
227 The number of queries that every thread will service simultane‐
228 ously. If more queries arrive that need servicing, and no
229 queries can be jostled out (see jostle-timeout), then the
230 queries are dropped. This forces the client to resend after a
231 timeout; allowing the server time to work on the existing
232 queries. Default depends on compile options, 512 or 1024.
233
234 jostle-timeout: <msec>
235 Timeout used when the server is very busy. Set to a value that
236 usually results in one roundtrip to the authority servers. If
237 too many queries arrive, then 50% of the queries are allowed to
238 run to completion, and the other 50% are replaced with the new
239 incoming query if they have already spent more than their
240 allowed time. This protects against denial of service by slow
241 queries or high query rates. Default 200 milliseconds. The
242 effect is that the qps for long-lasting queries is about (num‐
243 queriesperthread / 2) / (average time for such long queries)
244 qps. The qps for short queries can be about (numqueries‐
245 perthread / 2) / (jostletimeout in whole seconds) qps per
246 thread, about (1024/2)*5 = 2560 qps by default.
247
248 delay-close: <msec>
249 Extra delay for timeouted UDP ports before they are closed, in
250 msec. Default is 0, and that disables it. This prevents very
251 delayed answer packets from the upstream (recursive) servers
252 from bouncing against closed ports and setting off all sort of
253 close-port counters, with eg. 1500 msec. When timeouts happen
254 you need extra sockets, it checks the ID and remote IP of pack‐
255 ets, and unwanted packets are added to the unwanted packet
256 counter.
257
258 so-rcvbuf: <number>
259 If not 0, then set the SO_RCVBUF socket option to get more buf‐
260 fer space on UDP port 53 incoming queries. So that short spikes
261 on busy servers do not drop packets (see counter in netstat
262 -su). Default is 0 (use system value). Otherwise, the number
263 of bytes to ask for, try "4m" on a busy server. The OS caps it
264 at a maximum, on linux unbound needs root permission to bypass
265 the limit, or the admin can use sysctl net.core.rmem_max. On
266 BSD change kern.ipc.maxsockbuf in /etc/sysctl.conf. On OpenBSD
267 change header and recompile kernel. On Solaris ndd -set /dev/udp
268 udp_max_buf 8388608.
269
270 so-sndbuf: <number>
271 If not 0, then set the SO_SNDBUF socket option to get more buf‐
272 fer space on UDP port 53 outgoing queries. This for very busy
273 servers handles spikes in answer traffic, otherwise 'send:
274 resource temporarily unavailable' can get logged, the buffer
275 overrun is also visible by netstat -su. Default is 0 (use sys‐
276 tem value). Specify the number of bytes to ask for, try "4m" on
277 a very busy server. The OS caps it at a maximum, on linux
278 unbound needs root permission to bypass the limit, or the admin
279 can use sysctl net.core.wmem_max. On BSD, Solaris changes are
280 similar to so-rcvbuf.
281
282 so-reuseport: <yes or no>
283 If yes, then open dedicated listening sockets for incoming
284 queries for each thread and try to set the SO_REUSEPORT socket
285 option on each socket. May distribute incoming queries to
286 threads more evenly. Default is no. On Linux it is supported
287 in kernels >= 3.9. On other systems, FreeBSD, OSX it may also
288 work. You can enable it (on any platform and kernel), it then
289 attempts to open the port and passes the option if it was avail‐
290 able at compile time, if that works it is used, if it fails, it
291 continues silently (unless verbosity 3) without the option.
292
293 ip-transparent: <yes or no>
294 If yes, then use IP_TRANSPARENT socket option on sockets where
295 unbound is listening for incoming traffic. Default no. Allows
296 you to bind to non-local interfaces. For example for non-exis‐
297 tent IP addresses that are going to exist later on, with host
298 failover configuration. This is a lot like interface-automatic,
299 but that one services all interfaces and with this option you
300 can select which (future) interfaces unbound provides service
301 on. This option needs unbound to be started with root permis‐
302 sions on some systems. The option uses IP_BINDANY on FreeBSD
303 systems and SO_BINDANY on OpenBSD systems.
304
305 ip-freebind: <yes or no>
306 If yes, then use IP_FREEBIND socket option on sockets where
307 unbound is listening to incoming traffic. Default no. Allows
308 you to bind to IP addresses that are nonlocal or do not exist,
309 like when the network interface or IP address is down. Exists
310 only on Linux, where the similar ip-transparent option is also
311 available.
312
313 rrset-cache-size: <number>
314 Number of bytes size of the RRset cache. Default is 4 megabytes.
315 A plain number is in bytes, append 'k', 'm' or 'g' for kilo‐
316 bytes, megabytes or gigabytes (1024*1024 bytes in a megabyte).
317
318 rrset-cache-slabs: <number>
319 Number of slabs in the RRset cache. Slabs reduce lock contention
320 by threads. Must be set to a power of 2.
321
322 cache-max-ttl: <seconds>
323 Time to live maximum for RRsets and messages in the cache.
324 Default is 86400 seconds (1 day). If the maximum kicks in,
325 responses to clients still get decrementing TTLs based on the
326 original (larger) values. When the internal TTL expires, the
327 cache item has expired. Can be set lower to force the resolver
328 to query for data often, and not trust (very large) TTL values.
329
330 cache-min-ttl: <seconds>
331 Time to live minimum for RRsets and messages in the cache.
332 Default is 0. If the minimum kicks in, the data is cached for
333 longer than the domain owner intended, and thus less queries are
334 made to look up the data. Zero makes sure the data in the cache
335 is as the domain owner intended, higher values, especially more
336 than an hour or so, can lead to trouble as the data in the cache
337 does not match up with the actual data any more.
338
339 cache-max-negative-ttl: <seconds>
340 Time to live maximum for negative responses, these have a SOA in
341 the authority section that is limited in time. Default is 3600.
342 This applies to nxdomain and nodata answers.
343
344 infra-host-ttl: <seconds>
345 Time to live for entries in the host cache. The host cache con‐
346 tains roundtrip timing, lameness and EDNS support information.
347 Default is 900.
348
349 infra-cache-slabs: <number>
350 Number of slabs in the infrastructure cache. Slabs reduce lock
351 contention by threads. Must be set to a power of 2.
352
353 infra-cache-numhosts: <number>
354 Number of hosts for which information is cached. Default is
355 10000.
356
357 infra-cache-min-rtt: <msec>
358 Lower limit for dynamic retransmit timeout calculation in infra‐
359 structure cache. Default is 50 milliseconds. Increase this value
360 if using forwarders needing more time to do recursive name reso‐
361 lution.
362
363 define-tag: <"list of tags">
364 Define the tags that can be used with local-zone and access-con‐
365 trol. Enclose the list between quotes ("") and put spaces
366 between tags.
367
368 do-ip4: <yes or no>
369 Enable or disable whether ip4 queries are answered or issued.
370 Default is yes.
371
372 do-ip6: <yes or no>
373 Enable or disable whether ip6 queries are answered or issued.
374 Default is yes. If disabled, queries are not answered on IPv6,
375 and queries are not sent on IPv6 to the internet nameservers.
376 With this option you can disable the ipv6 transport for sending
377 DNS traffic, it does not impact the contents of the DNS traffic,
378 which may have ip4 and ip6 addresses in it.
379
380 prefer-ip6: <yes or no>
381 If enabled, prefer IPv6 transport for sending DNS queries to
382 internet nameservers. Default is no.
383
384 do-udp: <yes or no>
385 Enable or disable whether UDP queries are answered or issued.
386 Default is yes.
387
388 do-tcp: <yes or no>
389 Enable or disable whether TCP queries are answered or issued.
390 Default is yes.
391
392 tcp-mss: <number>
393 Maximum segment size (MSS) of TCP socket on which the server
394 responds to queries. Value lower than common MSS on Ethernet
395 (1220 for example) will address path MTU problem. Note that not
396 all platform supports socket option to set MSS (TCP_MAXSEG).
397 Default is system default MSS determined by interface MTU and
398 negotiation between server and client.
399
400 outgoing-tcp-mss: <number>
401 Maximum segment size (MSS) of TCP socket for outgoing queries
402 (from Unbound to other servers). Value lower than common MSS on
403 Ethernet (1220 for example) will address path MTU problem. Note
404 that not all platform supports socket option to set MSS
405 (TCP_MAXSEG). Default is system default MSS determined by
406 interface MTU and negotiation between Unbound and other servers.
407
408 tcp-upstream: <yes or no>
409 Enable or disable whether the upstream queries use TCP only for
410 transport. Default is no. Useful in tunneling scenarios.
411
412 udp-upstream-without-downstream: <yes or no>
413 Enable udp upstream even if do-udp is no. Default is no, and
414 this does not change anything. Useful for TLS service
415 providers, that want no udp downstream but use udp to fetch data
416 upstream.
417
418 tls-upstream: <yes or no>
419 Enabled or disable whether the upstream queries use TLS only for
420 transport. Default is no. Useful in tunneling scenarios. The
421 TLS contains plain DNS in TCP wireformat. The other server must
422 support this (see tls-service-key). If you enable this, also
423 configure a tls-cert-bundle or use tls-winload CA certs, other‐
424 wise the connections cannot be authenticated.
425
426 ssl-upstream: <yes or no>
427 Alternate syntax for tls-upstream. If both are present in the
428 config file the last is used.
429
430 tls-service-key: <file>
431 If enabled, the server provider TLS service on its TCP sockets.
432 The clients have to use tls-upstream: yes. The file is the pri‐
433 vate key for the TLS session. The public certificate is in the
434 tls-service-pem file. Default is "", turned off. Requires a
435 restart (a reload is not enough) if changed, because the private
436 key is read while root permissions are held and before chroot
437 (if any). Normal DNS TCP service is not provided and gives
438 errors, this service is best run with a different port: config
439 or @port suffixes in the interface config.
440
441 ssl-service-key: <file>
442 Alternate syntax for tls-service-key.
443
444 tls-service-pem: <file>
445 The public key certificate pem file for the tls service.
446 Default is "", turned off.
447
448 ssl-service-pem: <file>
449 Alternate syntax for tls-service-pem.
450
451 tls-port: <number>
452 The port number on which to provide TCP TLS service, default
453 853, only interfaces configured with that port number as @number
454 get the TLS service.
455
456 ssl-port: <number>
457 Alternate syntax for tls-port.
458
459 tls-cert-bundle: <file>
460 If null or "", no file is used. Set it to the certificate bun‐
461 dle file, for example "/etc/pki/tls/certs/ca-bundle.crt". These
462 certificates are used for authenticating connections made to
463 outside peers. For example auth-zone urls, and also DNS over
464 TLS connections.
465
466 ssl-cert-bundle: <file>
467 Alternate syntax for tls-cert-bundle.
468
469 tls-win-cert: <yes or no>
470 Add the system certificates to the cert bundle certificates for
471 authentication. If no cert bundle, it uses only these certifi‐
472 cates. Default is no. On windows this option uses the certifi‐
473 cates from the cert store. Use the tls-cert-bundle option on
474 other systems.
475
476 tls-additional-port: <portnr>
477 List portnumbers as tls-additional-port, and when interfaces are
478 defined, eg. with the @port suffix, as this port number, they
479 provide dns over TLS service. Can list multiple, each on a new
480 statement.
481
482 use-systemd: <yes or no>
483 Enable or disable systemd socket activation. Default is no.
484
485 do-daemonize: <yes or no>
486 Enable or disable whether the unbound server forks into the
487 background as a daemon. Set the value to no when unbound runs
488 as systemd service. Default is yes.
489
490 access-control: <IP netblock> <action>
491 The netblock is given as an IP4 or IP6 address with /size
492 appended for a classless network block. The action can be deny,
493 refuse, allow, allow_setrd, allow_snoop, deny_non_local or
494 refuse_non_local. The most specific netblock match is used, if
495 none match deny is used.
496
497 The action deny stops queries from hosts from that netblock.
498
499 The action refuse stops queries too, but sends a DNS rcode
500 REFUSED error message back.
501
502 The action allow gives access to clients from that netblock. It
503 gives only access for recursion clients (which is what almost
504 all clients need). Nonrecursive queries are refused.
505
506 The allow action does allow nonrecursive queries to access the
507 local-data that is configured. The reason is that this does not
508 involve the unbound server recursive lookup algorithm, and
509 static data is served in the reply. This supports normal opera‐
510 tions where nonrecursive queries are made for the authoritative
511 data. For nonrecursive queries any replies from the dynamic
512 cache are refused.
513
514 The allow_setrd action ignores the recursion desired (RD) bit
515 and treats all requests as if the recursion desired bit is set.
516 Note that this behavior violates RFC 1034 which states that a
517 name server should never perform recursive service unless asked
518 via the RD bit since this interferes with trouble shooting of
519 name servers and their databases. This prohibited behavior may
520 be useful if another DNS server must forward requests for spe‐
521 cific zones to a resolver DNS server, but only supports stub
522 domains and sends queries to the resolver DNS server with the RD
523 bit cleared.
524
525 The action allow_snoop gives nonrecursive access too. This give
526 both recursive and non recursive access. The name allow_snoop
527 refers to cache snooping, a technique to use nonrecursive
528 queries to examine the cache contents (for malicious acts).
529 However, nonrecursive queries can also be a valuable debugging
530 tool (when you want to examine the cache contents). In that case
531 use allow_snoop for your administration host.
532
533 By default only localhost is allowed, the rest is refused. The
534 default is refused, because that is protocol-friendly. The DNS
535 protocol is not designed to handle dropped packets due to pol‐
536 icy, and dropping may result in (possibly excessive) retried
537 queries.
538
539 The deny_non_local and refuse_non_local settings are for hosts
540 that are only allowed to query for the authoritative local-data,
541 they are not allowed full recursion but only the static data.
542 With deny_non_local, messages that are disallowed are dropped,
543 with refuse_non_local they receive error code REFUSED.
544
545 access-control-tag: <IP netblock> <"list of tags">
546 Assign tags to access-control elements. Clients using this
547 access control element use localzones that are tagged with one
548 of these tags. Tags must be defined in define-tags. Enclose
549 list of tags in quotes ("") and put spaces between tags. If
550 access-control-tag is configured for a netblock that does not
551 have an access-control, an access-control element with action
552 allow is configured for this netblock.
553
554 access-control-tag-action: <IP netblock> <tag> <action>
555 Set action for particular tag for given access control element.
556 If you have multiple tag values, the tag used to lookup the
557 action is the first tag match between access-control-tag and
558 local-zone-tag where "first" comes from the order of the define-
559 tag values.
560
561 access-control-tag-data: <IP netblock> <tag> <"resource record string">
562 Set redirect data for particular tag for given access control
563 element.
564
565 access-control-view: <IP netblock> <view name>
566 Set view for given access control element.
567
568 chroot: <directory>
569 If chroot is enabled, you should pass the configfile (from the
570 commandline) as a full path from the original root. After the
571 chroot has been performed the now defunct portion of the config
572 file path is removed to be able to reread the config after a
573 reload.
574
575 All other file paths (working dir, logfile, roothints, and key
576 files) can be specified in several ways: as an absolute path
577 relative to the new root, as a relative path to the working
578 directory, or as an absolute path relative to the original root.
579 In the last case the path is adjusted to remove the unused por‐
580 tion.
581
582 The pidfile can be either a relative path to the working direc‐
583 tory, or an absolute path relative to the original root. It is
584 written just prior to chroot and dropping permissions. This
585 allows the pidfile to be /var/run/unbound.pid and the chroot to
586 be /var/unbound, for example.
587
588 Additionally, unbound may need to access /dev/random (for
589 entropy) from inside the chroot.
590
591 If given a chroot is done to the given directory. The default is
592 "/etc/unbound". If you give "" no chroot is performed.
593
594 username: <name>
595 If given, after binding the port the user privileges are
596 dropped. Default is "unbound". If you give username: "" no user
597 change is performed.
598
599 If this user is not capable of binding the port, reloads (by
600 signal HUP) will still retain the opened ports. If you change
601 the port number in the config file, and that new port number
602 requires privileges, then a reload will fail; a restart is
603 needed.
604
605 directory: <directory>
606 Sets the working directory for the program. Default is
607 "/etc/unbound". On Windows the string "%EXECUTABLE%" tries to
608 change to the directory that unbound.exe resides in. If you
609 give a server: directory: dir before include: file statements
610 then those includes can be relative to the working directory.
611
612 logfile: <filename>
613 If "" is given, logging goes to stderr, or nowhere once daemo‐
614 nized. The logfile is appended to, in the following format:
615 [seconds since 1970] unbound[pid:tid]: type: message.
616 If this option is given, the use-syslog is option is set to
617 "no". The logfile is reopened (for append) when the config file
618 is reread, on SIGHUP.
619
620 use-syslog: <yes or no>
621 Sets unbound to send log messages to the syslogd, using sys‐
622 log(3). The log facility LOG_DAEMON is used, with identity
623 "unbound". The logfile setting is overridden when use-syslog is
624 turned on. The default is to log to syslog.
625
626 log-identity: <string>
627 If "" is given (default), then the name of the executable, usu‐
628 ally "unbound" is used to report to the log. Enter a string to
629 override it with that, which is useful on systems that run more
630 than one instance of unbound, with different configurations, so
631 that the logs can be easily distinguished against.
632
633 log-time-ascii: <yes or no>
634 Sets logfile lines to use a timestamp in UTC ascii. Default is
635 no, which prints the seconds since 1970 in brackets. No effect
636 if using syslog, in that case syslog formats the timestamp
637 printed into the log files.
638
639 log-queries: <yes or no>
640 Prints one line per query to the log, with the log timestamp and
641 IP address, name, type and class. Default is no. Note that it
642 takes time to print these lines which makes the server (signifi‐
643 cantly) slower. Odd (nonprintable) characters in names are
644 printed as '?'.
645
646 log-replies: <yes or no>
647 Prints one line per reply to the log, with the log timestamp and
648 IP address, name, type, class, return code, time to resolve,
649 from cache and response size. Default is no. Note that it
650 takes time to print these lines which makes the server (signifi‐
651 cantly) slower. Odd (nonprintable) characters in names are
652 printed as '?'.
653
654 pidfile: <filename>
655 The process id is written to the file. Default is
656 "/var/run/unbound/unbound.pid". So,
657 kill -HUP `cat /var/run/unbound/unbound.pid`
658 triggers a reload,
659 kill -TERM `cat /var/run/unbound/unbound.pid`
660 gracefully terminates.
661
662 root-hints: <filename>
663 Read the root hints from this file. Default is nothing, using
664 builtin hints for the IN class. The file has the format of zone
665 files, with root nameserver names and addresses only. The
666 default may become outdated, when servers change, therefore it
667 is good practice to use a root-hints file.
668
669 hide-identity: <yes or no>
670 If enabled id.server and hostname.bind queries are refused.
671
672 identity: <string>
673 Set the identity to report. If set to "", the default, then the
674 hostname of the server is returned.
675
676 hide-version: <yes or no>
677 If enabled version.server and version.bind queries are refused.
678
679 version: <string>
680 Set the version to report. If set to "", the default, then the
681 package version is returned.
682
683 hide-trustanchor: <yes or no>
684 If enabled trustanchor.unbound queries are refused.
685
686 target-fetch-policy: <"list of numbers">
687 Set the target fetch policy used by unbound to determine if it
688 should fetch nameserver target addresses opportunistically. The
689 policy is described per dependency depth.
690
691 The number of values determines the maximum dependency depth
692 that unbound will pursue in answering a query. A value of -1
693 means to fetch all targets opportunistically for that dependency
694 depth. A value of 0 means to fetch on demand only. A positive
695 value fetches that many targets opportunistically.
696
697 Enclose the list between quotes ("") and put spaces between num‐
698 bers. The default is "3 2 1 0 0". Setting all zeroes, "0 0 0 0
699 0" gives behaviour closer to that of BIND 9, while setting "-1
700 -1 -1 -1 -1" gives behaviour rumoured to be closer to that of
701 BIND 8.
702
703 harden-short-bufsize: <yes or no>
704 Very small EDNS buffer sizes from queries are ignored. Default
705 is off, since it is legal protocol wise to send these, and
706 unbound tries to give very small answers to these queries, where
707 possible.
708
709 harden-large-queries: <yes or no>
710 Very large queries are ignored. Default is off, since it is
711 legal protocol wise to send these, and could be necessary for
712 operation if TSIG or EDNS payload is very large.
713
714 harden-glue: <yes or no>
715 Will trust glue only if it is within the servers authority.
716 Default is on.
717
718 harden-dnssec-stripped: <yes or no>
719 Require DNSSEC data for trust-anchored zones, if such data is
720 absent, the zone becomes bogus. If turned off, and no DNSSEC
721 data is received (or the DNSKEY data fails to validate), then
722 the zone is made insecure, this behaves like there is no trust
723 anchor. You could turn this off if you are sometimes behind an
724 intrusive firewall (of some sort) that removes DNSSEC data from
725 packets, or a zone changes from signed to unsigned to badly
726 signed often. If turned off you run the risk of a downgrade
727 attack that disables security for a zone. Default is on.
728
729 harden-below-nxdomain: <yes or no>
730 From RFC 8020 (with title "NXDOMAIN: There Really Is Nothing
731 Underneath"), returns nxdomain to queries for a name below
732 another name that is already known to be nxdomain. DNSSEC man‐
733 dates noerror for empty nonterminals, hence this is possible.
734 Very old software might return nxdomain for empty nonterminals
735 (that usually happen for reverse IP address lookups), and thus
736 may be incompatible with this. To try to avoid this only
737 DNSSEC-secure nxdomains are used, because the old software does
738 not have DNSSEC. Default is off. The nxdomain must be secure,
739 this means nsec3 with optout is insufficient.
740
741 harden-referral-path: <yes or no>
742 Harden the referral path by performing additional queries for
743 infrastructure data. Validates the replies if trust anchors are
744 configured and the zones are signed. This enforces DNSSEC vali‐
745 dation on nameserver NS sets and the nameserver addresses that
746 are encountered on the referral path to the answer. Default no,
747 because it burdens the authority servers, and it is not RFC
748 standard, and could lead to performance problems because of the
749 extra query load that is generated. Experimental option. If
750 you enable it consider adding more numbers after the tar‐
751 get-fetch-policy to increase the max depth that is checked to.
752
753 harden-algo-downgrade: <yes or no>
754 Harden against algorithm downgrade when multiple algorithms are
755 advertised in the DS record. If no, allows the weakest algo‐
756 rithm to validate the zone. Default is no. Zone signers must
757 produce zones that allow this feature to work, but sometimes
758 they do not, and turning this option off avoids that validation
759 failure.
760
761 use-caps-for-id: <yes or no>
762 Use 0x20-encoded random bits in the query to foil spoof
763 attempts. This perturbs the lowercase and uppercase of query
764 names sent to authority servers and checks if the reply still
765 has the correct casing. Disabled by default. This feature is
766 an experimental implementation of draft dns-0x20.
767
768 caps-whitelist: <domain>
769 Whitelist the domain so that it does not receive caps-for-id
770 perturbed queries. For domains that do not support 0x20 and
771 also fail with fallback because they keep sending different
772 answers, like some load balancers. Can be given multiple times,
773 for different domains.
774
775 qname-minimisation: <yes or no>
776 Send minimum amount of information to upstream servers to
777 enhance privacy. Only sent minimum required labels of the QNAME
778 and set QTYPE to A when possible. Best effort approach; full
779 QNAME and original QTYPE will be sent when upstream replies with
780 a RCODE other than NOERROR, except when receiving NXDOMAIN from
781 a DNSSEC signed zone. Default is yes.
782
783 qname-minimisation-strict: <yes or no>
784 QNAME minimisation in strict mode. Do not fall-back to sending
785 full QNAME to potentially broken nameservers. A lot of domains
786 will not be resolvable when this option in enabled. Only use if
787 you know what you are doing. This option only has effect when
788 qname-minimisation is enabled. Default is off.
789
790 aggressive-nsec: <yes or no>
791 Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDO‐
792 MAIN and other denials, using information from previous NXDO‐
793 MAINs answers. Default is no. It helps to reduce the query
794 rate towards targets that get a very high nonexistent name
795 lookup rate.
796
797 private-address: <IP address or subnet>
798 Give IPv4 of IPv6 addresses or classless subnets. These are
799 addresses on your private network, and are not allowed to be
800 returned for public internet names. Any occurrence of such
801 addresses are removed from DNS answers. Additionally, the DNSSEC
802 validator may mark the answers bogus. This protects against
803 so-called DNS Rebinding, where a user browser is turned into a
804 network proxy, allowing remote access through the browser to
805 other parts of your private network. Some names can be allowed
806 to contain your private addresses, by default all the local-data
807 that you configured is allowed to, and you can specify addi‐
808 tional names using private-domain. No private addresses are
809 enabled by default. We consider to enable this for the RFC1918
810 private IP address space by default in later releases. That
811 would enable private addresses for 10.0.0.0/8 172.16.0.0/12
812 192.168.0.0/16 169.254.0.0/16 fd00::/8 and fe80::/10, since the
813 RFC standards say these addresses should not be visible on the
814 public internet. Turning on 127.0.0.0/8 would hinder many spam‐
815 blocklists as they use that. Adding ::ffff:0:0/96 stops
816 IPv4-mapped IPv6 addresses from bypassing the filter.
817
818 private-domain: <domain name>
819 Allow this domain, and all its subdomains to contain private
820 addresses. Give multiple times to allow multiple domain names
821 to contain private addresses. Default is none.
822
823 unwanted-reply-threshold: <number>
824 If set, a total number of unwanted replies is kept track of in
825 every thread. When it reaches the threshold, a defensive action
826 is taken and a warning is printed to the log. The defensive
827 action is to clear the rrset and message caches, hopefully
828 flushing away any poison. A value of 10 million is suggested.
829 Default is 0 (turned off).
830
831 do-not-query-address: <IP address>
832 Do not query the given IP address. Can be IP4 or IP6. Append
833 /num to indicate a classless delegation netblock, for example
834 like 10.2.3.4/24 or 2001::11/64.
835
836 do-not-query-localhost: <yes or no>
837 If yes, localhost is added to the do-not-query-address entries,
838 both IP6 ::1 and IP4 127.0.0.1/8. If no, then localhost can be
839 used to send queries to. Default is yes.
840
841 prefetch: <yes or no>
842 If yes, message cache elements are prefetched before they expire
843 to keep the cache up to date. Default is no. Turning it on
844 gives about 10 percent more traffic and load on the machine, but
845 popular items do not expire from the cache.
846
847 prefetch-key: <yes or no>
848 If yes, fetch the DNSKEYs earlier in the validation process,
849 when a DS record is encountered. This lowers the latency of
850 requests. It does use a little more CPU. Also if the cache is
851 set to 0, it is no use. Default is no.
852
853 rrset-roundrobin: <yes or no>
854 If yes, Unbound rotates RRSet order in response (the random num‐
855 ber is taken from the query ID, for speed and thread safety).
856 Default is no.
857
858 minimal-responses: <yes or no>
859 If yes, Unbound doesn't insert authority/additional sections
860 into response messages when those sections are not required.
861 This reduces response size significantly, and may avoid TCP
862 fallback for some responses. This may cause a slight speedup.
863 The default is no, because the DNS protocol RFCs mandate these
864 sections, and the additional content could be of use and save
865 roundtrips for clients.
866
867 disable-dnssec-lame-check: <yes or no>
868 If true, disables the DNSSEC lameness check in the iterator.
869 This check sees if RRSIGs are present in the answer, when dnssec
870 is expected, and retries another authority if RRSIGs are unex‐
871 pectedly missing. The validator will insist in RRSIGs for
872 DNSSEC signed domains regardless of this setting, if a trust
873 anchor is loaded.
874
875 module-config: <"module names">
876 Module configuration, a list of module names separated by spa‐
877 ces, surround the string with quotes (""). The modules can be
878 validator, iterator. Setting this to "iterator" will result in
879 a non-validating server. Setting this to "validator iterator"
880 will turn on DNSSEC validation. The ordering of the modules is
881 important. You must also set trust-anchors for validation to be
882 useful.
883
884 trust-anchor-file: <filename>
885 File with trusted keys for validation. Both DS and DNSKEY
886 entries can appear in the file. The format of the file is the
887 standard DNS Zone file format. Default is "", or no trust
888 anchor file.
889
890 auto-trust-anchor-file: <filename>
891 File with trust anchor for one zone, which is tracked with
892 RFC5011 probes. The probes are several times per month, thus
893 the machine must be online frequently. The initial file can be
894 one with contents as described in trust-anchor-file. The file
895 is written to when the anchor is updated, so the unbound user
896 must have write permission. Write permission to the file, but
897 also to the directory it is in (to create a temporary file,
898 which is necessary to deal with filesystem full events), it must
899 also be inside the chroot (if that is used).
900
901 trust-anchor: <"Resource Record">
902 A DS or DNSKEY RR for a key to use for validation. Multiple
903 entries can be given to specify multiple trusted keys, in addi‐
904 tion to the trust-anchor-files. The resource record is entered
905 in the same format as 'dig' or 'drill' prints them, the same
906 format as in the zone file. Has to be on a single line, with ""
907 around it. A TTL can be specified for ease of cut and paste, but
908 is ignored. A class can be specified, but class IN is default.
909
910 trusted-keys-file: <filename>
911 File with trusted keys for validation. Specify more than one
912 file with several entries, one file per entry. Like
913 trust-anchor-file but has a different file format. Format is
914 BIND-9 style format, the trusted-keys { name flag proto algo
915 "key"; }; clauses are read. It is possible to use wildcards
916 with this statement, the wildcard is expanded on start and on
917 reload.
918
919 trust-anchor-signaling: <yes or no>
920 Send RFC8145 key tag query after trust anchor priming. Default
921 is on.
922
923 root-key-sentinel: <yes or no>
924 Root key trust anchor sentinel. Default is on.
925
926 dlv-anchor-file: <filename>
927 This option was used during early days DNSSEC deployment when no
928 parent-side DS record registrations were easily available.
929 Nowadays, it is best to have DS records registered with the par‐
930 ent zone (many top level zones are signed). File with trusted
931 keys for DLV (DNSSEC Lookaside Validation). Both DS and DNSKEY
932 entries can be used in the file, in the same format as for
933 trust-anchor-file: statements. Only one DLV can be configured,
934 more would be slow. The DLV configured is used as a root trusted
935 DLV, this means that it is a lookaside for the root. Default is
936 "", or no dlv anchor file. DLV is going to be decommissioned.
937 Please do not use it any more.
938
939 dlv-anchor: <"Resource Record">
940 Much like trust-anchor, this is a DLV anchor with the DS or
941 DNSKEY inline. DLV is going to be decommissioned. Please do
942 not use it any more.
943
944 domain-insecure: <domain name>
945 Sets domain name to be insecure, DNSSEC chain of trust is
946 ignored towards the domain name. So a trust anchor above the
947 domain name can not make the domain secure with a DS record,
948 such a DS record is then ignored. Also keys from DLV are
949 ignored for the domain. Can be given multiple times to specify
950 multiple domains that are treated as if unsigned. If you set
951 trust anchors for the domain they override this setting (and the
952 domain is secured).
953
954 This can be useful if you want to make sure a trust anchor for
955 external lookups does not affect an (unsigned) internal domain.
956 A DS record externally can create validation failures for that
957 internal domain.
958
959 val-override-date: <rrsig-style date spec>
960 Default is "" or "0", which disables this debugging feature. If
961 enabled by giving a RRSIG style date, that date is used for ver‐
962 ifying RRSIG inception and expiration dates, instead of the cur‐
963 rent date. Do not set this unless you are debugging signature
964 inception and expiration. The value -1 ignores the date alto‐
965 gether, useful for some special applications.
966
967 val-sig-skew-min: <seconds>
968 Minimum number of seconds of clock skew to apply to validated
969 signatures. A value of 10% of the signature lifetime (expira‐
970 tion - inception) is used, capped by this setting. Default is
971 3600 (1 hour) which allows for daylight savings differences.
972 Lower this value for more strict checking of short lived signa‐
973 tures.
974
975 val-sig-skew-max: <seconds>
976 Maximum number of seconds of clock skew to apply to validated
977 signatures. A value of 10% of the signature lifetime (expira‐
978 tion - inception) is used, capped by this setting. Default is
979 86400 (24 hours) which allows for timezone setting problems in
980 stable domains. Setting both min and max very low disables the
981 clock skew allowances. Setting both min and max very high makes
982 the validator check the signature timestamps less strictly.
983
984 val-bogus-ttl: <number>
985 The time to live for bogus data. This is data that has failed
986 validation; due to invalid signatures or other checks. The TTL
987 from that data cannot be trusted, and this value is used
988 instead. The value is in seconds, default 60. The time interval
989 prevents repeated revalidation of bogus data.
990
991 val-clean-additional: <yes or no>
992 Instruct the validator to remove data from the additional sec‐
993 tion of secure messages that are not signed properly. Messages
994 that are insecure, bogus, indeterminate or unchecked are not
995 affected. Default is yes. Use this setting to protect the users
996 that rely on this validator for authentication from potentially
997 bad data in the additional section.
998
999 val-log-level: <number>
1000 Have the validator print validation failures to the log.
1001 Regardless of the verbosity setting. Default is 0, off. At 1,
1002 for every user query that fails a line is printed to the logs.
1003 This way you can monitor what happens with validation. Use a
1004 diagnosis tool, such as dig or drill, to find out why validation
1005 is failing for these queries. At 2, not only the query that
1006 failed is printed but also the reason why unbound thought it was
1007 wrong and which server sent the faulty data.
1008
1009 val-permissive-mode: <yes or no>
1010 Instruct the validator to mark bogus messages as indeterminate.
1011 The security checks are performed, but if the result is bogus
1012 (failed security), the reply is not withheld from the client
1013 with SERVFAIL as usual. The client receives the bogus data. For
1014 messages that are found to be secure the AD bit is set in
1015 replies. Also logging is performed as for full validation. The
1016 default value is "no".
1017
1018 ignore-cd-flag: <yes or no>
1019 Instruct unbound to ignore the CD flag from clients and refuse
1020 to return bogus answers to them. Thus, the CD (Checking Dis‐
1021 abled) flag does not disable checking any more. This is useful
1022 if legacy (w2008) servers that set the CD flag but cannot vali‐
1023 date DNSSEC themselves are the clients, and then unbound pro‐
1024 vides them with DNSSEC protection. The default value is "no".
1025
1026 serve-expired: <yes or no>
1027 If enabled, unbound attempts to serve old responses from cache
1028 with a TTL of 0 in the response without waiting for the actual
1029 resolution to finish. The actual resolution answer ends up in
1030 the cache later on. Default is "no".
1031
1032 val-nsec3-keysize-iterations: <"list of values">
1033 List of keysize and iteration count values, separated by spaces,
1034 surrounded by quotes. Default is "1024 150 2048 500 4096 2500".
1035 This determines the maximum allowed NSEC3 iteration count before
1036 a message is simply marked insecure instead of performing the
1037 many hashing iterations. The list must be in ascending order and
1038 have at least one entry. If you set it to "1024 65535" there is
1039 no restriction to NSEC3 iteration values. This table must be
1040 kept short; a very long list could cause slower operation.
1041
1042 add-holddown: <seconds>
1043 Instruct the auto-trust-anchor-file probe mechanism for RFC5011
1044 autotrust updates to add new trust anchors only after they have
1045 been visible for this time. Default is 30 days as per the RFC.
1046
1047 del-holddown: <seconds>
1048 Instruct the auto-trust-anchor-file probe mechanism for RFC5011
1049 autotrust updates to remove revoked trust anchors after they
1050 have been kept in the revoked list for this long. Default is 30
1051 days as per the RFC.
1052
1053 keep-missing: <seconds>
1054 Instruct the auto-trust-anchor-file probe mechanism for RFC5011
1055 autotrust updates to remove missing trust anchors after they
1056 have been unseen for this long. This cleans up the state file
1057 if the target zone does not perform trust anchor revocation, so
1058 this makes the auto probe mechanism work with zones that perform
1059 regular (non-5011) rollovers. The default is 366 days. The
1060 value 0 does not remove missing anchors, as per the RFC.
1061
1062 permit-small-holddown: <yes or no>
1063 Debug option that allows the autotrust 5011 rollover timers to
1064 assume very small values. Default is no.
1065
1066 key-cache-size: <number>
1067 Number of bytes size of the key cache. Default is 4 megabytes.
1068 A plain number is in bytes, append 'k', 'm' or 'g' for kilo‐
1069 bytes, megabytes or gigabytes (1024*1024 bytes in a megabyte).
1070
1071 key-cache-slabs: <number>
1072 Number of slabs in the key cache. Slabs reduce lock contention
1073 by threads. Must be set to a power of 2. Setting (close) to the
1074 number of cpus is a reasonable guess.
1075
1076 neg-cache-size: <number>
1077 Number of bytes size of the aggressive negative cache. Default
1078 is 1 megabyte. A plain number is in bytes, append 'k', 'm' or
1079 'g' for kilobytes, megabytes or gigabytes (1024*1024 bytes in a
1080 megabyte).
1081
1082 unblock-lan-zones: <yesno>
1083 Default is disabled. If enabled, then for private address
1084 space, the reverse lookups are no longer filtered. This allows
1085 unbound when running as dns service on a host where it provides
1086 service for that host, to put out all of the queries for the
1087 'lan' upstream. When enabled, only localhost, 127.0.0.1 reverse
1088 and ::1 reverse zones are configured with default local zones.
1089 Disable the option when unbound is running as a (DHCP-) DNS net‐
1090 work resolver for a group of machines, where such lookups should
1091 be filtered (RFC compliance), this also stops potential data
1092 leakage about the local network to the upstream DNS servers.
1093
1094 insecure-lan-zones: <yesno>
1095 Default is disabled. If enabled, then reverse lookups in pri‐
1096 vate address space are not validated. This is usually required
1097 whenever unblock-lan-zones is used.
1098
1099 local-zone: <zone> <type>
1100 Configure a local zone. The type determines the answer to give
1101 if there is no match from local-data. The types are deny,
1102 refuse, static, transparent, redirect, nodefault, typetranspar‐
1103 ent, inform, inform_deny, always_transparent, always_refuse,
1104 always_nxdomain, noview, and are explained below. After that the
1105 default settings are listed. Use local-data: to enter data into
1106 the local zone. Answers for local zones are authoritative DNS
1107 answers. By default the zones are class IN.
1108
1109 If you need more complicated authoritative data, with referrals,
1110 wildcards, CNAME/DNAME support, or DNSSEC authoritative service,
1111 setup a stub-zone for it as detailed in the stub zone section
1112 below.
1113
1114 deny Do not send an answer, drop the query. If there is a match
1115 from local data, the query is answered.
1116
1117 refuse
1118 Send an error message reply, with rcode REFUSED. If there is
1119 a match from local data, the query is answered.
1120
1121 static
1122 If there is a match from local data, the query is answered.
1123 Otherwise, the query is answered with nodata or nxdomain.
1124 For a negative answer a SOA is included in the answer if
1125 present as local-data for the zone apex domain.
1126
1127 transparent
1128 If there is a match from local data, the query is answered.
1129 Otherwise if the query has a different name, the query is
1130 resolved normally. If the query is for a name given in
1131 localdata but no such type of data is given in localdata,
1132 then a noerror nodata answer is returned. If no local-zone
1133 is given local-data causes a transparent zone to be created
1134 by default.
1135
1136 typetransparent
1137 If there is a match from local data, the query is answered.
1138 If the query is for a different name, or for the same name
1139 but for a different type, the query is resolved normally.
1140 So, similar to transparent but types that are not listed in
1141 local data are resolved normally, so if an A record is in the
1142 local data that does not cause a nodata reply for AAAA
1143 queries.
1144
1145 redirect
1146 The query is answered from the local data for the zone name.
1147 There may be no local data beneath the zone name. This
1148 answers queries for the zone, and all subdomains of the zone
1149 with the local data for the zone. It can be used to redirect
1150 a domain to return a different address record to the end
1151 user, with local-zone: "example.com." redirect and
1152 local-data: "example.com. A 127.0.0.1" queries for www.exam‐
1153 ple.com and www.foo.example.com are redirected, so that users
1154 with web browsers cannot access sites with suffix exam‐
1155 ple.com.
1156
1157 inform
1158 The query is answered normally, same as transparent. The
1159 client IP address (@portnumber) is printed to the logfile.
1160 The log message is: timestamp, unbound-pid, info: zonename
1161 inform IP@port queryname type class. This option can be used
1162 for normal resolution, but machines looking up infected names
1163 are logged, eg. to run antivirus on them.
1164
1165 inform_deny
1166 The query is dropped, like 'deny', and logged, like 'inform'.
1167 Ie. find infected machines without answering the queries.
1168
1169 always_transparent
1170 Like transparent, but ignores local data and resolves nor‐
1171 mally.
1172
1173 always_refuse
1174 Like refuse, but ignores local data and refuses the query.
1175
1176 always_nxdomain
1177 Like static, but ignores local data and returns nxdomain for
1178 the query.
1179
1180 noview
1181 Breaks out of that view and moves towards the global local
1182 zones for answer to the query. If the view first is no,
1183 it'll resolve normally. If view first is enabled, it'll
1184 break perform that step and check the global answers. For
1185 when the view has view specific overrides but some zone has
1186 to be answered from global local zone contents.
1187
1188 nodefault
1189 Used to turn off default contents for AS112 zones. The other
1190 types also turn off default contents for the zone. The 'node‐
1191 fault' option has no other effect than turning off default
1192 contents for the given zone. Use nodefault if you use
1193 exactly that zone, if you want to use a subzone, use trans‐
1194 parent.
1195
1196 The default zones are localhost, reverse 127.0.0.1 and ::1, the onion,
1197 test, invalid and the AS112 zones. The AS112 zones are reverse DNS
1198 zones for private use and reserved IP addresses for which the servers
1199 on the internet cannot provide correct answers. They are configured by
1200 default to give nxdomain (no reverse information) answers. The defaults
1201 can be turned off by specifying your own local-zone of that name, or
1202 using the 'nodefault' type. Below is a list of the default zone con‐
1203 tents.
1204
1205 localhost
1206 The IP4 and IP6 localhost information is given. NS and SOA
1207 records are provided for completeness and to satisfy some DNS
1208 update tools. Default content:
1209 local-zone: "localhost." redirect
1210 local-data: "localhost. 10800 IN NS localhost."
1211 local-data: "localhost. 10800 IN
1212 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1213 local-data: "localhost. 10800 IN A 127.0.0.1"
1214 local-data: "localhost. 10800 IN AAAA ::1"
1215
1216 reverse IPv4 loopback
1217 Default content:
1218 local-zone: "127.in-addr.arpa." static
1219 local-data: "127.in-addr.arpa. 10800 IN NS localhost."
1220 local-data: "127.in-addr.arpa. 10800 IN
1221 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1222 local-data: "1.0.0.127.in-addr.arpa. 10800 IN
1223 PTR localhost."
1224
1225 reverse IPv6 loopback
1226 Default content:
1227 local-zone: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
1228 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." static
1229 local-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
1230 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
1231 NS localhost."
1232 local-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
1233 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
1234 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1235 local-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
1236 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
1237 PTR localhost."
1238
1239 onion (RFC 7686)
1240 Default content:
1241 local-zone: "onion." static
1242 local-data: "onion. 10800 IN NS localhost."
1243 local-data: "onion. 10800 IN
1244 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1245
1246 test (RFC 2606)
1247 Default content:
1248 local-zone: "test." static
1249 local-data: "test. 10800 IN NS localhost."
1250 local-data: "test. 10800 IN
1251 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1252
1253 invalid (RFC 2606)
1254 Default content:
1255 local-zone: "invalid." static
1256 local-data: "invalid. 10800 IN NS localhost."
1257 local-data: "invalid. 10800 IN
1258 SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
1259
1260 reverse RFC1918 local use zones
1261 Reverse data for zones 10.in-addr.arpa, 16.172.in-addr.arpa
1262 to 31.172.in-addr.arpa, 168.192.in-addr.arpa. The
1263 local-zone: is set static and as local-data: SOA and NS
1264 records are provided.
1265
1266 reverse RFC3330 IP4 this, link-local, testnet and broadcast
1267 Reverse data for zones 0.in-addr.arpa, 254.169.in-addr.arpa,
1268 2.0.192.in-addr.arpa (TEST NET 1), 100.51.198.in-addr.arpa
1269 (TEST NET 2), 113.0.203.in-addr.arpa (TEST NET 3),
1270 255.255.255.255.in-addr.arpa. And from 64.100.in-addr.arpa
1271 to 127.100.in-addr.arpa (Shared Address Space).
1272
1273 reverse RFC4291 IP6 unspecified
1274 Reverse data for zone
1275 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
1276 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.
1277
1278 reverse RFC4193 IPv6 Locally Assigned Local Addresses
1279 Reverse data for zone D.F.ip6.arpa.
1280
1281 reverse RFC4291 IPv6 Link Local Addresses
1282 Reverse data for zones 8.E.F.ip6.arpa to B.E.F.ip6.arpa.
1283
1284 reverse IPv6 Example Prefix
1285 Reverse data for zone 8.B.D.0.1.0.0.2.ip6.arpa. This zone is
1286 used for tutorials and examples. You can remove the block on
1287 this zone with:
1288 local-zone: 8.B.D.0.1.0.0.2.ip6.arpa. nodefault
1289 You can also selectively unblock a part of the zone by making
1290 that part transparent with a local-zone statement. This also
1291 works with the other default zones.
1292
1293 local-data: "<resource record string>"
1294 Configure local data, which is served in reply to queries for it.
1295 The query has to match exactly unless you configure the local-zone
1296 as redirect. If not matched exactly, the local-zone type deter‐
1297 mines further processing. If local-data is configured that is not
1298 a subdomain of a local-zone, a transparent local-zone is config‐
1299 ured. For record types such as TXT, use single quotes, as in
1300 local-data: 'example. TXT "text"'.
1301
1302 If you need more complicated authoritative data, with referrals,
1303 wildcards, CNAME/DNAME support, or DNSSEC authoritative service,
1304 setup a stub-zone for it as detailed in the stub zone section
1305 below.
1306
1307 local-data-ptr: "IPaddr name"
1308 Configure local data shorthand for a PTR record with the reversed
1309 IPv4 or IPv6 address and the host name. For example "192.0.2.4
1310 www.example.com". TTL can be inserted like this: "2001:DB8::4
1311 7200 www.example.com"
1312
1313 local-zone-tag: <zone> <"list of tags">
1314 Assign tags to localzones. Tagged localzones will only be applied
1315 when the used access-control element has a matching tag. Tags must
1316 be defined in define-tags. Enclose list of tags in quotes ("")
1317 and put spaces between tags.
1318
1319 local-zone-override: <zone> <IP netblock> <type>
1320 Override the localzone type for queries from addresses matching
1321 netblock. Use this localzone type, regardless the type configured
1322 for the local-zone (both tagged and untagged) and regardless the
1323 type configured using access-control-tag-action.
1324
1325 ratelimit: <number or 0>
1326 Enable ratelimiting of queries sent to nameserver for performing
1327 recursion. If 0, the default, it is disabled. This option is
1328 experimental at this time. The ratelimit is in queries per second
1329 that are allowed. More queries are turned away with an error
1330 (servfail). This stops recursive floods, eg. random query names,
1331 but not spoofed reflection floods. Cached responses are not rate‐
1332 limited by this setting. The zone of the query is determined by
1333 examining the nameservers for it, the zone name is used to keep
1334 track of the rate. For example, 1000 may be a suitable value to
1335 stop the server from being overloaded with random names, and keeps
1336 unbound from sending traffic to the nameservers for those zones.
1337
1338 ratelimit-size: <memory size>
1339 Give the size of the data structure in which the current ongoing
1340 rates are kept track in. Default 4m. In bytes or use m(mega),
1341 k(kilo), g(giga). The ratelimit structure is small, so this data
1342 structure likely does not need to be large.
1343
1344 ratelimit-slabs: <number>
1345 Give power of 2 number of slabs, this is used to reduce lock con‐
1346 tention in the ratelimit tracking data structure. Close to the
1347 number of cpus is a fairly good setting.
1348
1349 ratelimit-factor: <number>
1350 Set the amount of queries to rate limit when the limit is
1351 exceeded. If set to 0, all queries are dropped for domains where
1352 the limit is exceeded. If set to another value, 1 in that number
1353 is allowed through to complete. Default is 10, allowing 1/10
1354 traffic to flow normally. This can make ordinary queries complete
1355 (if repeatedly queried for), and enter the cache, whilst also mit‐
1356 igating the traffic flow by the factor given.
1357
1358 ratelimit-for-domain: <domain> <number qps or 0>
1359 Override the global ratelimit for an exact match domain name with
1360 the listed number. You can give this for any number of names.
1361 For example, for a top-level-domain you may want to have a higher
1362 limit than other names. A value of 0 will disable ratelimiting
1363 for that domain.
1364
1365 ratelimit-below-domain: <domain> <number qps or 0>
1366 Override the global ratelimit for a domain name that ends in this
1367 name. You can give this multiple times, it then describes differ‐
1368 ent settings in different parts of the namespace. The closest
1369 matching suffix is used to determine the qps limit. The rate for
1370 the exact matching domain name is not changed, use rate‐
1371 limit-for-domain to set that, you might want to use different set‐
1372 tings for a top-level-domain and subdomains. A value of 0 will
1373 disable ratelimiting for domain names that end in this name.
1374
1375 ip-ratelimit: <number or 0>
1376 Enable global ratelimiting of queries accepted per ip address. If
1377 0, the default, it is disabled. This option is experimental at
1378 this time. The ratelimit is in queries per second that are
1379 allowed. More queries are completely dropped and will not receive
1380 a reply, SERVFAIL or otherwise. IP ratelimiting happens before
1381 looking in the cache. This may be useful for mitigating amplifica‐
1382 tion attacks.
1383
1384 ip-ratelimit-size: <memory size>
1385 Give the size of the data structure in which the current ongoing
1386 rates are kept track in. Default 4m. In bytes or use m(mega),
1387 k(kilo), g(giga). The ip ratelimit structure is small, so this
1388 data structure likely does not need to be large.
1389
1390 ip-ratelimit-slabs: <number>
1391 Give power of 2 number of slabs, this is used to reduce lock con‐
1392 tention in the ip ratelimit tracking data structure. Close to the
1393 number of cpus is a fairly good setting.
1394
1395 ip-ratelimit-factor: <number>
1396 Set the amount of queries to rate limit when the limit is
1397 exceeded. If set to 0, all queries are dropped for addresses
1398 where the limit is exceeded. If set to another value, 1 in that
1399 number is allowed through to complete. Default is 10, allowing
1400 1/10 traffic to flow normally. This can make ordinary queries
1401 complete (if repeatedly queried for), and enter the cache, whilst
1402 also mitigating the traffic flow by the factor given.
1403
1404 low-rtt: <msec time>
1405 Set the time in millisecond that is considere a low ping time for
1406 fast server selection with the low-rtt-permil option, that turns
1407 this on or off. The default is 45 msec, a number from IPv6 quick
1408 response documents.
1409
1410 low-rtt-permil: <number>
1411 Specify how many times out of 1000 to pick the fast server from
1412 the low rtt band. 0 turns the feature off. A value of 900 would
1413 pick the fast server when such fast servers are available 90 per‐
1414 cent of the time, and the remaining time perform normal explo‐
1415 ration of random servers. When prefetch is enabled (or
1416 serve-expired), such prefetches are not sped up, because there is
1417 no one waiting for it, and it presents a good moment to perform
1418 server exploration. The low-rtt option can be used to specify
1419 which servers are picked for fast server selection, servers with a
1420 ping roundtrip time below that value are considered. The default
1421 for low-rtt-permil is 0.
1422
1423 Remote Control Options
1424 In the remote-control: clause are the declarations for the remote con‐
1425 trol facility. If this is enabled, the unbound-control(8) utility can
1426 be used to send commands to the running unbound server. The server
1427 uses these clauses to setup TLSv1 security for the connection. The
1428 unbound-control(8) utility also reads the remote-control section for
1429 options. To setup the correct self-signed certificates use the
1430 unbound-control-setup(8) utility.
1431
1432 control-enable: <yes or no>
1433 The option is used to enable remote control, default is "no". If
1434 turned off, the server does not listen for control commands.
1435
1436 control-interface: <ip address or path>
1437 Give IPv4 or IPv6 addresses or local socket path to listen on for
1438 control commands. By default localhost (127.0.0.1 and ::1) is
1439 listened to. Use 0.0.0.0 and ::0 to listen to all interfaces. If
1440 you change this and permissions have been dropped, you must
1441 restart the server for the change to take effect.
1442
1443 If you set it to an absolute path, a local socket is used. The
1444 local socket does not use the certificates and keys, so those
1445 files need not be present. To restrict access, unbound sets per‐
1446 missions on the file to the user and group that is configured, the
1447 access bits are set to allow the group members to access the con‐
1448 trol socket file. Put users that need to access the socket in the
1449 that group. To restrict access further, create a directory to put
1450 the control socket in and restrict access to that directory.
1451
1452 control-port: <port number>
1453 The port number to listen on for IPv4 or IPv6 control interfaces,
1454 default is 8953. If you change this and permissions have been
1455 dropped, you must restart the server for the change to take
1456 effect.
1457
1458 control-use-cert: <yes or no>
1459 For localhost control-interface you can disable the use of TLS by
1460 setting this option to "no", default is "yes". For local sockets,
1461 TLS is disabled and the value of this option is ignored.
1462
1463 server-key-file: <private key file>
1464 Path to the server private key, by default unbound_server.key.
1465 This file is generated by the unbound-control-setup utility. This
1466 file is used by the unbound server, but not by unbound-control.
1467
1468 server-cert-file: <certificate file.pem>
1469 Path to the server self signed certificate, by default
1470 unbound_server.pem. This file is generated by the unbound-con‐
1471 trol-setup utility. This file is used by the unbound server, and
1472 also by unbound-control.
1473
1474 control-key-file: <private key file>
1475 Path to the control client private key, by default unbound_con‐
1476 trol.key. This file is generated by the unbound-control-setup
1477 utility. This file is used by unbound-control.
1478
1479 control-cert-file: <certificate file.pem>
1480 Path to the control client certificate, by default unbound_con‐
1481 trol.pem. This certificate has to be signed with the server cer‐
1482 tificate. This file is generated by the unbound-control-setup
1483 utility. This file is used by unbound-control.
1484
1485 Stub Zone Options
1486 There may be multiple stub-zone: clauses. Each with a name: and zero or
1487 more hostnames or IP addresses. For the stub zone this list of name‐
1488 servers is used. Class IN is assumed. The servers should be authority
1489 servers, not recursors; unbound performs the recursive processing
1490 itself for stub zones.
1491
1492 The stub zone can be used to configure authoritative data to be used by
1493 the resolver that cannot be accessed using the public internet servers.
1494 This is useful for company-local data or private zones. Setup an
1495 authoritative server on a different host (or different port). Enter a
1496 config entry for unbound with stub-addr: <ip address of host[@port]>.
1497 The unbound resolver can then access the data, without referring to the
1498 public internet for it.
1499
1500 This setup allows DNSSEC signed zones to be served by that authorita‐
1501 tive server, in which case a trusted key entry with the public key can
1502 be put in config, so that unbound can validate the data and set the AD
1503 bit on replies for the private zone (authoritative servers do not set
1504 the AD bit). This setup makes unbound capable of answering queries for
1505 the private zone, and can even set the AD bit ('authentic'), but the AA
1506 ('authoritative') bit is not set on these replies.
1507
1508 Consider adding server: statements for domain-insecure: and for
1509 local-zone: name nodefault for the zone if it is a locally served zone.
1510 The insecure clause stops DNSSEC from invalidating the zone. The local
1511 zone nodefault (or transparent) clause makes the (reverse-) zone bypass
1512 unbound's filtering of RFC1918 zones.
1513
1514 name: <domain name>
1515 Name of the stub zone.
1516
1517 stub-host: <domain name>
1518 Name of stub zone nameserver. Is itself resolved before it is
1519 used.
1520
1521 stub-addr: <IP address>
1522 IP address of stub zone nameserver. Can be IP 4 or IP 6. To use
1523 a nondefault port for DNS communication append '@' with the port
1524 number.
1525
1526 stub-prime: <yes or no>
1527 This option is by default no. If enabled it performs NS set
1528 priming, which is similar to root hints, where it starts using
1529 the list of nameservers currently published by the zone. Thus,
1530 if the hint list is slightly outdated, the resolver picks up a
1531 correct list online.
1532
1533 stub-first: <yes or no>
1534 If enabled, a query is attempted without the stub clause if it
1535 fails. The data could not be retrieved and would have caused
1536 SERVFAIL because the servers are unreachable, instead it is
1537 tried without this clause. The default is no.
1538
1539 stub-tls-upstream: <yes or no>
1540 Enabled or disable whether the queries to this stub use TLS for
1541 transport. Default is no.
1542
1543 stub-ssl-upstream: <yes or no>
1544 Alternate syntax for stub-tls-upstream.
1545
1546 Forward Zone Options
1547 There may be multiple forward-zone: clauses. Each with a name: and zero
1548 or more hostnames or IP addresses. For the forward zone this list of
1549 nameservers is used to forward the queries to. The servers listed as
1550 forward-host: and forward-addr: have to handle further recursion for
1551 the query. Thus, those servers are not authority servers, but are
1552 (just like unbound is) recursive servers too; unbound does not perform
1553 recursion itself for the forward zone, it lets the remote server do it.
1554 Class IN is assumed. CNAMEs are chased by unbound itself, asking the
1555 remote server for every name in the indirection chain, to protect the
1556 local cache from illegal indirect referenced items. A forward-zone
1557 entry with name "." and a forward-addr target will forward all queries
1558 to that other server (unless it can answer from the cache).
1559
1560 name: <domain name>
1561 Name of the forward zone.
1562
1563 forward-host: <domain name>
1564 Name of server to forward to. Is itself resolved before it is
1565 used.
1566
1567 forward-addr: <IP address>
1568 IP address of server to forward to. Can be IP 4 or IP 6. To use
1569 a nondefault port for DNS communication append '@' with the port
1570 number. If tls is enabled, then you can append a '#' and a
1571 name, then it'll check the tls authentication certificates with
1572 that name. If you combine the '@' and '#', the '@' comes first.
1573
1574 At high verbosity it logs the TLS certificate, with TLS enabled.
1575 If you leave out the '#' and auth name from the forward-addr,
1576 any name is accepted. The cert must also match a CA from the
1577 tls-cert-bundle.
1578
1579 forward-first: <yes or no>
1580 If enabled, a query is attempted without the forward clause if
1581 it fails. The data could not be retrieved and would have caused
1582 SERVFAIL because the servers are unreachable, instead it is
1583 tried without this clause. The default is no.
1584
1585 forward-tls-upstream: <yes or no>
1586 Enabled or disable whether the queries to this forwarder use TLS
1587 for transport. Default is no. If you enable this, also config‐
1588 ure a tls-cert-bundle or use tls-winload CA certs, otherwise the
1589 connections cannot be authenticated.
1590
1591 forward-ssl-upstream: <yes or no>
1592 Alternate syntax for forward-tls-upstream.
1593
1594 Authority Zone Options
1595 Authority zones are configured with auth-zone:, and each one must have
1596 a name:. There can be multiple ones, by listing multiple auth-zone
1597 clauses, each with a different name, pertaining to that part of the
1598 namespace. The authority zone with the name closest to the name looked
1599 up is used. Authority zones are processed after local-zones and before
1600 cache (for-downstream: yes), and when used in this manner make unbound
1601 respond like an authority server. Authority zones are also processed
1602 after cache, just before going to the network to fetch information for
1603 recursion (for-upstream: yes), and when used in this manner provide a
1604 local copy of an authority server that speeds up lookups of that data.
1605
1606 Authority zones can be read from zonefile. And can be kept updated via
1607 AXFR and IXFR. After update the zonefile is rewritten. The update
1608 mechanism uses the SOA timer values and performs SOA UDP queries to
1609 detect zone changes.
1610
1611 name: <zone name>
1612 Name of the authority zone.
1613
1614 master: <IP address or host name>
1615 Where to download a copy of the zone from, with AXFR and IXFR.
1616 Multiple masters can be specified. They are all tried if one
1617 fails.
1618
1619 url: <url to zonefile>
1620 Where to download a zonefile for the zone. With http or https.
1621 An example for the url is "http://www.example.com/exam‐
1622 ple.org.zone". Multiple url statements can be given, they are
1623 tried in turn. If only urls are given the SOA refresh timer is
1624 used to wait for making new downloads. If also masters are
1625 listed, the masters are first probed with UDP SOA queries to see
1626 if the SOA serial number has changed, reducing the number of
1627 downloads. If none of the urls work, the masters are tried with
1628 IXFR and AXFR. For https, the tls-cert-bundle and the hostname
1629 from the url are used to authenticate the connection.
1630
1631 allow-notify: <IP address or host name or netblockIP/prefix>
1632 With allow-notify you can specify additional sources of noti‐
1633 fies. When notified, the server attempts to first probe and
1634 then zone transfer. If the notify is from a master, it first
1635 attempts that master. Otherwise other masters are attempted.
1636 If there are no masters, but only urls, the file is downloaded
1637 when notified. The masters from master: statements are allowed
1638 notify by default.
1639
1640 fallback-enabled: <yes or no>
1641 Default no. If enabled, unbound falls back to querying the
1642 internet as a resolver for this zone when lookups fail. For
1643 example for DNSSEC validation failures.
1644
1645 for-downstream: <yes or no>
1646 Default yes. If enabled, unbound serves authority responses to
1647 downstream clients for this zone. This option makes unbound
1648 behave, for the queries with names in this zone, like one of the
1649 authority servers for that zone. Turn it off if you want
1650 unbound to provide recursion for the zone but have a local copy
1651 of zone data. If for-downstream is no and for-upstream is yes,
1652 then unbound will DNSSEC validate the contents of the zone
1653 before serving the zone contents to clients and store validation
1654 results in the cache.
1655
1656 for-upstream: <yes or no>
1657 Default yes. If enabled, unbound fetches data from this data
1658 collection for answering recursion queries. Instead of sending
1659 queries over the internet to the authority servers for this
1660 zone, it'll fetch the data directly from the zone data. Turn it
1661 on when you want unbound to provide recursion for downstream
1662 clients, and use the zone data as a local copy to speed up
1663 lookups.
1664
1665 zonefile: <filename>
1666 The filename where the zone is stored. If not given then no
1667 zonefile is used. If the file does not exist or is empty,
1668 unbound will attempt to fetch zone data (eg. from the master
1669 servers).
1670
1671 View Options
1672 There may be multiple view: clauses. Each with a name: and zero or more
1673 local-zone and local-data elements. View can be mapped to requests by
1674 specifying the view name in an access-control-view element. Options
1675 from matching views will override global options. Global options will
1676 be used if no matching view is found, or when the matching view does
1677 not have the option specified.
1678
1679 name: <view name>
1680 Name of the view. Must be unique. This name is used in
1681 access-control-view elements.
1682
1683 local-zone: <zone> <type>
1684 View specific local-zone elements. Has the same types and behav‐
1685 iour as the global local-zone elements. When there is at least
1686 one local-zone specified and view-first is no, the default
1687 local-zones will be added to this view. Defaults can be dis‐
1688 abled using the nodefault type. When view-first is yes or when a
1689 view does not have a local-zone, the global local-zone will be
1690 used including it's default zones.
1691
1692 local-data: "<resource record string>"
1693 View specific local-data elements. Has the same behaviour as the
1694 global local-data elements.
1695
1696 local-data-ptr: "IPaddr name"
1697 View specific local-data-ptr elements. Has the same behaviour as
1698 the global local-data-ptr elements.
1699
1700 view-first: <yes or no>
1701 If enabled, it attempts to use the global local-zone and
1702 local-data if there is no match in the view specific options.
1703 The default is no.
1704
1705 Python Module Options
1706 The python: clause gives the settings for the python(1) script module.
1707 This module acts like the iterator and validator modules do, on queries
1708 and answers. To enable the script module it has to be compiled into
1709 the daemon, and the word "python" has to be put in the module-config:
1710 option (usually first, or between the validator and iterator).
1711
1712 If the chroot: option is enabled, you should make sure Python's library
1713 directory structure is bind mounted in the new root environment, see
1714 mount(8). Also the python-script: path should be specified as an abso‐
1715 lute path relative to the new root, or as a relative path to the work‐
1716 ing directory.
1717
1718 python-script: <python file>
1719 The script file to load.
1720
1721 DNS64 Module Options
1722 The dns64 module must be configured in the module-config: "dns64 val‐
1723 idator iterator" directive and be compiled into the daemon to be
1724 enabled. These settings go in the server: section.
1725
1726 dns64-prefix: <IPv6 prefix>
1727 This sets the DNS64 prefix to use to synthesize AAAA records
1728 with. It must be /96 or shorter. The default prefix is
1729 64:ff9b::/96.
1730
1731 dns64-synthall: <yes or no>
1732 Debug option, default no. If enabled, synthesize all AAAA
1733 records despite the presence of actual AAAA records.
1734
1735 DNSCrypt Options
1736 The dnscrypt: clause gives the settings of the dnscrypt channel. While
1737 those options are available, they are only meaningful if unbound was
1738 compiled with --enable-dnscrypt. Currently certificate and secret/pub‐
1739 lic keys cannot be generated by unbound. You can use dnscrypt-wrapper
1740 to generate those: https://github.com/cofyc/dnscrypt-wrapper/blob/mas‐
1741 ter/README.md#usage
1742
1743 dnscrypt-enable: <yes or no>
1744 Whether or not the dnscrypt config should be enabled. You may
1745 define configuration but not activate it. The default is no.
1746
1747 dnscrypt-port: <port number>
1748 On which port should dnscrypt should be activated. Note that you
1749 should have a matching interface option defined in the server
1750 section for this port.
1751
1752 dnscrypt-provider: <provider name>
1753 The provider name to use to distribute certificates. This is of
1754 the form: 2.dnscrypt-cert.example.com.. The name MUST end with a
1755 dot.
1756
1757 dnscrypt-secret-key: <path to secret key file>
1758 Path to the time limited secret key file. This option may be
1759 specified multiple times.
1760
1761 dnscrypt-provider-cert: <path to cert file>
1762 Path to the certificate related to the dnscrypt-secret-keys.
1763 This option may be specified multiple times.
1764
1765 dnscrypt-provider-cert-rotated: <path to cert file>
1766 Path to a certificate that we should be able to serve existing
1767 connection from but do not want to advertise over
1768 dnscrypt-provider's TXT record certs distribution. A typical
1769 use case is when rotating certificates, existing clients may
1770 still use the client magic from the old cert in their queries
1771 until they fetch and update the new cert. Likewise, it would
1772 allow one to prime the new cert/key without distributing the new
1773 cert yet, this can be useful when using a network of servers
1774 using anycast and on which the configuration may not get updated
1775 at the exact same time. By priming the cert, the servers can
1776 handle both old and new certs traffic while distributing only
1777 one. This option may be specified multiple times.
1778
1779 dnscrypt-shared-secret-cache-size: <memory size>
1780 Give the size of the data structure in which the shared secret
1781 keys are kept in. Default 4m. In bytes or use m(mega),
1782 k(kilo), g(giga). The shared secret cache is used when a same
1783 client is making multiple queries using the same public key. It
1784 saves a substantial amount of CPU.
1785
1786 dnscrypt-shared-secret-cache-slabs: <number>
1787 Give power of 2 number of slabs, this is used to reduce lock
1788 contention in the dnscrypt shared secrets cache. Close to the
1789 number of cpus is a fairly good setting.
1790
1791 dnscrypt-nonce-cache-size: <memory size>
1792 Give the size of the data structure in which the client nonces
1793 are kept in. Default 4m. In bytes or use m(mega), k(kilo),
1794 g(giga). The nonce cache is used to prevent dnscrypt message
1795 replaying. Client nonce should be unique for any pair of client
1796 pk/server sk.
1797
1798 dnscrypt-nonce-cache-slabs: <number>
1799 Give power of 2 number of slabs, this is used to reduce lock
1800 contention in the dnscrypt nonce cache. Close to the number of
1801 cpus is a fairly good setting.
1802
1803 EDNS Client Subnet Module Options
1804 The ECS module must be configured in the module-config: "subnetcache
1805 validator iterator" directive and be compiled into the daemon to be
1806 enabled. These settings go in the server: section.
1807
1808 If the destination address is whitelisted with Unbound will add the
1809 EDNS0 option to the query containing the relevant part of the client's
1810 address. When an answer contains the ECS option the response and the
1811 option are placed in a specialized cache. If the authority indicated no
1812 support, the response is stored in the regular cache.
1813
1814 Additionally, when a client includes the option in its queries, Unbound
1815 will forward the option to the authority if present in the whitelist,
1816 or client-subnet-always-forward is set to yes. In this case the lookup
1817 in the regular cache is skipped.
1818
1819 The maximum size of the ECS cache is controlled by 'msg-cache-size' in
1820 the configuration file. On top of that, for each query only 100 differ‐
1821 ent subnets are allowed to be stored for each address family. Exceeding
1822 that number, older entries will be purged from cache.
1823
1824 send-client-subnet: <IP address>
1825 Send client source address to this authority. Append /num to
1826 indicate a classless delegation netblock, for example like
1827 10.2.3.4/24 or 2001::11/64. Can be given multiple times. Author‐
1828 ities not listed will not receive edns-subnet information,
1829 unless domain in query is specified in client-subnet-zone.
1830
1831 client-subnet-zone: <domain>
1832 Send client source address in queries for this domain and its
1833 subdomains. Can be given multiple times. Zones not listed will
1834 not receive edns-subnet information, unless hosted by authority
1835 specified in send-client-subnet.
1836
1837 client-subnet-always-forward: <yes or no>
1838 Specify whether the ECS whitelist check (configured using
1839 send-client-subnet) is applied for all queries, even if the
1840 triggering query contains an ECS record, or only for queries for
1841 which the ECS record is generated using the querier address (and
1842 therefore did not contain ECS data in the client query). If
1843 enabled, the whitelist check is skipped when the client query
1844 contains an ECS record. Default is no.
1845
1846 max-client-subnet-ipv6: <number>
1847 Specifies the maximum prefix length of the client source address
1848 we are willing to expose to third parties for IPv6. Defaults to
1849 56.
1850
1851 max-client-subnet-ipv4: <number>
1852 Specifies the maximum prefix length of the client source address
1853 we are willing to expose to third parties for IPv4. Defaults to
1854 24.
1855
1856 Opportunistic IPsec Support Module Options
1857 The IPsec module must be configured in the module-config: "ipsecmod
1858 validator iterator" directive and be compiled into the daemon to be
1859 enabled. These settings go in the server: section.
1860
1861 When unbound receives an A/AAAA query that is not in the cache and
1862 finds a valid answer, it will withhold returning the answer and instead
1863 will generate an IPSECKEY subquery for the same domain name. If an
1864 answer was found, unbound will call an external hook passing the fol‐
1865 lowing arguments:
1866
1867 QNAME
1868 Domain name of the A/AAAA and IPSECKEY query. In string for‐
1869 mat.
1870
1871 IPSECKEY TTL
1872 TTL of the IPSECKEY RRset.
1873
1874 A/AAAA
1875 String of space separated IP addresses present in the A/AAAA
1876 RRset. The IP addresses are in string format.
1877
1878 IPSECKEY
1879 String of space separated IPSECKEY RDATA present in the
1880 IPSECKEY RRset. The IPSECKEY RDATA are in DNS presentation
1881 format.
1882
1883 The A/AAAA answer is then cached and returned to the client. If the
1884 external hook was called the TTL changes to ensure it doesn't surpass
1885 ipsecmod-max-ttl.
1886
1887 The same procedure is also followed when prefetch: is used, but the
1888 A/AAAA answer is given to the client before the hook is called. ipsec‐
1889 mod-max-ttl ensures that the A/AAAA answer given from cache is still
1890 relevant for opportunistic IPsec.
1891
1892 ipsecmod-enabled: <yes or no>
1893 Specifies whether the IPsec module is enabled or not. The IPsec
1894 module still needs to be defined in the module-config: direc‐
1895 tive. This option facilitates turning on/off the module without
1896 restarting/reloading unbound. Defaults to yes.
1897
1898 ipsecmod-hook: <filename>
1899 Specifies the external hook that unbound will call with sys‐
1900 tem(3). The file can be specified as an absolute/relative path.
1901 The file needs the proper permissions to be able to be executed
1902 by the same user that runs unbound. It must be present when the
1903 IPsec module is defined in the module-config: directive.
1904
1905 ipsecmod-strict: <yes or no>
1906 If enabled unbound requires the external hook to return a suc‐
1907 cess value of 0. Failing to do so unbound will reply with SERV‐
1908 FAIL. The A/AAAA answer will also not be cached. Defaults to
1909 no.
1910
1911 ipsecmod-max-ttl: <seconds>
1912 Time to live maximum for A/AAAA cached records after calling the
1913 external hook. Defaults to 3600.
1914
1915 ipsecmod-ignore-bogus: <yes or no>
1916 Specifies the behaviour of unbound when the IPSECKEY answer is
1917 bogus. If set to yes, the hook will be called and the A/AAAA
1918 answer will be returned to the client. If set to no, the hook
1919 will not be called and the answer to the A/AAAA query will be
1920 SERVFAIL. Mainly used for testing. Defaults to no.
1921
1922 ipsecmod-whitelist: <domain>
1923 Whitelist the domain so that the module logic will be executed.
1924 Can be given multiple times, for different domains. If the
1925 option is not specified, all domains are treated as being
1926 whitelisted (default).
1927
1928 Cache DB Module Options
1929 The Cache DB module must be configured in the module-config: "validator
1930 cachedb iterator" directive and be compiled into the daemon with
1931 --enable-cachedb. If this module is enabled and configured, the speci‐
1932 fied backend database works as a second level cache: When Unbound can‐
1933 not find an answer to a query in its built-in in-memory cache, it con‐
1934 sults the specified backend. If it finds a valid answer in the back‐
1935 end, Unbound uses it to respond to the query without performing itera‐
1936 tive DNS resolution. If Unbound cannot even find an answer in the
1937 backend, it resolves the query as usual, and stores the answer in the
1938 backend.
1939
1940 If Unbound was built with --with-libhiredis on a system that has
1941 installed the hiredis C client library of Redis, then the "redis" back‐
1942 end can be used. This backend communicates with the specified Redis
1943 server over a TCP connection to store and retrieve cache data. It can
1944 be used as a persistent and/or shared cache backend. It should be
1945 noted that Unbound never removes data stored in the Redis server, even
1946 if some data have expired in terms of DNS TTL or the Redis server has
1947 cached too much data; if necessary the Redis server must be configured
1948 to limit the cache size, preferably with some kind of least-recently-
1949 used eviction policy. This backend uses synchronous communication with
1950 the Redis server based on the assumption that the communication is sta‐
1951 ble and sufficiently fast. The thread waiting for a response from the
1952 Redis server cannot handle other DNS queries. Although the backend has
1953 the ability to reconnect to the server when the connection is closed
1954 unexpectedly and there is a configurable timeout in case the server is
1955 overly slow or hangs up, these cases are assumed to be very rare. If
1956 connection close or timeout happens too often, Unbound will be effec‐
1957 tively unusable with this backend. It's the administrator's responsi‐
1958 bility to make the assumption hold.
1959
1960 The cachedb: clause gives custom settings of the cache DB module.
1961
1962 backend: <backend name>
1963 Specify the backend database name. The default database is the
1964 in-memory backend named "testframe", which, as the name sug‐
1965 gests, is not of any practical use. Depending on the build-time
1966 configuration, "redis" backend may also be used as described
1967 above.
1968
1969 secret-seed: <"secret string">
1970 Specify a seed to calculate a hash value from query information.
1971 This value will be used as the key of the corresponding answer
1972 for the backend database and can be customized if the hash
1973 should not be predictable operationally. If the backend data‐
1974 base is shared by multiple Unbound instances, all instances must
1975 use the same secret seed. This option defaults to "default".
1976
1977 The following cachedb otions are specific to the redis backend.
1978
1979 redis-server-host: <server address or name>
1980 The IP (either v6 or v4) address or domain name of the Redis
1981 server. In general an IP address should be specified as other‐
1982 wise Unbound will have to resolve the name of the server every
1983 time it establishes a connection to the server. This option
1984 defaults to "127.0.0.1".
1985
1986 redis-server-port: <port number>
1987 The TCP port number of the Redis server. This option defaults
1988 to 6379.
1989
1990 redis-timeout: <msec>
1991 The period until when Unbound waits for a response from the
1992 Redis sever. If this timeout expires Unbound closes the connec‐
1993 tion, treats it as if the Redis server does not have the
1994 requested data, and will try to re-establish a new connection
1995 later. This option defaults to 100 milliseconds.
1996
1998 In the example config settings below memory usage is reduced. Some ser‐
1999 vice levels are lower, notable very large data and a high TCP load are
2000 no longer supported. Very large data and high TCP loads are exceptional
2001 for the DNS. DNSSEC validation is enabled, just add trust anchors. If
2002 you do not have to worry about programs using more than 3 Mb of memory,
2003 the below example is not for you. Use the defaults to receive full ser‐
2004 vice, which on BSD-32bit tops out at 30-40 Mb after heavy usage.
2005
2006 # example settings that reduce memory usage
2007 server:
2008 num-threads: 1
2009 outgoing-num-tcp: 1 # this limits TCP service, uses less buffers.
2010 incoming-num-tcp: 1
2011 outgoing-range: 60 # uses less memory, but less performance.
2012 msg-buffer-size: 8192 # note this limits service, 'no huge stuff'.
2013 msg-cache-size: 100k
2014 msg-cache-slabs: 1
2015 rrset-cache-size: 100k
2016 rrset-cache-slabs: 1
2017 infra-cache-numhosts: 200
2018 infra-cache-slabs: 1
2019 key-cache-size: 100k
2020 key-cache-slabs: 1
2021 neg-cache-size: 10k
2022 num-queries-per-thread: 30
2023 target-fetch-policy: "2 1 0 0 0 0"
2024 harden-large-queries: "yes"
2025 harden-short-bufsize: "yes"
2026
2028 /etc/unbound
2029 default unbound working directory.
2030
2031 /etc/unbound
2032 default chroot(2) location.
2033
2034 /etc/unbound/unbound.conf
2035 unbound configuration file.
2036
2037 /var/run/unbound/unbound.pid
2038 default unbound pidfile with process ID of the running daemon.
2039
2040 unbound.log
2041 unbound log file. default is to log to syslog(3).
2042
2044 unbound(8), unbound-checkconf(8).
2045
2047 Unbound was written by NLnet Labs. Please see CREDITS file in the dis‐
2048 tribution for further details.
2049
2050
2051
2052NLnet Labs Jun 21, 2018 unbound.conf(5)