xref: /freebsd/contrib/unbound/doc/example.conf.in (revision 5469a9953005a9a4d4aad7be88545d441622e9a0)
1b7579f77SDag-Erling Smørgrav#
2b7579f77SDag-Erling Smørgrav# Example configuration file.
3b7579f77SDag-Erling Smørgrav#
4*5469a995SCy Schubert# See unbound.conf(5) man page, version 1.13.2.
5b7579f77SDag-Erling Smørgrav#
6b7579f77SDag-Erling Smørgrav# this is a comment.
7b7579f77SDag-Erling Smørgrav
825039b37SCy Schubert# Use this anywhere in the file to include other text into this file.
9b7579f77SDag-Erling Smørgrav#include: "otherfile.conf"
10b7579f77SDag-Erling Smørgrav
1125039b37SCy Schubert# Use this anywhere in the file to include other text, that explicitly starts a
1225039b37SCy Schubert# clause, into this file. Text after this directive needs to start a clause.
1325039b37SCy Schubert#include-toplevel: "otherfile.conf"
1425039b37SCy Schubert
15b7579f77SDag-Erling Smørgrav# The server clause sets the main parameters.
16b7579f77SDag-Erling Smørgravserver:
17b7579f77SDag-Erling Smørgrav	# whitespace is not necessary, but looks cleaner.
18b7579f77SDag-Erling Smørgrav
19b7579f77SDag-Erling Smørgrav	# verbosity number, 0 is least verbose. 1 is default.
20b7579f77SDag-Erling Smørgrav	verbosity: 1
21b7579f77SDag-Erling Smørgrav
22b7579f77SDag-Erling Smørgrav	# print statistics to the log (for every thread) every N seconds.
23b7579f77SDag-Erling Smørgrav	# Set to "" or 0 to disable. Default is disabled.
24b7579f77SDag-Erling Smørgrav	# statistics-interval: 0
25b7579f77SDag-Erling Smørgrav
2665b390aaSDag-Erling Smørgrav	# enable shm for stats, default no.  if you enable also enable
2765b390aaSDag-Erling Smørgrav	# statistics-interval, every time it also writes stats to the
2865b390aaSDag-Erling Smørgrav	# shared memory segment keyed with shm-key.
2965b390aaSDag-Erling Smørgrav	# shm-enable: no
3065b390aaSDag-Erling Smørgrav
3165b390aaSDag-Erling Smørgrav	# shm for stats uses this key, and key+1 for the shared mem segment.
3265b390aaSDag-Erling Smørgrav	# shm-key: 11777
3365b390aaSDag-Erling Smørgrav
34b7579f77SDag-Erling Smørgrav	# enable cumulative statistics, without clearing them after printing.
35b7579f77SDag-Erling Smørgrav	# statistics-cumulative: no
36b7579f77SDag-Erling Smørgrav
37b7579f77SDag-Erling Smørgrav	# enable extended statistics (query types, answer codes, status)
38b7579f77SDag-Erling Smørgrav	# printed from unbound-control. default off, because of speed.
39b7579f77SDag-Erling Smørgrav	# extended-statistics: no
40b7579f77SDag-Erling Smørgrav
41b7579f77SDag-Erling Smørgrav	# number of threads to create. 1 disables threading.
42b7579f77SDag-Erling Smørgrav	# num-threads: 1
43b7579f77SDag-Erling Smørgrav
44b7579f77SDag-Erling Smørgrav	# specify the interfaces to answer queries from by ip-address.
45b7579f77SDag-Erling Smørgrav	# The default is to listen to localhost (127.0.0.1 and ::1).
46b7579f77SDag-Erling Smørgrav	# specify 0.0.0.0 and ::0 to bind to all available interfaces.
47b7579f77SDag-Erling Smørgrav	# specify every interface[@port] on a new 'interface:' labelled line.
48b7579f77SDag-Erling Smørgrav	# The listen interfaces are not changed on reload, only on restart.
49b7579f77SDag-Erling Smørgrav	# interface: 192.0.2.153
50b7579f77SDag-Erling Smørgrav	# interface: 192.0.2.154
51b7579f77SDag-Erling Smørgrav	# interface: 192.0.2.154@5003
52b7579f77SDag-Erling Smørgrav	# interface: 2001:DB8::5
53b7579f77SDag-Erling Smørgrav
54b7579f77SDag-Erling Smørgrav	# enable this feature to copy the source address of queries to reply.
55b7579f77SDag-Erling Smørgrav	# Socket options are not supported on all platforms. experimental.
56b7579f77SDag-Erling Smørgrav	# interface-automatic: no
57b7579f77SDag-Erling Smørgrav
58b7579f77SDag-Erling Smørgrav	# port to answer queries from
59b7579f77SDag-Erling Smørgrav	# port: 53
60b7579f77SDag-Erling Smørgrav
61b7579f77SDag-Erling Smørgrav	# specify the interfaces to send outgoing queries to authoritative
62b7579f77SDag-Erling Smørgrav	# server from by ip-address. If none, the default (all) interface
63b7579f77SDag-Erling Smørgrav	# is used. Specify every interface on a 'outgoing-interface:' line.
64b7579f77SDag-Erling Smørgrav	# outgoing-interface: 192.0.2.153
65b7579f77SDag-Erling Smørgrav	# outgoing-interface: 2001:DB8::5
66b7579f77SDag-Erling Smørgrav	# outgoing-interface: 2001:DB8::6
67b7579f77SDag-Erling Smørgrav
68b5663de9SDag-Erling Smørgrav	# Specify a netblock to use remainder 64 bits as random bits for
69b5663de9SDag-Erling Smørgrav	# upstream queries.  Uses freebind option (Linux).
70b5663de9SDag-Erling Smørgrav	# outgoing-interface: 2001:DB8::/64
71b5663de9SDag-Erling Smørgrav	# Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo
72b5663de9SDag-Erling Smørgrav	# And: ip -6 route add local 2001:db8::/64 dev lo
73b5663de9SDag-Erling Smørgrav	# And set prefer-ip6: yes to use the ip6 randomness from a netblock.
74b5663de9SDag-Erling Smørgrav	# Set this to yes to prefer ipv6 upstream servers over ipv4.
75b5663de9SDag-Erling Smørgrav	# prefer-ip6: no
76b5663de9SDag-Erling Smørgrav
7725039b37SCy Schubert	# Prefer ipv4 upstream servers, even if ipv6 is available.
7825039b37SCy Schubert	# prefer-ip4: no
7925039b37SCy Schubert
80b7579f77SDag-Erling Smørgrav	# number of ports to allocate per thread, determines the size of the
81b7579f77SDag-Erling Smørgrav	# port range that can be open simultaneously.  About double the
82b7579f77SDag-Erling Smørgrav	# num-queries-per-thread, or, use as many as the OS will allow you.
83b7579f77SDag-Erling Smørgrav	# outgoing-range: 4096
84b7579f77SDag-Erling Smørgrav
85b7579f77SDag-Erling Smørgrav	# permit unbound to use this port number or port range for
86b7579f77SDag-Erling Smørgrav	# making outgoing queries, using an outgoing interface.
87b7579f77SDag-Erling Smørgrav	# outgoing-port-permit: 32768
88b7579f77SDag-Erling Smørgrav
89b7579f77SDag-Erling Smørgrav	# deny unbound the use this of port number or port range for
90b7579f77SDag-Erling Smørgrav	# making outgoing queries, using an outgoing interface.
91b7579f77SDag-Erling Smørgrav	# Use this to make sure unbound does not grab a UDP port that some
92b7579f77SDag-Erling Smørgrav	# other server on this computer needs. The default is to avoid
93b7579f77SDag-Erling Smørgrav	# IANA-assigned port numbers.
948ed2b524SDag-Erling Smørgrav	# If multiple outgoing-port-permit and outgoing-port-avoid options
958ed2b524SDag-Erling Smørgrav	# are present, they are processed in order.
96b7579f77SDag-Erling Smørgrav	# outgoing-port-avoid: "3200-3208"
97b7579f77SDag-Erling Smørgrav
98b7579f77SDag-Erling Smørgrav	# number of outgoing simultaneous tcp buffers to hold per thread.
99b7579f77SDag-Erling Smørgrav	# outgoing-num-tcp: 10
100b7579f77SDag-Erling Smørgrav
101b7579f77SDag-Erling Smørgrav	# number of incoming simultaneous tcp buffers to hold per thread.
102b7579f77SDag-Erling Smørgrav	# incoming-num-tcp: 10
103b7579f77SDag-Erling Smørgrav
104b7579f77SDag-Erling Smørgrav	# buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
105b7579f77SDag-Erling Smørgrav	# 0 is system default.  Use 4m to catch query spikes for busy servers.
106b7579f77SDag-Erling Smørgrav	# so-rcvbuf: 0
107b7579f77SDag-Erling Smørgrav
108b7579f77SDag-Erling Smørgrav	# buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
109b7579f77SDag-Erling Smørgrav	# 0 is system default.  Use 4m to handle spikes on very busy servers.
110b7579f77SDag-Erling Smørgrav	# so-sndbuf: 0
111b7579f77SDag-Erling Smørgrav
112ff825849SDag-Erling Smørgrav	# use SO_REUSEPORT to distribute queries over threads.
113e86b9096SDag-Erling Smørgrav	# at extreme load it could be better to turn it off to distribute even.
1144c75e3aaSDag-Erling Smørgrav	# so-reuseport: yes
11517d15b25SDag-Erling Smørgrav
11609a3aaf3SDag-Erling Smørgrav	# use IP_TRANSPARENT so the interface: addresses can be non-local
11709a3aaf3SDag-Erling Smørgrav	# and you can config non-existing IPs that are going to work later on
118f61ef7f6SDag-Erling Smørgrav	# (uses IP_BINDANY on FreeBSD).
11909a3aaf3SDag-Erling Smørgrav	# ip-transparent: no
12009a3aaf3SDag-Erling Smørgrav
121e2d15004SDag-Erling Smørgrav	# use IP_FREEBIND so the interface: addresses can be non-local
122e2d15004SDag-Erling Smørgrav	# and you can bind to nonexisting IPs and interfaces that are down.
123e2d15004SDag-Erling Smørgrav	# Linux only.  On Linux you also have ip-transparent that is similar.
124e2d15004SDag-Erling Smørgrav	# ip-freebind: no
125e2d15004SDag-Erling Smørgrav
12625039b37SCy Schubert	# the value of the Differentiated Services Codepoint (DSCP)
12725039b37SCy Schubert	# in the differentiated services field (DS) of the outgoing
12825039b37SCy Schubert	# IP packets
12925039b37SCy Schubert	# ip-dscp: 0
13025039b37SCy Schubert
131b7579f77SDag-Erling Smørgrav	# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
132c0caa2e2SCy Schubert	# is set with msg-buffer-size).
133c0caa2e2SCy Schubert	# edns-buffer-size: 1232
134b7579f77SDag-Erling Smørgrav
13517d15b25SDag-Erling Smørgrav	# Maximum UDP response size (not applied to TCP response).
13617d15b25SDag-Erling Smørgrav	# Suggested values are 512 to 4096. Default is 4096. 65536 disables it.
13717d15b25SDag-Erling Smørgrav	# max-udp-size: 4096
13817d15b25SDag-Erling Smørgrav
139e86b9096SDag-Erling Smørgrav	# max memory to use for stream(tcp and tls) waiting result buffers.
140e86b9096SDag-Erling Smørgrav	# stream-wait-size: 4m
141e86b9096SDag-Erling Smørgrav
142b7579f77SDag-Erling Smørgrav	# buffer size for handling DNS data. No messages larger than this
143b7579f77SDag-Erling Smørgrav	# size can be sent or received, by UDP or TCP. In bytes.
144b7579f77SDag-Erling Smørgrav	# msg-buffer-size: 65552
145b7579f77SDag-Erling Smørgrav
146b7579f77SDag-Erling Smørgrav	# the amount of memory to use for the message cache.
147b7579f77SDag-Erling Smørgrav	# plain value in bytes or you can append k, m or G. default is "4Mb".
148b7579f77SDag-Erling Smørgrav	# msg-cache-size: 4m
149b7579f77SDag-Erling Smørgrav
150b7579f77SDag-Erling Smørgrav	# the number of slabs to use for the message cache.
151b7579f77SDag-Erling Smørgrav	# the number of slabs must be a power of 2.
152b7579f77SDag-Erling Smørgrav	# more slabs reduce lock contention, but fragment memory usage.
153b7579f77SDag-Erling Smørgrav	# msg-cache-slabs: 4
154b7579f77SDag-Erling Smørgrav
155b7579f77SDag-Erling Smørgrav	# the number of queries that a thread gets to service.
156b7579f77SDag-Erling Smørgrav	# num-queries-per-thread: 1024
157b7579f77SDag-Erling Smørgrav
158b7579f77SDag-Erling Smørgrav	# if very busy, 50% queries run to completion, 50% get timeout in msec
159b7579f77SDag-Erling Smørgrav	# jostle-timeout: 200
160b7579f77SDag-Erling Smørgrav
16117d15b25SDag-Erling Smørgrav	# msec to wait before close of port on timeout UDP. 0 disables.
16217d15b25SDag-Erling Smørgrav	# delay-close: 0
16317d15b25SDag-Erling Smørgrav
164369c6923SCy Schubert	# perform connect for UDP sockets to mitigate ICMP side channel.
165369c6923SCy Schubert	# udp-connect: yes
166369c6923SCy Schubert
167e86b9096SDag-Erling Smørgrav	# msec for waiting for an unknown server to reply.  Increase if you
168e86b9096SDag-Erling Smørgrav	# are behind a slow satellite link, to eg. 1128.
169e86b9096SDag-Erling Smørgrav	# unknown-server-time-limit: 376
170e86b9096SDag-Erling Smørgrav
171b7579f77SDag-Erling Smørgrav	# the amount of memory to use for the RRset cache.
172b7579f77SDag-Erling Smørgrav	# plain value in bytes or you can append k, m or G. default is "4Mb".
173b7579f77SDag-Erling Smørgrav	# rrset-cache-size: 4m
174b7579f77SDag-Erling Smørgrav
175b7579f77SDag-Erling Smørgrav	# the number of slabs to use for the RRset cache.
176b7579f77SDag-Erling Smørgrav	# the number of slabs must be a power of 2.
177b7579f77SDag-Erling Smørgrav	# more slabs reduce lock contention, but fragment memory usage.
178b7579f77SDag-Erling Smørgrav	# rrset-cache-slabs: 4
179b7579f77SDag-Erling Smørgrav
180b7579f77SDag-Erling Smørgrav	# the time to live (TTL) value lower bound, in seconds. Default 0.
181b7579f77SDag-Erling Smørgrav	# If more than an hour could easily give trouble due to stale data.
182b7579f77SDag-Erling Smørgrav	# cache-min-ttl: 0
183b7579f77SDag-Erling Smørgrav
184b7579f77SDag-Erling Smørgrav	# the time to live (TTL) value cap for RRsets and messages in the
185b7579f77SDag-Erling Smørgrav	# cache. Items are not cached for longer. In seconds.
186b7579f77SDag-Erling Smørgrav	# cache-max-ttl: 86400
187b7579f77SDag-Erling Smørgrav
18809a3aaf3SDag-Erling Smørgrav	# the time to live (TTL) value cap for negative responses in the cache
18909a3aaf3SDag-Erling Smørgrav	# cache-max-negative-ttl: 3600
19009a3aaf3SDag-Erling Smørgrav
191b7579f77SDag-Erling Smørgrav	# the time to live (TTL) value for cached roundtrip times, lameness and
192b7579f77SDag-Erling Smørgrav	# EDNS version information for hosts. In seconds.
193b7579f77SDag-Erling Smørgrav	# infra-host-ttl: 900
194b7579f77SDag-Erling Smørgrav
1956480faa8SDag-Erling Smørgrav	# minimum wait time for responses, increase if uplink is long. In msec.
1966480faa8SDag-Erling Smørgrav	# infra-cache-min-rtt: 50
1976480faa8SDag-Erling Smørgrav
198369c6923SCy Schubert	# enable to make server probe down hosts more frequently.
199369c6923SCy Schubert	# infra-keep-probing: no
200369c6923SCy Schubert
201b7579f77SDag-Erling Smørgrav	# the number of slabs to use for the Infrastructure cache.
202b7579f77SDag-Erling Smørgrav	# the number of slabs must be a power of 2.
203b7579f77SDag-Erling Smørgrav	# more slabs reduce lock contention, but fragment memory usage.
204b7579f77SDag-Erling Smørgrav	# infra-cache-slabs: 4
205b7579f77SDag-Erling Smørgrav
206b7579f77SDag-Erling Smørgrav	# the maximum number of hosts that are cached (roundtrip, EDNS, lame).
207b7579f77SDag-Erling Smørgrav	# infra-cache-numhosts: 10000
208b7579f77SDag-Erling Smørgrav
209b5663de9SDag-Erling Smørgrav	# define a number of tags here, use with local-zone, access-control.
210b5663de9SDag-Erling Smørgrav	# repeat the define-tag statement to add additional tags.
211b5663de9SDag-Erling Smørgrav	# define-tag: "tag1 tag2 tag3"
212b5663de9SDag-Erling Smørgrav
213b7579f77SDag-Erling Smørgrav	# Enable IPv4, "yes" or "no".
214b7579f77SDag-Erling Smørgrav	# do-ip4: yes
215b7579f77SDag-Erling Smørgrav
216b7579f77SDag-Erling Smørgrav	# Enable IPv6, "yes" or "no".
217b7579f77SDag-Erling Smørgrav	# do-ip6: yes
218b7579f77SDag-Erling Smørgrav
219b7579f77SDag-Erling Smørgrav	# Enable UDP, "yes" or "no".
220b7579f77SDag-Erling Smørgrav	# do-udp: yes
221b7579f77SDag-Erling Smørgrav
222b7579f77SDag-Erling Smørgrav	# Enable TCP, "yes" or "no".
223b7579f77SDag-Erling Smørgrav	# do-tcp: yes
224b7579f77SDag-Erling Smørgrav
225b7579f77SDag-Erling Smørgrav	# upstream connections use TCP only (and no UDP), "yes" or "no"
226b7579f77SDag-Erling Smørgrav	# useful for tunneling scenarios, default no.
227b7579f77SDag-Erling Smørgrav	# tcp-upstream: no
228b7579f77SDag-Erling Smørgrav
2298a384985SDag-Erling Smørgrav	# upstream connections also use UDP (even if do-udp is no).
2308a384985SDag-Erling Smørgrav	# useful if if you want UDP upstream, but don't provide UDP downstream.
2318a384985SDag-Erling Smørgrav	# udp-upstream-without-downstream: no
2328a384985SDag-Erling Smørgrav
233f61ef7f6SDag-Erling Smørgrav	# Maximum segment size (MSS) of TCP socket on which the server
234f61ef7f6SDag-Erling Smørgrav	# responds to queries. Default is 0, system default MSS.
235f61ef7f6SDag-Erling Smørgrav	# tcp-mss: 0
236f61ef7f6SDag-Erling Smørgrav
237f61ef7f6SDag-Erling Smørgrav	# Maximum segment size (MSS) of TCP socket for outgoing queries.
238f61ef7f6SDag-Erling Smørgrav	# Default is 0, system default MSS.
239f61ef7f6SDag-Erling Smørgrav	# outgoing-tcp-mss: 0
240f61ef7f6SDag-Erling Smørgrav
2414c75e3aaSDag-Erling Smørgrav	# Idle TCP timeout, connection closed in milliseconds
2424c75e3aaSDag-Erling Smørgrav	# tcp-idle-timeout: 30000
2434c75e3aaSDag-Erling Smørgrav
2444c75e3aaSDag-Erling Smørgrav	# Enable EDNS TCP keepalive option.
2454c75e3aaSDag-Erling Smørgrav	# edns-tcp-keepalive: no
2464c75e3aaSDag-Erling Smørgrav
2474c75e3aaSDag-Erling Smørgrav	# Timeout for EDNS TCP keepalive, in msec.
2484c75e3aaSDag-Erling Smørgrav	# edns-tcp-keepalive-timeout: 120000
2494c75e3aaSDag-Erling Smørgrav
2503005e0a3SDag-Erling Smørgrav	# Use systemd socket activation for UDP, TCP, and control sockets.
2513005e0a3SDag-Erling Smørgrav	# use-systemd: no
2523005e0a3SDag-Erling Smørgrav
253b7579f77SDag-Erling Smørgrav	# Detach from the terminal, run in background, "yes" or "no".
2543005e0a3SDag-Erling Smørgrav	# Set the value to "no" when unbound runs as systemd service.
255b7579f77SDag-Erling Smørgrav	# do-daemonize: yes
256b7579f77SDag-Erling Smørgrav
257b7579f77SDag-Erling Smørgrav	# control which clients are allowed to make (recursive) queries
258b7579f77SDag-Erling Smørgrav	# to this server. Specify classless netblocks with /size and action.
259b7579f77SDag-Erling Smørgrav	# By default everything is refused, except for localhost.
260b7579f77SDag-Erling Smørgrav	# Choose deny (drop message), refuse (polite error reply),
2613bd4df0aSDag-Erling Smørgrav	# allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on),
2623bd4df0aSDag-Erling Smørgrav	# allow_snoop (recursive and nonrecursive ok)
26317d15b25SDag-Erling Smørgrav	# deny_non_local (drop queries unless can be answered from local-data)
26417d15b25SDag-Erling Smørgrav	# refuse_non_local (like deny_non_local but polite error reply).
265b7579f77SDag-Erling Smørgrav	# access-control: 0.0.0.0/0 refuse
266b7579f77SDag-Erling Smørgrav	# access-control: 127.0.0.0/8 allow
267b7579f77SDag-Erling Smørgrav	# access-control: ::0/0 refuse
268b7579f77SDag-Erling Smørgrav	# access-control: ::1 allow
269b7579f77SDag-Erling Smørgrav	# access-control: ::ffff:127.0.0.1 allow
270b7579f77SDag-Erling Smørgrav
271b5663de9SDag-Erling Smørgrav	# tag access-control with list of tags (in "" with spaces between)
272b5663de9SDag-Erling Smørgrav	# Clients using this access control element use localzones that
273b5663de9SDag-Erling Smørgrav	# are tagged with one of these tags.
274b5663de9SDag-Erling Smørgrav	# access-control-tag: 192.0.2.0/24 "tag2 tag3"
275b5663de9SDag-Erling Smørgrav
276b5663de9SDag-Erling Smørgrav	# set action for particular tag for given access control element
277b5663de9SDag-Erling Smørgrav	# if you have multiple tag values, the tag used to lookup the action
278b5663de9SDag-Erling Smørgrav	# is the first tag match between access-control-tag and local-zone-tag
279b5663de9SDag-Erling Smørgrav	# where "first" comes from the order of the define-tag values.
280b5663de9SDag-Erling Smørgrav	# access-control-tag-action: 192.0.2.0/24 tag3 refuse
281b5663de9SDag-Erling Smørgrav
282b5663de9SDag-Erling Smørgrav	# set redirect data for particular tag for access control element
283b5663de9SDag-Erling Smørgrav	# access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1"
284b5663de9SDag-Erling Smørgrav
285bc892140SDag-Erling Smørgrav	# Set view for access control element
286bc892140SDag-Erling Smørgrav	# access-control-view: 192.0.2.0/24 viewname
287bc892140SDag-Erling Smørgrav
288b7579f77SDag-Erling Smørgrav	# if given, a chroot(2) is done to the given directory.
289b7579f77SDag-Erling Smørgrav	# i.e. you can chroot to the working directory, for example,
290b7579f77SDag-Erling Smørgrav	# for extra security, but make sure all files are in that directory.
291b7579f77SDag-Erling Smørgrav	#
292b7579f77SDag-Erling Smørgrav	# If chroot is enabled, you should pass the configfile (from the
293b7579f77SDag-Erling Smørgrav	# commandline) as a full path from the original root. After the
294b7579f77SDag-Erling Smørgrav	# chroot has been performed the now defunct portion of the config
295b7579f77SDag-Erling Smørgrav	# file path is removed to be able to reread the config after a reload.
296b7579f77SDag-Erling Smørgrav	#
297b7579f77SDag-Erling Smørgrav	# All other file paths (working dir, logfile, roothints, and
298b7579f77SDag-Erling Smørgrav	# key files) can be specified in several ways:
299b7579f77SDag-Erling Smørgrav	# 	o as an absolute path relative to the new root.
300b7579f77SDag-Erling Smørgrav	# 	o as a relative path to the working directory.
301b7579f77SDag-Erling Smørgrav	# 	o as an absolute path relative to the original root.
302b7579f77SDag-Erling Smørgrav	# In the last case the path is adjusted to remove the unused portion.
303b7579f77SDag-Erling Smørgrav	#
304b7579f77SDag-Erling Smørgrav	# The pid file can be absolute and outside of the chroot, it is
305b7579f77SDag-Erling Smørgrav	# written just prior to performing the chroot and dropping permissions.
306b7579f77SDag-Erling Smørgrav	#
3070eefd307SCy Schubert	# Additionally, unbound may need to access /dev/urandom (for entropy).
308b7579f77SDag-Erling Smørgrav	# How to do this is specific to your OS.
309b7579f77SDag-Erling Smørgrav	#
310b7579f77SDag-Erling Smørgrav	# If you give "" no chroot is performed. The path must not end in a /.
311b7579f77SDag-Erling Smørgrav	# chroot: "@UNBOUND_CHROOT_DIR@"
312b7579f77SDag-Erling Smørgrav
313b7579f77SDag-Erling Smørgrav	# if given, user privileges are dropped (after binding port),
314b7579f77SDag-Erling Smørgrav	# and the given username is assumed. Default is user "unbound".
315b7579f77SDag-Erling Smørgrav	# If you give "" no privileges are dropped.
316b7579f77SDag-Erling Smørgrav	# username: "@UNBOUND_USERNAME@"
317b7579f77SDag-Erling Smørgrav
318b7579f77SDag-Erling Smørgrav	# the working directory. The relative files in this config are
319b7579f77SDag-Erling Smørgrav	# relative to this directory. If you give "" the working directory
320b7579f77SDag-Erling Smørgrav	# is not changed.
321b5663de9SDag-Erling Smørgrav	# If you give a server: directory: dir before include: file statements
322b5663de9SDag-Erling Smørgrav	# then those includes can be relative to the working directory.
323b7579f77SDag-Erling Smørgrav	# directory: "@UNBOUND_RUN_DIR@"
324b7579f77SDag-Erling Smørgrav
325b7579f77SDag-Erling Smørgrav	# the log file, "" means log to stderr.
326b7579f77SDag-Erling Smørgrav	# Use of this option sets use-syslog to "no".
327b7579f77SDag-Erling Smørgrav	# logfile: ""
328b7579f77SDag-Erling Smørgrav
329b7579f77SDag-Erling Smørgrav	# Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
330bc892140SDag-Erling Smørgrav	# log to. If yes, it overrides the logfile.
331b7579f77SDag-Erling Smørgrav	# use-syslog: yes
332b7579f77SDag-Erling Smørgrav
333bc892140SDag-Erling Smørgrav	# Log identity to report. if empty, defaults to the name of argv[0]
334bc892140SDag-Erling Smørgrav	# (usually "unbound").
335bc892140SDag-Erling Smørgrav	# log-identity: ""
336bc892140SDag-Erling Smørgrav
337b7579f77SDag-Erling Smørgrav	# print UTC timestamp in ascii to logfile, default is epoch in seconds.
338b7579f77SDag-Erling Smørgrav	# log-time-ascii: no
339b7579f77SDag-Erling Smørgrav
340b7579f77SDag-Erling Smørgrav	# print one line with time, IP, name, type, class for every query.
341b7579f77SDag-Erling Smørgrav	# log-queries: no
342b7579f77SDag-Erling Smørgrav
3433005e0a3SDag-Erling Smørgrav	# print one line per reply, with time, IP, name, type, class, rcode,
3443005e0a3SDag-Erling Smørgrav	# timetoresolve, fromcache and responsesize.
3453005e0a3SDag-Erling Smørgrav	# log-replies: no
3463005e0a3SDag-Erling Smørgrav
347e86b9096SDag-Erling Smørgrav	# log with tag 'query' and 'reply' instead of 'info' for
348e86b9096SDag-Erling Smørgrav	# filtering log-queries and log-replies from the log.
349e86b9096SDag-Erling Smørgrav	# log-tag-queryreply: no
350e86b9096SDag-Erling Smørgrav
3514c75e3aaSDag-Erling Smørgrav	# log the local-zone actions, like local-zone type inform is enabled
3524c75e3aaSDag-Erling Smørgrav	# also for the other local zone types.
3534c75e3aaSDag-Erling Smørgrav	# log-local-actions: no
3544c75e3aaSDag-Erling Smørgrav
3554c75e3aaSDag-Erling Smørgrav	# print log lines that say why queries return SERVFAIL to clients.
3564c75e3aaSDag-Erling Smørgrav	# log-servfail: no
3574c75e3aaSDag-Erling Smørgrav
358b7579f77SDag-Erling Smørgrav	# the pid file. Can be an absolute path outside of chroot/work dir.
359b7579f77SDag-Erling Smørgrav	# pidfile: "@UNBOUND_PIDFILE@"
360b7579f77SDag-Erling Smørgrav
361b7579f77SDag-Erling Smørgrav	# file to read root hints from.
36205ab2901SDag-Erling Smørgrav	# get one from https://www.internic.net/domain/named.cache
363b7579f77SDag-Erling Smørgrav	# root-hints: ""
364b7579f77SDag-Erling Smørgrav
365b7579f77SDag-Erling Smørgrav	# enable to not answer id.server and hostname.bind queries.
366b7579f77SDag-Erling Smørgrav	# hide-identity: no
367b7579f77SDag-Erling Smørgrav
368b7579f77SDag-Erling Smørgrav	# enable to not answer version.server and version.bind queries.
369b7579f77SDag-Erling Smørgrav	# hide-version: no
370b7579f77SDag-Erling Smørgrav
37165b390aaSDag-Erling Smørgrav	# enable to not answer trustanchor.unbound queries.
37265b390aaSDag-Erling Smørgrav	# hide-trustanchor: no
37365b390aaSDag-Erling Smørgrav
374*5469a995SCy Schubert	# enable to not set the User-Agent HTTP header.
375*5469a995SCy Schubert	# hide-http-user-agent: no
376*5469a995SCy Schubert
377b7579f77SDag-Erling Smørgrav	# the identity to report. Leave "" or default to return hostname.
378b7579f77SDag-Erling Smørgrav	# identity: ""
379b7579f77SDag-Erling Smørgrav
380b7579f77SDag-Erling Smørgrav	# the version to report. Leave "" or default to return package version.
381b7579f77SDag-Erling Smørgrav	# version: ""
382b7579f77SDag-Erling Smørgrav
383f44e67d1SCy Schubert	# NSID identity (hex string, or "ascii_somestring"). default disabled.
384f44e67d1SCy Schubert	# nsid: "aabbccdd"
385f44e67d1SCy Schubert
386*5469a995SCy Schubert	# User-Agent HTTP header to use. Leave "" or default to use package name
387*5469a995SCy Schubert	# and version.
388*5469a995SCy Schubert	# http-user-agent: ""
389*5469a995SCy Schubert
390b7579f77SDag-Erling Smørgrav	# the target fetch policy.
391b7579f77SDag-Erling Smørgrav	# series of integers describing the policy per dependency depth.
392b7579f77SDag-Erling Smørgrav	# The number of values in the list determines the maximum dependency
393b7579f77SDag-Erling Smørgrav	# depth the recursor will pursue before giving up. Each integer means:
394b7579f77SDag-Erling Smørgrav	# 	-1 : fetch all targets opportunistically,
395b7579f77SDag-Erling Smørgrav	# 	0: fetch on demand,
396b7579f77SDag-Erling Smørgrav	#	positive value: fetch that many targets opportunistically.
397b7579f77SDag-Erling Smørgrav	# Enclose the list of numbers between quotes ("").
398b7579f77SDag-Erling Smørgrav	# target-fetch-policy: "3 2 1 0 0"
399b7579f77SDag-Erling Smørgrav
400b7579f77SDag-Erling Smørgrav	# Harden against very small EDNS buffer sizes.
401f44e67d1SCy Schubert	# harden-short-bufsize: yes
402b7579f77SDag-Erling Smørgrav
403b7579f77SDag-Erling Smørgrav	# Harden against unseemly large queries.
404b7579f77SDag-Erling Smørgrav	# harden-large-queries: no
405b7579f77SDag-Erling Smørgrav
406b7579f77SDag-Erling Smørgrav	# Harden against out of zone rrsets, to avoid spoofing attempts.
407b7579f77SDag-Erling Smørgrav	# harden-glue: yes
408b7579f77SDag-Erling Smørgrav
409b7579f77SDag-Erling Smørgrav	# Harden against receiving dnssec-stripped data. If you turn it
410b7579f77SDag-Erling Smørgrav	# off, failing to validate dnskey data for a trustanchor will
411b7579f77SDag-Erling Smørgrav	# trigger insecure mode for that zone (like without a trustanchor).
412b7579f77SDag-Erling Smørgrav	# Default on, which insists on dnssec data for trust-anchored zones.
413b7579f77SDag-Erling Smørgrav	# harden-dnssec-stripped: yes
414b7579f77SDag-Erling Smørgrav
415b7579f77SDag-Erling Smørgrav	# Harden against queries that fall under dnssec-signed nxdomain names.
4164c75e3aaSDag-Erling Smørgrav	# harden-below-nxdomain: yes
417b7579f77SDag-Erling Smørgrav
418b7579f77SDag-Erling Smørgrav	# Harden the referral path by performing additional queries for
419b7579f77SDag-Erling Smørgrav	# infrastructure data.  Validates the replies (if possible).
420b7579f77SDag-Erling Smørgrav	# Default off, because the lookups burden the server.  Experimental
421b7579f77SDag-Erling Smørgrav	# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
422b7579f77SDag-Erling Smørgrav	# harden-referral-path: no
423b7579f77SDag-Erling Smørgrav
42409a3aaf3SDag-Erling Smørgrav	# Harden against algorithm downgrade when multiple algorithms are
42509a3aaf3SDag-Erling Smørgrav	# advertised in the DS record.  If no, allows the weakest algorithm
42609a3aaf3SDag-Erling Smørgrav	# to validate the zone.
427b75612f8SDag-Erling Smørgrav	# harden-algo-downgrade: no
42809a3aaf3SDag-Erling Smørgrav
42905ab2901SDag-Erling Smørgrav	# Sent minimum amount of information to upstream servers to enhance
43005ab2901SDag-Erling Smørgrav	# privacy. Only sent minimum required labels of the QNAME and set QTYPE
43157bddd21SDag-Erling Smørgrav	# to A when possible.
4323bd4df0aSDag-Erling Smørgrav	# qname-minimisation: yes
43305ab2901SDag-Erling Smørgrav
434bc892140SDag-Erling Smørgrav	# QNAME minimisation in strict mode. Do not fall-back to sending full
435bc892140SDag-Erling Smørgrav	# QNAME to potentially broken nameservers. A lot of domains will not be
436bc892140SDag-Erling Smørgrav	# resolvable when this option in enabled.
437bc892140SDag-Erling Smørgrav	# This option only has effect when qname-minimisation is enabled.
438bc892140SDag-Erling Smørgrav	# qname-minimisation-strict: no
439bc892140SDag-Erling Smørgrav
44057bddd21SDag-Erling Smørgrav	# Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN
44157bddd21SDag-Erling Smørgrav	# and other denials, using information from previous NXDOMAINs answers.
44257bddd21SDag-Erling Smørgrav	# aggressive-nsec: no
44357bddd21SDag-Erling Smørgrav
444b7579f77SDag-Erling Smørgrav	# Use 0x20-encoded random bits in the query to foil spoof attempts.
445b7579f77SDag-Erling Smørgrav	# This feature is an experimental implementation of draft dns-0x20.
446b7579f77SDag-Erling Smørgrav	# use-caps-for-id: no
447b7579f77SDag-Erling Smørgrav
44809a3aaf3SDag-Erling Smørgrav	# Domains (and domains in them) without support for dns-0x20 and
44909a3aaf3SDag-Erling Smørgrav	# the fallback fails because they keep sending different answers.
450c0caa2e2SCy Schubert	# caps-exempt: "licdn.com"
451c0caa2e2SCy Schubert	# caps-exempt: "senderbase.org"
45209a3aaf3SDag-Erling Smørgrav
453b7579f77SDag-Erling Smørgrav	# Enforce privacy of these addresses. Strips them away from answers.
454b7579f77SDag-Erling Smørgrav	# It may cause DNSSEC validation to additionally mark it as bogus.
455b7579f77SDag-Erling Smørgrav	# Protects against 'DNS Rebinding' (uses browser as network proxy).
456b7579f77SDag-Erling Smørgrav	# Only 'private-domain' and 'local-data' names are allowed to have
457b7579f77SDag-Erling Smørgrav	# these private addresses. No default.
458b7579f77SDag-Erling Smørgrav	# private-address: 10.0.0.0/8
459b7579f77SDag-Erling Smørgrav	# private-address: 172.16.0.0/12
460b7579f77SDag-Erling Smørgrav	# private-address: 192.168.0.0/16
461b7579f77SDag-Erling Smørgrav	# private-address: 169.254.0.0/16
462b7579f77SDag-Erling Smørgrav	# private-address: fd00::/8
463b7579f77SDag-Erling Smørgrav	# private-address: fe80::/10
46405ab2901SDag-Erling Smørgrav	# private-address: ::ffff:0:0/96
465b7579f77SDag-Erling Smørgrav
466b7579f77SDag-Erling Smørgrav	# Allow the domain (and its subdomains) to contain private addresses.
467b7579f77SDag-Erling Smørgrav	# local-data statements are allowed to contain private addresses too.
468b7579f77SDag-Erling Smørgrav	# private-domain: "example.com"
469b7579f77SDag-Erling Smørgrav
470b7579f77SDag-Erling Smørgrav	# If nonzero, unwanted replies are not only reported in statistics,
471b7579f77SDag-Erling Smørgrav	# but also a running total is kept per thread. If it reaches the
472b7579f77SDag-Erling Smørgrav	# threshold, a warning is printed and a defensive action is taken,
473b7579f77SDag-Erling Smørgrav	# the cache is cleared to flush potential poison out of it.
474b7579f77SDag-Erling Smørgrav	# A suggested value is 10000000, the default is 0 (turned off).
475b7579f77SDag-Erling Smørgrav	# unwanted-reply-threshold: 0
476b7579f77SDag-Erling Smørgrav
477b7579f77SDag-Erling Smørgrav	# Do not query the following addresses. No DNS queries are sent there.
478b7579f77SDag-Erling Smørgrav	# List one address per entry. List classless netblocks with /size,
479b7579f77SDag-Erling Smørgrav	# do-not-query-address: 127.0.0.1/8
480b7579f77SDag-Erling Smørgrav	# do-not-query-address: ::1
481b7579f77SDag-Erling Smørgrav
482b7579f77SDag-Erling Smørgrav	# if yes, the above default do-not-query-address entries are present.
483b7579f77SDag-Erling Smørgrav	# if no, localhost can be queried (for testing and debugging).
484b7579f77SDag-Erling Smørgrav	# do-not-query-localhost: yes
485b7579f77SDag-Erling Smørgrav
486b7579f77SDag-Erling Smørgrav	# if yes, perform prefetching of almost expired message cache entries.
487b7579f77SDag-Erling Smørgrav	# prefetch: no
488b7579f77SDag-Erling Smørgrav
489b7579f77SDag-Erling Smørgrav	# if yes, perform key lookups adjacent to normal lookups.
490b7579f77SDag-Erling Smørgrav	# prefetch-key: no
491b7579f77SDag-Erling Smørgrav
492e86b9096SDag-Erling Smørgrav	# deny queries of type ANY with an empty response.
493e86b9096SDag-Erling Smørgrav	# deny-any: no
494e86b9096SDag-Erling Smørgrav
495b7579f77SDag-Erling Smørgrav	# if yes, Unbound rotates RRSet order in response.
49625039b37SCy Schubert	# rrset-roundrobin: yes
497b7579f77SDag-Erling Smørgrav
498b7579f77SDag-Erling Smørgrav	# if yes, Unbound doesn't insert authority/additional sections
499b7579f77SDag-Erling Smørgrav	# into response messages when those sections are not required.
5004c75e3aaSDag-Erling Smørgrav	# minimal-responses: yes
501b7579f77SDag-Erling Smørgrav
502e2d15004SDag-Erling Smørgrav	# true to disable DNSSEC lameness check in iterator.
503e2d15004SDag-Erling Smørgrav	# disable-dnssec-lame-check: no
504e2d15004SDag-Erling Smørgrav
505b7579f77SDag-Erling Smørgrav	# module configuration of the server. A string with identifiers
506ff825849SDag-Erling Smørgrav	# separated by spaces. Syntax: "[dns64] [validator] iterator"
507e86b9096SDag-Erling Smørgrav	# most modules have to be listed at the beginning of the line,
508e86b9096SDag-Erling Smørgrav	# except cachedb(just before iterator), and python (at the beginning,
509e86b9096SDag-Erling Smørgrav	# or, just before the iterator).
510b7579f77SDag-Erling Smørgrav	# module-config: "validator iterator"
511b7579f77SDag-Erling Smørgrav
512b7579f77SDag-Erling Smørgrav	# File with trusted keys, kept uptodate using RFC5011 probes,
513b7579f77SDag-Erling Smørgrav	# initial file like trust-anchor-file, then it stores metadata.
514b7579f77SDag-Erling Smørgrav	# Use several entries, one per domain name, to track multiple zones.
515b7579f77SDag-Erling Smørgrav	#
516b7579f77SDag-Erling Smørgrav	# If you want to perform DNSSEC validation, run unbound-anchor before
517*5469a995SCy Schubert	# you start unbound (i.e. in the system boot scripts).
518*5469a995SCy Schubert	# And then enable the auto-trust-anchor-file config item.
519b7579f77SDag-Erling Smørgrav	# Please note usage of unbound-anchor root anchor is at your own risk
520b7579f77SDag-Erling Smørgrav	# and under the terms of our LICENSE (see that file in the source).
521b7579f77SDag-Erling Smørgrav	# auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
522b7579f77SDag-Erling Smørgrav
523c7f4d7adSDag-Erling Smørgrav	# trust anchor signaling sends a RFC8145 key tag query after priming.
5248a384985SDag-Erling Smørgrav	# trust-anchor-signaling: yes
525c7f4d7adSDag-Erling Smørgrav
5260fb34990SDag-Erling Smørgrav	# Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel)
5270fb34990SDag-Erling Smørgrav	# root-key-sentinel: yes
5280fb34990SDag-Erling Smørgrav
529b7579f77SDag-Erling Smørgrav	# File with trusted keys for validation. Specify more than one file
530b7579f77SDag-Erling Smørgrav	# with several entries, one file per entry.
531b7579f77SDag-Erling Smørgrav	# Zone file format, with DS and DNSKEY entries.
532b7579f77SDag-Erling Smørgrav	# Note this gets out of date, use auto-trust-anchor-file please.
533b7579f77SDag-Erling Smørgrav	# trust-anchor-file: ""
534b7579f77SDag-Erling Smørgrav
535b7579f77SDag-Erling Smørgrav	# Trusted key for validation. DS or DNSKEY. specify the RR on a
536b7579f77SDag-Erling Smørgrav	# single line, surrounded by "". TTL is ignored. class is IN default.
537b7579f77SDag-Erling Smørgrav	# Note this gets out of date, use auto-trust-anchor-file please.
538b7579f77SDag-Erling Smørgrav	# (These examples are from August 2007 and may not be valid anymore).
539b7579f77SDag-Erling Smørgrav	# trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
540b7579f77SDag-Erling Smørgrav	# trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
541b7579f77SDag-Erling Smørgrav
542b7579f77SDag-Erling Smørgrav	# File with trusted keys for validation. Specify more than one file
543b7579f77SDag-Erling Smørgrav	# with several entries, one file per entry. Like trust-anchor-file
544b7579f77SDag-Erling Smørgrav	# but has a different file format. Format is BIND-9 style format,
545b7579f77SDag-Erling Smørgrav	# the trusted-keys { name flag proto algo "key"; }; clauses are read.
546b7579f77SDag-Erling Smørgrav	# you need external update procedures to track changes in keys.
547b7579f77SDag-Erling Smørgrav	# trusted-keys-file: ""
548b7579f77SDag-Erling Smørgrav
549b7579f77SDag-Erling Smørgrav	# Ignore chain of trust. Domain is treated as insecure.
550b7579f77SDag-Erling Smørgrav	# domain-insecure: "example.com"
551b7579f77SDag-Erling Smørgrav
552b7579f77SDag-Erling Smørgrav	# Override the date for validation with a specific fixed date.
553b7579f77SDag-Erling Smørgrav	# Do not set this unless you are debugging signature inception
554b7579f77SDag-Erling Smørgrav	# and expiration. "" or "0" turns the feature off. -1 ignores date.
555b7579f77SDag-Erling Smørgrav	# val-override-date: ""
556b7579f77SDag-Erling Smørgrav
557b7579f77SDag-Erling Smørgrav	# The time to live for bogus data, rrsets and messages. This avoids
558b7579f77SDag-Erling Smørgrav	# some of the revalidation, until the time interval expires. in secs.
559b7579f77SDag-Erling Smørgrav	# val-bogus-ttl: 60
560b7579f77SDag-Erling Smørgrav
561b7579f77SDag-Erling Smørgrav	# The signature inception and expiration dates are allowed to be off
562b7579f77SDag-Erling Smørgrav	# by 10% of the signature lifetime (expir-incep) from our local clock.
563b7579f77SDag-Erling Smørgrav	# This leeway is capped with a minimum and a maximum.  In seconds.
564b7579f77SDag-Erling Smørgrav	# val-sig-skew-min: 3600
565b7579f77SDag-Erling Smørgrav	# val-sig-skew-max: 86400
566b7579f77SDag-Erling Smørgrav
567*5469a995SCy Schubert	# The maximum number the validator should restart validation with
568*5469a995SCy Schubert	# another authority in case of failed validation.
569*5469a995SCy Schubert	# val-max-restart: 5
570*5469a995SCy Schubert
571b7579f77SDag-Erling Smørgrav	# Should additional section of secure message also be kept clean of
572b7579f77SDag-Erling Smørgrav	# unsecure data. Useful to shield the users of this validator from
573b7579f77SDag-Erling Smørgrav	# potential bogus data in the additional section. All unsigned data
574b7579f77SDag-Erling Smørgrav	# in the additional section is removed from secure messages.
575b7579f77SDag-Erling Smørgrav	# val-clean-additional: yes
576b7579f77SDag-Erling Smørgrav
577b7579f77SDag-Erling Smørgrav	# Turn permissive mode on to permit bogus messages. Thus, messages
578b7579f77SDag-Erling Smørgrav	# for which security checks failed will be returned to clients,
579b7579f77SDag-Erling Smørgrav	# instead of SERVFAIL. It still performs the security checks, which
580b7579f77SDag-Erling Smørgrav	# result in interesting log files and possibly the AD bit in
581b7579f77SDag-Erling Smørgrav	# replies if the message is found secure. The default is off.
582b7579f77SDag-Erling Smørgrav	# val-permissive-mode: no
583b7579f77SDag-Erling Smørgrav
584b7579f77SDag-Erling Smørgrav	# Ignore the CD flag in incoming queries and refuse them bogus data.
585b7579f77SDag-Erling Smørgrav	# Enable it if the only clients of unbound are legacy servers (w2008)
586b7579f77SDag-Erling Smørgrav	# that set CD but cannot validate themselves.
587b7579f77SDag-Erling Smørgrav	# ignore-cd-flag: no
588b7579f77SDag-Erling Smørgrav
589091e9e46SCy Schubert	# Serve expired responses from cache, with serve-expired-reply-ttl in
590091e9e46SCy Schubert	# the response, and then attempt to fetch the data afresh.
591bc892140SDag-Erling Smørgrav	# serve-expired: no
5924c75e3aaSDag-Erling Smørgrav	#
5934c75e3aaSDag-Erling Smørgrav	# Limit serving of expired responses to configured seconds after
5944c75e3aaSDag-Erling Smørgrav	# expiration. 0 disables the limit.
5954c75e3aaSDag-Erling Smørgrav	# serve-expired-ttl: 0
5964c75e3aaSDag-Erling Smørgrav	#
5974c75e3aaSDag-Erling Smørgrav	# Set the TTL of expired records to the serve-expired-ttl value after a
5984c75e3aaSDag-Erling Smørgrav	# failed attempt to retrieve the record from upstream. This makes sure
5994c75e3aaSDag-Erling Smørgrav	# that the expired records will be served as long as there are queries
6004c75e3aaSDag-Erling Smørgrav	# for it.
6014c75e3aaSDag-Erling Smørgrav	# serve-expired-ttl-reset: no
602091e9e46SCy Schubert	#
603091e9e46SCy Schubert	# TTL value to use when replying with expired data.
604091e9e46SCy Schubert	# serve-expired-reply-ttl: 30
605091e9e46SCy Schubert	#
606091e9e46SCy Schubert	# Time in milliseconds before replying to the client with expired data.
607091e9e46SCy Schubert	# This essentially enables the serve-stale behavior as specified in
608c0caa2e2SCy Schubert	# RFC 8767 that first tries to resolve before
609091e9e46SCy Schubert	# immediately responding with expired data.  0 disables this behavior.
610091e9e46SCy Schubert	# A recommended value is 1800.
611091e9e46SCy Schubert	# serve-expired-client-timeout: 0
612bc892140SDag-Erling Smørgrav
613f44e67d1SCy Schubert	# Return the original TTL as received from the upstream name server rather
614f44e67d1SCy Schubert	# than the decrementing TTL as stored in the cache.  Enabling this feature
615f44e67d1SCy Schubert	# does not impact cache expiry, it only changes the TTL unbound embeds in
616f44e67d1SCy Schubert	# responses to queries. Note that enabling this feature implicitly disables
617f44e67d1SCy Schubert	# enforcement of the configured minimum and maximum TTL.
618f44e67d1SCy Schubert	# serve-original-ttl: no
619f44e67d1SCy Schubert
620b7579f77SDag-Erling Smørgrav	# Have the validator log failed validations for your diagnosis.
621b7579f77SDag-Erling Smørgrav	# 0: off. 1: A line per failed user query. 2: With reason and bad IP.
622b7579f77SDag-Erling Smørgrav	# val-log-level: 0
623b7579f77SDag-Erling Smørgrav
624b7579f77SDag-Erling Smørgrav	# It is possible to configure NSEC3 maximum iteration counts per
625b7579f77SDag-Erling Smørgrav	# keysize. Keep this table very short, as linear search is done.
626b7579f77SDag-Erling Smørgrav	# A message with an NSEC3 with larger count is marked insecure.
627b7579f77SDag-Erling Smørgrav	# List in ascending order the keysize and count values.
628*5469a995SCy Schubert	# val-nsec3-keysize-iterations: "1024 150 2048 150 4096 150"
629*5469a995SCy Schubert
630*5469a995SCy Schubert	# if enabled, ZONEMD verification failures do not block the zone.
631*5469a995SCy Schubert	# zonemd-permissive-mode: no
632b7579f77SDag-Erling Smørgrav
633b7579f77SDag-Erling Smørgrav	# instruct the auto-trust-anchor-file probing to add anchors after ttl.
634b7579f77SDag-Erling Smørgrav	# add-holddown: 2592000 # 30 days
635b7579f77SDag-Erling Smørgrav
636b7579f77SDag-Erling Smørgrav	# instruct the auto-trust-anchor-file probing to del anchors after ttl.
637b7579f77SDag-Erling Smørgrav	# del-holddown: 2592000 # 30 days
638b7579f77SDag-Erling Smørgrav
639b7579f77SDag-Erling Smørgrav	# auto-trust-anchor-file probing removes missing anchors after ttl.
640b7579f77SDag-Erling Smørgrav	# If the value 0 is given, missing anchors are not removed.
641b7579f77SDag-Erling Smørgrav	# keep-missing: 31622400 # 366 days
642b7579f77SDag-Erling Smørgrav
643e2d15004SDag-Erling Smørgrav	# debug option that allows very small holddown times for key rollover,
644e2d15004SDag-Erling Smørgrav	# otherwise the RFC mandates probe intervals must be at least 1 hour.
645b75612f8SDag-Erling Smørgrav	# permit-small-holddown: no
646b75612f8SDag-Erling Smørgrav
647b7579f77SDag-Erling Smørgrav	# the amount of memory to use for the key cache.
648b7579f77SDag-Erling Smørgrav	# plain value in bytes or you can append k, m or G. default is "4Mb".
649b7579f77SDag-Erling Smørgrav	# key-cache-size: 4m
650b7579f77SDag-Erling Smørgrav
651b7579f77SDag-Erling Smørgrav	# the number of slabs to use for the key cache.
652b7579f77SDag-Erling Smørgrav	# the number of slabs must be a power of 2.
653b7579f77SDag-Erling Smørgrav	# more slabs reduce lock contention, but fragment memory usage.
654b7579f77SDag-Erling Smørgrav	# key-cache-slabs: 4
655b7579f77SDag-Erling Smørgrav
656c0caa2e2SCy Schubert	# the amount of memory to use for the negative cache.
657b7579f77SDag-Erling Smørgrav	# plain value in bytes or you can append k, m or G. default is "1Mb".
658b7579f77SDag-Erling Smørgrav	# neg-cache-size: 1m
659b7579f77SDag-Erling Smørgrav
66017d15b25SDag-Erling Smørgrav	# By default, for a number of zones a small default 'nothing here'
66117d15b25SDag-Erling Smørgrav	# reply is built-in.  Query traffic is thus blocked.  If you
66217d15b25SDag-Erling Smørgrav	# wish to serve such zone you can unblock them by uncommenting one
66317d15b25SDag-Erling Smørgrav	# of the nodefault statements below.
66417d15b25SDag-Erling Smørgrav	# You may also have to use domain-insecure: zone to make DNSSEC work,
66517d15b25SDag-Erling Smørgrav	# unless you have your own trust anchors for this zone.
66617d15b25SDag-Erling Smørgrav	# local-zone: "localhost." nodefault
66717d15b25SDag-Erling Smørgrav	# local-zone: "127.in-addr.arpa." nodefault
66817d15b25SDag-Erling Smørgrav	# local-zone: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." nodefault
669f61ef7f6SDag-Erling Smørgrav	# local-zone: "onion." nodefault
670971980c3SDag-Erling Smørgrav	# local-zone: "test." nodefault
671971980c3SDag-Erling Smørgrav	# local-zone: "invalid." nodefault
67217d15b25SDag-Erling Smørgrav	# local-zone: "10.in-addr.arpa." nodefault
67317d15b25SDag-Erling Smørgrav	# local-zone: "16.172.in-addr.arpa." nodefault
67417d15b25SDag-Erling Smørgrav	# local-zone: "17.172.in-addr.arpa." nodefault
67517d15b25SDag-Erling Smørgrav	# local-zone: "18.172.in-addr.arpa." nodefault
67617d15b25SDag-Erling Smørgrav	# local-zone: "19.172.in-addr.arpa." nodefault
67717d15b25SDag-Erling Smørgrav	# local-zone: "20.172.in-addr.arpa." nodefault
67817d15b25SDag-Erling Smørgrav	# local-zone: "21.172.in-addr.arpa." nodefault
67917d15b25SDag-Erling Smørgrav	# local-zone: "22.172.in-addr.arpa." nodefault
68017d15b25SDag-Erling Smørgrav	# local-zone: "23.172.in-addr.arpa." nodefault
68117d15b25SDag-Erling Smørgrav	# local-zone: "24.172.in-addr.arpa." nodefault
68217d15b25SDag-Erling Smørgrav	# local-zone: "25.172.in-addr.arpa." nodefault
68317d15b25SDag-Erling Smørgrav	# local-zone: "26.172.in-addr.arpa." nodefault
68417d15b25SDag-Erling Smørgrav	# local-zone: "27.172.in-addr.arpa." nodefault
68517d15b25SDag-Erling Smørgrav	# local-zone: "28.172.in-addr.arpa." nodefault
68617d15b25SDag-Erling Smørgrav	# local-zone: "29.172.in-addr.arpa." nodefault
68717d15b25SDag-Erling Smørgrav	# local-zone: "30.172.in-addr.arpa." nodefault
68817d15b25SDag-Erling Smørgrav	# local-zone: "31.172.in-addr.arpa." nodefault
68917d15b25SDag-Erling Smørgrav	# local-zone: "168.192.in-addr.arpa." nodefault
69017d15b25SDag-Erling Smørgrav	# local-zone: "0.in-addr.arpa." nodefault
69117d15b25SDag-Erling Smørgrav	# local-zone: "254.169.in-addr.arpa." nodefault
69217d15b25SDag-Erling Smørgrav	# local-zone: "2.0.192.in-addr.arpa." nodefault
69317d15b25SDag-Erling Smørgrav	# local-zone: "100.51.198.in-addr.arpa." nodefault
69417d15b25SDag-Erling Smørgrav	# local-zone: "113.0.203.in-addr.arpa." nodefault
69517d15b25SDag-Erling Smørgrav	# local-zone: "255.255.255.255.in-addr.arpa." nodefault
69617d15b25SDag-Erling Smørgrav	# local-zone: "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." nodefault
69717d15b25SDag-Erling Smørgrav	# local-zone: "d.f.ip6.arpa." nodefault
69817d15b25SDag-Erling Smørgrav	# local-zone: "8.e.f.ip6.arpa." nodefault
69917d15b25SDag-Erling Smørgrav	# local-zone: "9.e.f.ip6.arpa." nodefault
70017d15b25SDag-Erling Smørgrav	# local-zone: "a.e.f.ip6.arpa." nodefault
70117d15b25SDag-Erling Smørgrav	# local-zone: "b.e.f.ip6.arpa." nodefault
70217d15b25SDag-Erling Smørgrav	# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
703ff825849SDag-Erling Smørgrav	# And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
704ff825849SDag-Erling Smørgrav
7050eefd307SCy Schubert	# Add example.com into ipset
7060eefd307SCy Schubert	# local-zone: "example.com" ipset
7070eefd307SCy Schubert
7080de4f1bfSDag-Erling Smørgrav	# If unbound is running service for the local host then it is useful
709ff825849SDag-Erling Smørgrav	# to perform lan-wide lookups to the upstream, and unblock the
710ff825849SDag-Erling Smørgrav	# long list of local-zones above.  If this unbound is a dns server
711ff825849SDag-Erling Smørgrav	# for a network of computers, disabled is better and stops information
712ff825849SDag-Erling Smørgrav	# leakage of local lan information.
713ff825849SDag-Erling Smørgrav	# unblock-lan-zones: no
71417d15b25SDag-Erling Smørgrav
7150de4f1bfSDag-Erling Smørgrav	# The insecure-lan-zones option disables validation for
7160de4f1bfSDag-Erling Smørgrav	# these zones, as if they were all listed as domain-insecure.
7170de4f1bfSDag-Erling Smørgrav	# insecure-lan-zones: no
7180de4f1bfSDag-Erling Smørgrav
719b7579f77SDag-Erling Smørgrav	# a number of locally served zones can be configured.
720b7579f77SDag-Erling Smørgrav	# 	local-zone: <zone> <type>
721b7579f77SDag-Erling Smørgrav	# 	local-data: "<resource record string>"
722b7579f77SDag-Erling Smørgrav	# o deny serves local data (if any), else, drops queries.
723b7579f77SDag-Erling Smørgrav	# o refuse serves local data (if any), else, replies with error.
724b7579f77SDag-Erling Smørgrav	# o static serves local data, else, nxdomain or nodata answer.
725b7579f77SDag-Erling Smørgrav	# o transparent gives local data, but resolves normally for other names
726b7579f77SDag-Erling Smørgrav	# o redirect serves the zone data for any subdomain in the zone.
727b7579f77SDag-Erling Smørgrav	# o nodefault can be used to normally resolve AS112 zones.
728b7579f77SDag-Erling Smørgrav	# o typetransparent resolves normally for other types and other names
729bc892140SDag-Erling Smørgrav	# o inform acts like transparent, but logs client IP address
73009a3aaf3SDag-Erling Smørgrav	# o inform_deny drops queries and logs client IP address
731e86b9096SDag-Erling Smørgrav	# o inform_redirect redirects queries and logs client IP address
732f44e67d1SCy Schubert	# o always_transparent, always_refuse, always_nxdomain, always_nodata,
733f44e67d1SCy Schubert	#   always_deny resolve in that way but ignore local data for
734f44e67d1SCy Schubert	#   that name
735f44e67d1SCy Schubert	# o always_null returns 0.0.0.0 or ::0 for any name in the zone.
73657bddd21SDag-Erling Smørgrav	# o noview breaks out of that view towards global local-zones.
737b7579f77SDag-Erling Smørgrav	#
738b7579f77SDag-Erling Smørgrav	# defaults are localhost address, reverse for 127.0.0.1 and ::1
739b7579f77SDag-Erling Smørgrav	# and nxdomain for AS112 zones. If you configure one of these zones
740b7579f77SDag-Erling Smørgrav	# the default content is omitted, or you can omit it with 'nodefault'.
741b7579f77SDag-Erling Smørgrav	#
742b7579f77SDag-Erling Smørgrav	# If you configure local-data without specifying local-zone, by
743b7579f77SDag-Erling Smørgrav	# default a transparent local-zone is created for the data.
744b7579f77SDag-Erling Smørgrav	#
745b7579f77SDag-Erling Smørgrav	# You can add locally served data with
746b7579f77SDag-Erling Smørgrav	# local-zone: "local." static
747b7579f77SDag-Erling Smørgrav	# local-data: "mycomputer.local. IN A 192.0.2.51"
748b7579f77SDag-Erling Smørgrav	# local-data: 'mytext.local TXT "content of text record"'
749b7579f77SDag-Erling Smørgrav	#
750b7579f77SDag-Erling Smørgrav	# You can override certain queries with
751b7579f77SDag-Erling Smørgrav	# local-data: "adserver.example.com A 127.0.0.1"
752b7579f77SDag-Erling Smørgrav	#
753b7579f77SDag-Erling Smørgrav	# You can redirect a domain to a fixed address with
754b7579f77SDag-Erling Smørgrav	# (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
755b7579f77SDag-Erling Smørgrav	# local-zone: "example.com" redirect
756b7579f77SDag-Erling Smørgrav	# local-data: "example.com A 192.0.2.3"
757b7579f77SDag-Erling Smørgrav	#
758b7579f77SDag-Erling Smørgrav	# Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
759b7579f77SDag-Erling Smørgrav	# You can also add PTR records using local-data directly, but then
760b7579f77SDag-Erling Smørgrav	# you need to do the reverse notation yourself.
761b7579f77SDag-Erling Smørgrav	# local-data-ptr: "192.0.2.3 www.example.com"
762b7579f77SDag-Erling Smørgrav
763b5663de9SDag-Erling Smørgrav	# tag a localzone with a list of tag names (in "" with spaces between)
764b5663de9SDag-Erling Smørgrav	# local-zone-tag: "example.com" "tag2 tag3"
765b5663de9SDag-Erling Smørgrav
766b5663de9SDag-Erling Smørgrav	# add a netblock specific override to a localzone, with zone type
767b5663de9SDag-Erling Smørgrav	# local-zone-override: "example.com" 192.0.2.0/24 refuse
768b5663de9SDag-Erling Smørgrav
769c0caa2e2SCy Schubert	# service clients over TLS (on the TCP sockets) with plain DNS inside
770c0caa2e2SCy Schubert	# the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484.
771c0caa2e2SCy Schubert	# Give the certificate to use and private key.
772b7579f77SDag-Erling Smørgrav	# default is "" (disabled).  requires restart to take effect.
77357bddd21SDag-Erling Smørgrav	# tls-service-key: "path/to/privatekeyfile.key"
77457bddd21SDag-Erling Smørgrav	# tls-service-pem: "path/to/publiccertfile.pem"
77557bddd21SDag-Erling Smørgrav	# tls-port: 853
776c0caa2e2SCy Schubert	# https-port: 443
777b7579f77SDag-Erling Smørgrav
778e86b9096SDag-Erling Smørgrav	# cipher setting for TLSv1.2
779e86b9096SDag-Erling Smørgrav	# tls-ciphers: "DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256"
780e86b9096SDag-Erling Smørgrav	# cipher setting for TLSv1.3
781e86b9096SDag-Erling Smørgrav	# tls-ciphersuites: "TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_8_SHA256:TLS_AES_128_CCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256"
782e86b9096SDag-Erling Smørgrav
783f44e67d1SCy Schubert	# Pad responses to padded queries received over TLS
784f44e67d1SCy Schubert	# pad-responses: yes
785f44e67d1SCy Schubert
786f44e67d1SCy Schubert	# Padded responses will be padded to the closest multiple of this size.
787f44e67d1SCy Schubert	# pad-responses-block-size: 468
788f44e67d1SCy Schubert
78925039b37SCy Schubert	# Use the SNI extension for TLS connections.  Default is yes.
79025039b37SCy Schubert	# Changing the value requires a reload.
79125039b37SCy Schubert	# tls-use-sni: yes
79225039b37SCy Schubert
793e86b9096SDag-Erling Smørgrav	# Add the secret file for TLS Session Ticket.
794e86b9096SDag-Erling Smørgrav	# Secret file must be 80 bytes of random data.
795e86b9096SDag-Erling Smørgrav	# First key use to encrypt and decrypt TLS session tickets.
796e86b9096SDag-Erling Smørgrav	# Other keys use to decrypt only.
797e86b9096SDag-Erling Smørgrav	# requires restart to take effect.
798e86b9096SDag-Erling Smørgrav	# tls-session-ticket-keys: "path/to/secret_file1"
799e86b9096SDag-Erling Smørgrav	# tls-session-ticket-keys: "path/to/secret_file2"
800e86b9096SDag-Erling Smørgrav
8010fb34990SDag-Erling Smørgrav	# request upstream over TLS (with plain DNS inside the TLS stream).
802b7579f77SDag-Erling Smørgrav	# Default is no.  Can be turned on and off with unbound-control.
80357bddd21SDag-Erling Smørgrav	# tls-upstream: no
80457bddd21SDag-Erling Smørgrav
80557bddd21SDag-Erling Smørgrav	# Certificates used to authenticate connections made upstream.
80657bddd21SDag-Erling Smørgrav	# tls-cert-bundle: ""
807b7579f77SDag-Erling Smørgrav
8083bd4df0aSDag-Erling Smørgrav	# Add system certs to the cert bundle, from the Windows Cert Store
8093bd4df0aSDag-Erling Smørgrav	# tls-win-cert: no
8103bd4df0aSDag-Erling Smørgrav
811f44e67d1SCy Schubert	# Pad queries over TLS upstreams
812f44e67d1SCy Schubert	# pad-queries: yes
813f44e67d1SCy Schubert
814f44e67d1SCy Schubert	# Padded queries will be padded to the closest multiple of this size.
815f44e67d1SCy Schubert	# pad-queries-block-size: 128
816f44e67d1SCy Schubert
8170fb34990SDag-Erling Smørgrav	# Also serve tls on these port numbers (eg. 443, ...), by listing
8187da0adf7SDag-Erling Smørgrav	# tls-additional-port: portno for each of the port numbers.
8190fb34990SDag-Erling Smørgrav
820c0caa2e2SCy Schubert	# HTTP endpoint to provide DNS-over-HTTPS service on.
821c0caa2e2SCy Schubert	# http-endpoint: "/dns-query"
822c0caa2e2SCy Schubert
823c0caa2e2SCy Schubert	# HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use.
824c0caa2e2SCy Schubert	# http-max-streams: 100
825c0caa2e2SCy Schubert
826c0caa2e2SCy Schubert	# Maximum number of bytes used for all HTTP/2 query buffers.
827c0caa2e2SCy Schubert	# http-query-buffer-size: 4m
828c0caa2e2SCy Schubert
829c0caa2e2SCy Schubert	# Maximum number of bytes used for all HTTP/2 response buffers.
830c0caa2e2SCy Schubert	# http-response-buffer-size: 4m
831c0caa2e2SCy Schubert
832c0caa2e2SCy Schubert	# Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS
833c0caa2e2SCy Schubert	# service.
834c0caa2e2SCy Schubert	# http-nodelay: yes
835c0caa2e2SCy Schubert
836369c6923SCy Schubert	# Disable TLS for DNS-over-HTTP downstream service.
837369c6923SCy Schubert	# http-notls-downstream: no
838369c6923SCy Schubert
839ff825849SDag-Erling Smørgrav	# DNS64 prefix. Must be specified when DNS64 is use.
840ff825849SDag-Erling Smørgrav	# Enable dns64 in module-config.  Used to synthesize IPv6 from IPv4.
841ff825849SDag-Erling Smørgrav	# dns64-prefix: 64:ff9b::0/96
842ff825849SDag-Erling Smørgrav
8434c75e3aaSDag-Erling Smørgrav	# DNS64 ignore AAAA records for these domains and use A instead.
8444c75e3aaSDag-Erling Smørgrav	# dns64-ignore-aaaa: "example.com"
8454c75e3aaSDag-Erling Smørgrav
84609a3aaf3SDag-Erling Smørgrav	# ratelimit for uncached, new queries, this limits recursion effort.
84709a3aaf3SDag-Erling Smørgrav	# ratelimiting is experimental, and may help against randomqueryflood.
84809a3aaf3SDag-Erling Smørgrav	# if 0(default) it is disabled, otherwise state qps allowed per zone.
84909a3aaf3SDag-Erling Smørgrav	# ratelimit: 0
85009a3aaf3SDag-Erling Smørgrav
85109a3aaf3SDag-Erling Smørgrav	# ratelimits are tracked in a cache, size in bytes of cache (or k,m).
85209a3aaf3SDag-Erling Smørgrav	# ratelimit-size: 4m
85309a3aaf3SDag-Erling Smørgrav	# ratelimit cache slabs, reduces lock contention if equal to cpucount.
85409a3aaf3SDag-Erling Smørgrav	# ratelimit-slabs: 4
85509a3aaf3SDag-Erling Smørgrav
85609a3aaf3SDag-Erling Smørgrav	# 0 blocks when ratelimited, otherwise let 1/xth traffic through
85709a3aaf3SDag-Erling Smørgrav	# ratelimit-factor: 10
85809a3aaf3SDag-Erling Smørgrav
85909a3aaf3SDag-Erling Smørgrav	# override the ratelimit for a specific domain name.
86009a3aaf3SDag-Erling Smørgrav	# give this setting multiple times to have multiple overrides.
86109a3aaf3SDag-Erling Smørgrav	# ratelimit-for-domain: example.com 1000
86209a3aaf3SDag-Erling Smørgrav	# override the ratelimits for all domains below a domain name
86309a3aaf3SDag-Erling Smørgrav	# can give this multiple times, the name closest to the zone is used.
864b5663de9SDag-Erling Smørgrav	# ratelimit-below-domain: com 1000
86509a3aaf3SDag-Erling Smørgrav
8663005e0a3SDag-Erling Smørgrav	# global query ratelimit for all ip addresses.
8673005e0a3SDag-Erling Smørgrav	# feature is experimental.
8683005e0a3SDag-Erling Smørgrav	# if 0(default) it is disabled, otherwise states qps allowed per ip address
8693005e0a3SDag-Erling Smørgrav	# ip-ratelimit: 0
8703005e0a3SDag-Erling Smørgrav
8713005e0a3SDag-Erling Smørgrav	# ip ratelimits are tracked in a cache, size in bytes of cache (or k,m).
8723005e0a3SDag-Erling Smørgrav	# ip-ratelimit-size: 4m
8733005e0a3SDag-Erling Smørgrav	# ip ratelimit cache slabs, reduces lock contention if equal to cpucount.
8743005e0a3SDag-Erling Smørgrav	# ip-ratelimit-slabs: 4
8753005e0a3SDag-Erling Smørgrav
8763005e0a3SDag-Erling Smørgrav	# 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through
8773005e0a3SDag-Erling Smørgrav	# ip-ratelimit-factor: 10
8783005e0a3SDag-Erling Smørgrav
8794c75e3aaSDag-Erling Smørgrav	# Limit the number of connections simultaneous from a netblock
8804c75e3aaSDag-Erling Smørgrav	# tcp-connection-limit: 192.0.2.0/24 12
8814c75e3aaSDag-Erling Smørgrav
882e86b9096SDag-Erling Smørgrav	# select from the fastest servers this many times out of 1000. 0 means
883e86b9096SDag-Erling Smørgrav	# the fast server select is disabled. prefetches are not sped up.
884e86b9096SDag-Erling Smørgrav	# fast-server-permil: 0
885e86b9096SDag-Erling Smørgrav	# the number of servers that will be used in the fast server selection.
886e86b9096SDag-Erling Smørgrav	# fast-server-num: 3
8870fb34990SDag-Erling Smørgrav
888c7f4d7adSDag-Erling Smørgrav	# Specific options for ipsecmod. unbound needs to be configured with
889c7f4d7adSDag-Erling Smørgrav	# --enable-ipsecmod for these to take effect.
890c7f4d7adSDag-Erling Smørgrav	#
891c7f4d7adSDag-Erling Smørgrav	# Enable or disable ipsecmod (it still needs to be defined in
892c7f4d7adSDag-Erling Smørgrav	# module-config above). Can be used when ipsecmod needs to be
893c7f4d7adSDag-Erling Smørgrav	# enabled/disabled via remote-control(below).
894c7f4d7adSDag-Erling Smørgrav	# ipsecmod-enabled: yes
895c7f4d7adSDag-Erling Smørgrav	#
896c7f4d7adSDag-Erling Smørgrav	# Path to executable external hook. It must be defined when ipsecmod is
897c7f4d7adSDag-Erling Smørgrav	# listed in module-config (above).
898c7f4d7adSDag-Erling Smørgrav	# ipsecmod-hook: "./my_executable"
899c7f4d7adSDag-Erling Smørgrav	#
900c7f4d7adSDag-Erling Smørgrav	# When enabled unbound will reply with SERVFAIL if the return value of
901c7f4d7adSDag-Erling Smørgrav	# the ipsecmod-hook is not 0.
902c7f4d7adSDag-Erling Smørgrav	# ipsecmod-strict: no
903c7f4d7adSDag-Erling Smørgrav	#
904c7f4d7adSDag-Erling Smørgrav	# Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY.
905c7f4d7adSDag-Erling Smørgrav	# ipsecmod-max-ttl: 3600
906c7f4d7adSDag-Erling Smørgrav	#
907c7f4d7adSDag-Erling Smørgrav	# Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for
908c7f4d7adSDag-Erling Smørgrav	# testing.
909c7f4d7adSDag-Erling Smørgrav	# ipsecmod-ignore-bogus: no
910c7f4d7adSDag-Erling Smørgrav	#
911c7f4d7adSDag-Erling Smørgrav	# Domains for which ipsecmod will be triggered. If not defined (default)
912c0caa2e2SCy Schubert	# all domains are treated as being allowed.
913c0caa2e2SCy Schubert	# ipsecmod-allow: "example.com"
914c0caa2e2SCy Schubert	# ipsecmod-allow: "nlnetlabs.nl"
915c7f4d7adSDag-Erling Smørgrav
916*5469a995SCy Schubert	# Timeout for REUSE entries in milliseconds.
917*5469a995SCy Schubert	# tcp-reuse-timeout: 60000
918*5469a995SCy Schubert	# Max number of queries on a reuse connection.
919*5469a995SCy Schubert	# max-reuse-tcp-queries: 200
920*5469a995SCy Schubert	# Timeout in milliseconds for TCP queries to auth servers.
921*5469a995SCy Schubert	# tcp-auth-query-timeout: 3000
922*5469a995SCy Schubert
9233005e0a3SDag-Erling Smørgrav
924b7579f77SDag-Erling Smørgrav# Python config section. To enable:
925b7579f77SDag-Erling Smørgrav# o use --with-pythonmodule to configure before compiling.
926b7579f77SDag-Erling Smørgrav# o list python in the module-config string (above) to enable.
927e86b9096SDag-Erling Smørgrav#   It can be at the start, it gets validated results, or just before
928e86b9096SDag-Erling Smørgrav#   the iterator and process before DNSSEC validation.
929b7579f77SDag-Erling Smørgrav# o and give a python-script to run.
930b7579f77SDag-Erling Smørgravpython:
931b7579f77SDag-Erling Smørgrav	# Script file to load
932b7579f77SDag-Erling Smørgrav	# python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py"
933b7579f77SDag-Erling Smørgrav
93425039b37SCy Schubert# Dynamic library config section. To enable:
93525039b37SCy Schubert# o use --with-dynlibmodule to configure before compiling.
93625039b37SCy Schubert# o list dynlib in the module-config string (above) to enable.
93725039b37SCy Schubert#   It can be placed anywhere, the dynlib module is only a very thin wrapper
93825039b37SCy Schubert#   to load modules dynamically.
93925039b37SCy Schubert# o and give a dynlib-file to run. If more than one dynlib entry is listed in
94025039b37SCy Schubert#   the module-config then you need one dynlib-file per instance.
94125039b37SCy Schubertdynlib:
94225039b37SCy Schubert	# Script file to load
94325039b37SCy Schubert	# dynlib-file: "@UNBOUND_SHARE_DIR@/dynlib.so"
94425039b37SCy Schubert
945b7579f77SDag-Erling Smørgrav# Remote control config section.
946b7579f77SDag-Erling Smørgravremote-control:
947b7579f77SDag-Erling Smørgrav	# Enable remote control with unbound-control(8) here.
948b7579f77SDag-Erling Smørgrav	# set up the keys and certificates with unbound-control-setup.
949b7579f77SDag-Erling Smørgrav	# control-enable: no
950b7579f77SDag-Erling Smørgrav
951b7579f77SDag-Erling Smørgrav	# what interfaces are listened to for remote control.
952b7579f77SDag-Erling Smørgrav	# give 0.0.0.0 and ::0 to listen to all interfaces.
9537da0adf7SDag-Erling Smørgrav	# set to an absolute path to use a unix local name pipe, certificates
9547da0adf7SDag-Erling Smørgrav	# are not used for that, so key and cert files need not be present.
955b7579f77SDag-Erling Smørgrav	# control-interface: 127.0.0.1
956b7579f77SDag-Erling Smørgrav	# control-interface: ::1
957b7579f77SDag-Erling Smørgrav
958b7579f77SDag-Erling Smørgrav	# port number for remote control operations.
959b7579f77SDag-Erling Smørgrav	# control-port: 8953
960b7579f77SDag-Erling Smørgrav
9617da0adf7SDag-Erling Smørgrav	# for localhost, you can disable use of TLS by setting this to "no"
9627da0adf7SDag-Erling Smørgrav	# For local sockets this option is ignored, and TLS is not used.
9637da0adf7SDag-Erling Smørgrav	# control-use-cert: "yes"
9647da0adf7SDag-Erling Smørgrav
965b7579f77SDag-Erling Smørgrav	# unbound server key file.
966b7579f77SDag-Erling Smørgrav	# server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key"
967b7579f77SDag-Erling Smørgrav
968b7579f77SDag-Erling Smørgrav	# unbound server certificate file.
969b7579f77SDag-Erling Smørgrav	# server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem"
970b7579f77SDag-Erling Smørgrav
971b7579f77SDag-Erling Smørgrav	# unbound-control key file.
972b7579f77SDag-Erling Smørgrav	# control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key"
973b7579f77SDag-Erling Smørgrav
974b7579f77SDag-Erling Smørgrav	# unbound-control certificate file.
975b7579f77SDag-Erling Smørgrav	# control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem"
976b7579f77SDag-Erling Smørgrav
977b7579f77SDag-Erling Smørgrav# Stub zones.
978b7579f77SDag-Erling Smørgrav# Create entries like below, to make all queries for 'example.com' and
979b7579f77SDag-Erling Smørgrav# 'example.org' go to the given list of nameservers. list zero or more
980b7579f77SDag-Erling Smørgrav# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
981b7579f77SDag-Erling Smørgrav# the list is treated as priming hints (default is no).
982b7579f77SDag-Erling Smørgrav# With stub-first yes, it attempts without the stub if it fails.
983b75612f8SDag-Erling Smørgrav# Consider adding domain-insecure: name and local-zone: name nodefault
984b75612f8SDag-Erling Smørgrav# to the server: section if the stub is a locally served zone.
985b7579f77SDag-Erling Smørgrav# stub-zone:
986b7579f77SDag-Erling Smørgrav#	name: "example.com"
987b7579f77SDag-Erling Smørgrav#	stub-addr: 192.0.2.68
988b7579f77SDag-Erling Smørgrav#	stub-prime: no
989b7579f77SDag-Erling Smørgrav#	stub-first: no
99057bddd21SDag-Erling Smørgrav#	stub-tls-upstream: no
9914c75e3aaSDag-Erling Smørgrav#	stub-no-cache: no
992b7579f77SDag-Erling Smørgrav# stub-zone:
993b7579f77SDag-Erling Smørgrav#	name: "example.org"
994b7579f77SDag-Erling Smørgrav#	stub-host: ns.example.com.
995b7579f77SDag-Erling Smørgrav
996b7579f77SDag-Erling Smørgrav# Forward zones
997b7579f77SDag-Erling Smørgrav# Create entries like below, to make all queries for 'example.com' and
998b7579f77SDag-Erling Smørgrav# 'example.org' go to the given list of servers. These servers have to handle
999b7579f77SDag-Erling Smørgrav# recursion to other nameservers. List zero or more nameservers by hostname
1000b7579f77SDag-Erling Smørgrav# or by ipaddress. Use an entry with name "." to forward all queries.
1001b7579f77SDag-Erling Smørgrav# If you enable forward-first, it attempts without the forward if it fails.
1002b7579f77SDag-Erling Smørgrav# forward-zone:
1003b7579f77SDag-Erling Smørgrav# 	name: "example.com"
1004b7579f77SDag-Erling Smørgrav# 	forward-addr: 192.0.2.68
1005b7579f77SDag-Erling Smørgrav# 	forward-addr: 192.0.2.73@5355  # forward to port 5355.
1006b7579f77SDag-Erling Smørgrav# 	forward-first: no
100757bddd21SDag-Erling Smørgrav# 	forward-tls-upstream: no
10084c75e3aaSDag-Erling Smørgrav#	forward-no-cache: no
1009b7579f77SDag-Erling Smørgrav# forward-zone:
1010b7579f77SDag-Erling Smørgrav# 	name: "example.org"
1011b7579f77SDag-Erling Smørgrav# 	forward-host: fwd.example.com
1012bc892140SDag-Erling Smørgrav
101357bddd21SDag-Erling Smørgrav# Authority zones
101457bddd21SDag-Erling Smørgrav# The data for these zones is kept locally, from a file or downloaded.
101557bddd21SDag-Erling Smørgrav# The data can be served to downstream clients, or used instead of the
101657bddd21SDag-Erling Smørgrav# upstream (which saves a lookup to the upstream).  The first example
101757bddd21SDag-Erling Smørgrav# has a copy of the root for local usage.  The second serves example.org
101857bddd21SDag-Erling Smørgrav# authoritatively.  zonefile: reads from file (and writes to it if you also
1019c0caa2e2SCy Schubert# download it), primary: fetches with AXFR and IXFR, or url to zonefile.
1020c0caa2e2SCy Schubert# With allow-notify: you can give additional (apart from primaries) sources of
10210fb34990SDag-Erling Smørgrav# notifies.
102257bddd21SDag-Erling Smørgrav# auth-zone:
102357bddd21SDag-Erling Smørgrav#	name: "."
1024c0caa2e2SCy Schubert#	primary: 199.9.14.201         # b.root-servers.net
1025c0caa2e2SCy Schubert#	primary: 192.33.4.12          # c.root-servers.net
1026c0caa2e2SCy Schubert#	primary: 199.7.91.13          # d.root-servers.net
1027c0caa2e2SCy Schubert#	primary: 192.5.5.241          # f.root-servers.net
1028c0caa2e2SCy Schubert#	primary: 192.112.36.4         # g.root-servers.net
1029c0caa2e2SCy Schubert#	primary: 193.0.14.129         # k.root-servers.net
1030c0caa2e2SCy Schubert#	primary: 192.0.47.132         # xfr.cjr.dns.icann.org
1031c0caa2e2SCy Schubert#	primary: 192.0.32.132         # xfr.lax.dns.icann.org
1032c0caa2e2SCy Schubert#	primary: 2001:500:200::b      # b.root-servers.net
1033c0caa2e2SCy Schubert#	primary: 2001:500:2::c        # c.root-servers.net
1034c0caa2e2SCy Schubert#	primary: 2001:500:2d::d       # d.root-servers.net
1035c0caa2e2SCy Schubert#	primary: 2001:500:2f::f       # f.root-servers.net
1036c0caa2e2SCy Schubert#	primary: 2001:500:12::d0d     # g.root-servers.net
1037c0caa2e2SCy Schubert#	primary: 2001:7fd::1          # k.root-servers.net
1038c0caa2e2SCy Schubert#	primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org
1039c0caa2e2SCy Schubert#	primary: 2620:0:2d0:202::132  # xfr.lax.dns.icann.org
1040e86b9096SDag-Erling Smørgrav#	fallback-enabled: yes
104157bddd21SDag-Erling Smørgrav#	for-downstream: no
104257bddd21SDag-Erling Smørgrav#	for-upstream: yes
104357bddd21SDag-Erling Smørgrav# auth-zone:
104457bddd21SDag-Erling Smørgrav#	name: "example.org"
104557bddd21SDag-Erling Smørgrav#	for-downstream: yes
104657bddd21SDag-Erling Smørgrav#	for-upstream: yes
1047*5469a995SCy Schubert#	zonemd-check: no
1048*5469a995SCy Schubert#	zonemd-reject-absence: no
104957bddd21SDag-Erling Smørgrav#	zonefile: "example.org.zone"
105057bddd21SDag-Erling Smørgrav
1051bc892140SDag-Erling Smørgrav# Views
1052bc892140SDag-Erling Smørgrav# Create named views. Name must be unique. Map views to requests using
1053bc892140SDag-Erling Smørgrav# the access-control-view option. Views can contain zero or more local-zone
1054bc892140SDag-Erling Smørgrav# and local-data options. Options from matching views will override global
1055bc892140SDag-Erling Smørgrav# options. Global options will be used if no matching view is found.
1056bc892140SDag-Erling Smørgrav# With view-first yes, it will try to answer using the global local-zone and
1057bc892140SDag-Erling Smørgrav# local-data elements if there is no view specific match.
1058bc892140SDag-Erling Smørgrav# view:
1059bc892140SDag-Erling Smørgrav#	name: "viewname"
1060bc892140SDag-Erling Smørgrav#	local-zone: "example.com" redirect
1061bc892140SDag-Erling Smørgrav#	local-data: "example.com A 192.0.2.3"
106265b390aaSDag-Erling Smørgrav#	local-data-ptr: "192.0.2.3 www.example.com"
1063bc892140SDag-Erling Smørgrav#	view-first: no
1064bc892140SDag-Erling Smørgrav# view:
1065bc892140SDag-Erling Smørgrav#	name: "anotherview"
1066bc892140SDag-Erling Smørgrav#	local-zone: "example.com" refuse
106765b390aaSDag-Erling Smørgrav
106865b390aaSDag-Erling Smørgrav# DNSCrypt
106965b390aaSDag-Erling Smørgrav# Caveats:
107065b390aaSDag-Erling Smørgrav# 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper
107165b390aaSDag-Erling Smørgrav#   for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage
107265b390aaSDag-Erling Smørgrav# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to
107365b390aaSDag-Erling Smørgrav#   listen on `dnscrypt-port` with the follo0wing snippet:
107465b390aaSDag-Erling Smørgrav# server:
107565b390aaSDag-Erling Smørgrav#     interface: 0.0.0.0@443
107665b390aaSDag-Erling Smørgrav#     interface: ::0@443
107765b390aaSDag-Erling Smørgrav#
107865b390aaSDag-Erling Smørgrav# Finally, `dnscrypt` config has its own section.
107965b390aaSDag-Erling Smørgrav# dnscrypt:
108065b390aaSDag-Erling Smørgrav#     dnscrypt-enable: yes
108165b390aaSDag-Erling Smørgrav#     dnscrypt-port: 443
108265b390aaSDag-Erling Smørgrav#     dnscrypt-provider: 2.dnscrypt-cert.example.com.
108365b390aaSDag-Erling Smørgrav#     dnscrypt-secret-key: /path/unbound-conf/keys1/1.key
108465b390aaSDag-Erling Smørgrav#     dnscrypt-secret-key: /path/unbound-conf/keys2/1.key
108565b390aaSDag-Erling Smørgrav#     dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert
108665b390aaSDag-Erling Smørgrav#     dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert
1087971980c3SDag-Erling Smørgrav
1088971980c3SDag-Erling Smørgrav# CacheDB
1089971980c3SDag-Erling Smørgrav# Enable external backend DB as auxiliary cache.  Specify the backend name
1090971980c3SDag-Erling Smørgrav# (default is "testframe", which has no use other than for debugging and
1091971980c3SDag-Erling Smørgrav# testing) and backend-specific options.  The 'cachedb' module must be
1092e86b9096SDag-Erling Smørgrav# included in module-config, just before the iterator module.
1093971980c3SDag-Erling Smørgrav# cachedb:
1094971980c3SDag-Erling Smørgrav#     backend: "testframe"
1095971980c3SDag-Erling Smørgrav#     # secret seed string to calculate hashed keys
1096971980c3SDag-Erling Smørgrav#     secret-seed: "default"
10970fb34990SDag-Erling Smørgrav#
10980fb34990SDag-Erling Smørgrav#     # For "redis" backend:
10990fb34990SDag-Erling Smørgrav#     # redis server's IP address or host name
11000fb34990SDag-Erling Smørgrav#     redis-server-host: 127.0.0.1
11010fb34990SDag-Erling Smørgrav#     # redis server's TCP port
11020fb34990SDag-Erling Smørgrav#     redis-server-port: 6379
11030fb34990SDag-Erling Smørgrav#     # timeout (in ms) for communication with the redis server
11040fb34990SDag-Erling Smørgrav#     redis-timeout: 100
110525039b37SCy Schubert#     # set timeout on redis records based on DNS response TTL
110625039b37SCy Schubert#     redis-expire-records: no
11070eefd307SCy Schubert
11080eefd307SCy Schubert# IPSet
11090eefd307SCy Schubert# Add specify domain into set via ipset.
111025039b37SCy Schubert# Note: To enable ipset unbound needs to run as root user.
11110eefd307SCy Schubert# ipset:
11120eefd307SCy Schubert#     # set name for ip v4 addresses
11130eefd307SCy Schubert#     name-v4: "list-v4"
11140eefd307SCy Schubert#     # set name for ip v6 addresses
11150eefd307SCy Schubert#     name-v6: "list-v6"
11160eefd307SCy Schubert#
11170eefd307SCy Schubert
111825039b37SCy Schubert# Dnstap logging support, if compiled in.  To enable, set the dnstap-enable
111925039b37SCy Schubert# to yes and also some of dnstap-log-..-messages to yes.  And select an
112025039b37SCy Schubert# upstream log destination, by socket path, TCP or TLS destination.
112125039b37SCy Schubert# dnstap:
112225039b37SCy Schubert# 	dnstap-enable: no
112325039b37SCy Schubert# 	# if set to yes frame streams will be used in bidirectional mode
112425039b37SCy Schubert# 	dnstap-bidirectional: yes
112525039b37SCy Schubert# 	dnstap-socket-path: "@DNSTAP_SOCKET_PATH@"
112625039b37SCy Schubert# 	# if "" use the unix socket in dnstap-socket-path, otherwise,
112725039b37SCy Schubert# 	# set it to "IPaddress[@port]" of the destination.
112825039b37SCy Schubert# 	dnstap-ip: ""
112925039b37SCy Schubert# 	# if set to yes if you want to use TLS to dnstap-ip, no for TCP.
113025039b37SCy Schubert# 	dnstap-tls: yes
113125039b37SCy Schubert# 	# name for authenticating the upstream server. or "" disabled.
113225039b37SCy Schubert# 	dnstap-tls-server-name: ""
113325039b37SCy Schubert# 	# if "", it uses the cert bundle from the main unbound config.
113425039b37SCy Schubert# 	dnstap-tls-cert-bundle: ""
113525039b37SCy Schubert# 	# key file for client authentication, or "" disabled.
113625039b37SCy Schubert# 	dnstap-tls-client-key-file: ""
113725039b37SCy Schubert# 	# cert file for client authentication, or "" disabled.
113825039b37SCy Schubert# 	dnstap-tls-client-cert-file: ""
113925039b37SCy Schubert# 	dnstap-send-identity: no
114025039b37SCy Schubert# 	dnstap-send-version: no
114125039b37SCy Schubert# 	# if "" it uses the hostname.
114225039b37SCy Schubert# 	dnstap-identity: ""
114325039b37SCy Schubert# 	# if "" it uses the package version.
114425039b37SCy Schubert# 	dnstap-version: ""
114525039b37SCy Schubert# 	dnstap-log-resolver-query-messages: no
114625039b37SCy Schubert# 	dnstap-log-resolver-response-messages: no
114725039b37SCy Schubert# 	dnstap-log-client-query-messages: no
114825039b37SCy Schubert# 	dnstap-log-client-response-messages: no
114925039b37SCy Schubert# 	dnstap-log-forwarder-query-messages: no
115025039b37SCy Schubert# 	dnstap-log-forwarder-response-messages: no
115125039b37SCy Schubert
1152091e9e46SCy Schubert# Response Policy Zones
1153091e9e46SCy Schubert# RPZ policies. Applied in order of configuration. QNAME and Response IP
1154091e9e46SCy Schubert# Address trigger are the only supported triggers. Supported actions are:
1155091e9e46SCy Schubert# NXDOMAIN, NODATA, PASSTHRU, DROP and Local Data. Policies can be loaded from
1156091e9e46SCy Schubert# file, using zone transfer, or using HTTP. The respip module needs to be added
1157091e9e46SCy Schubert# to the module-config, e.g.: module-config: "respip validator iterator".
1158091e9e46SCy Schubert# rpz:
1159091e9e46SCy Schubert#     name: "rpz.example.com"
1160091e9e46SCy Schubert#     zonefile: "rpz.example.com"
1161c0caa2e2SCy Schubert#     primary: 192.0.2.0
1162091e9e46SCy Schubert#     allow-notify: 192.0.2.0/32
1163091e9e46SCy Schubert#     url: http://www.example.com/rpz.example.org.zone
1164091e9e46SCy Schubert#     rpz-action-override: cname
1165091e9e46SCy Schubert#     rpz-cname-override: www.example.org
1166091e9e46SCy Schubert#     rpz-log: yes
1167091e9e46SCy Schubert#     rpz-log-name: "example policy"
1168091e9e46SCy Schubert#     tags: "example"
1169