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