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