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