1238106Sdes#
2238106Sdes# Example configuration file.
3238106Sdes#
4369939Sgit2svn# See unbound.conf(5) man page, version 1.13.1.
5238106Sdes#
6238106Sdes# this is a comment.
7238106Sdes
8366095Scy# Use this anywhere in the file to include other text into this file.
9238106Sdes#include: "otherfile.conf"
10238106Sdes
11366095Scy# Use this anywhere in the file to include other text, that explicitly starts a
12366095Scy# clause, into this file. Text after this directive needs to start a clause.
13366095Scy#include-toplevel: "otherfile.conf"
14366095Scy
15292206Sdes# The server clause sets the main parameters.
16238106Sdesserver:
17238106Sdes	# whitespace is not necessary, but looks cleaner.
18238106Sdes
19238106Sdes	# verbosity number, 0 is least verbose. 1 is default.
20238106Sdes	verbosity: 1
21238106Sdes
22238106Sdes	# print statistics to the log (for every thread) every N seconds.
23238106Sdes	# Set to "" or 0 to disable. Default is disabled.
24238106Sdes	# statistics-interval: 0
25238106Sdes
26356345Scy	# enable shm for stats, default no.  if you enable also enable
27356345Scy	# statistics-interval, every time it also writes stats to the
28356345Scy	# shared memory segment keyed with shm-key.
29356345Scy	# shm-enable: no
30356345Scy
31356345Scy	# shm for stats uses this key, and key+1 for the shared mem segment.
32356345Scy	# shm-key: 11777
33356345Scy
34238106Sdes	# enable cumulative statistics, without clearing them after printing.
35238106Sdes	# statistics-cumulative: no
36238106Sdes
37238106Sdes	# enable extended statistics (query types, answer codes, status)
38238106Sdes	# printed from unbound-control. default off, because of speed.
39238106Sdes	# extended-statistics: no
40238106Sdes
41238106Sdes	# number of threads to create. 1 disables threading.
42238106Sdes	# num-threads: 1
43238106Sdes
44238106Sdes	# specify the interfaces to answer queries from by ip-address.
45238106Sdes	# The default is to listen to localhost (127.0.0.1 and ::1).
46238106Sdes	# specify 0.0.0.0 and ::0 to bind to all available interfaces.
47238106Sdes	# specify every interface[@port] on a new 'interface:' labelled line.
48238106Sdes	# The listen interfaces are not changed on reload, only on restart.
49238106Sdes	# interface: 192.0.2.153
50238106Sdes	# interface: 192.0.2.154
51238106Sdes	# interface: 192.0.2.154@5003
52238106Sdes	# interface: 2001:DB8::5
53238106Sdes
54238106Sdes	# enable this feature to copy the source address of queries to reply.
55292206Sdes	# Socket options are not supported on all platforms. experimental.
56238106Sdes	# interface-automatic: no
57238106Sdes
58238106Sdes	# port to answer queries from
59238106Sdes	# port: 53
60238106Sdes
61238106Sdes	# specify the interfaces to send outgoing queries to authoritative
62238106Sdes	# server from by ip-address. If none, the default (all) interface
63238106Sdes	# is used. Specify every interface on a 'outgoing-interface:' line.
64238106Sdes	# outgoing-interface: 192.0.2.153
65238106Sdes	# outgoing-interface: 2001:DB8::5
66238106Sdes	# outgoing-interface: 2001:DB8::6
67356345Scy
68307729Sdes	# Specify a netblock to use remainder 64 bits as random bits for
69307729Sdes	# upstream queries.  Uses freebind option (Linux).
70307729Sdes	# outgoing-interface: 2001:DB8::/64
71307729Sdes	# Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo
72307729Sdes	# And: ip -6 route add local 2001:db8::/64 dev lo
73307729Sdes	# And set prefer-ip6: yes to use the ip6 randomness from a netblock.
74307729Sdes	# Set this to yes to prefer ipv6 upstream servers over ipv4.
75307729Sdes	# prefer-ip6: no
76238106Sdes
77366095Scy	# Prefer ipv4 upstream servers, even if ipv6 is available.
78366095Scy	# prefer-ip4: no
79366095Scy
80238106Sdes	# number of ports to allocate per thread, determines the size of the
81238106Sdes	# port range that can be open simultaneously.  About double the
82238106Sdes	# num-queries-per-thread, or, use as many as the OS will allow you.
83238106Sdes	# outgoing-range: 4096
84238106Sdes
85238106Sdes	# permit unbound to use this port number or port range for
86238106Sdes	# making outgoing queries, using an outgoing interface.
87238106Sdes	# outgoing-port-permit: 32768
88238106Sdes
89238106Sdes	# deny unbound the use this of port number or port range for
90238106Sdes	# making outgoing queries, using an outgoing interface.
91238106Sdes	# Use this to make sure unbound does not grab a UDP port that some
92238106Sdes	# other server on this computer needs. The default is to avoid
93238106Sdes	# IANA-assigned port numbers.
94249141Sdes	# If multiple outgoing-port-permit and outgoing-port-avoid options
95249141Sdes	# are present, they are processed in order.
96238106Sdes	# outgoing-port-avoid: "3200-3208"
97238106Sdes
98238106Sdes	# number of outgoing simultaneous tcp buffers to hold per thread.
99238106Sdes	# outgoing-num-tcp: 10
100238106Sdes
101238106Sdes	# number of incoming simultaneous tcp buffers to hold per thread.
102238106Sdes	# incoming-num-tcp: 10
103238106Sdes
104238106Sdes	# buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
105238106Sdes	# 0 is system default.  Use 4m to catch query spikes for busy servers.
106238106Sdes	# so-rcvbuf: 0
107238106Sdes
108238106Sdes	# buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
109238106Sdes	# 0 is system default.  Use 4m to handle spikes on very busy servers.
110238106Sdes	# so-sndbuf: 0
111292206Sdes
112276605Sdes	# use SO_REUSEPORT to distribute queries over threads.
113356345Scy	# at extreme load it could be better to turn it off to distribute even.
114356345Scy	# so-reuseport: yes
115292206Sdes
116287917Sdes	# use IP_TRANSPARENT so the interface: addresses can be non-local
117287917Sdes	# and you can config non-existing IPs that are going to work later on
118296415Sdes	# (uses IP_BINDANY on FreeBSD).
119287917Sdes	# ip-transparent: no
120238106Sdes
121307729Sdes	# use IP_FREEBIND so the interface: addresses can be non-local
122307729Sdes	# and you can bind to nonexisting IPs and interfaces that are down.
123307729Sdes	# Linux only.  On Linux you also have ip-transparent that is similar.
124307729Sdes	# ip-freebind: no
125307729Sdes
126366095Scy	# the value of the Differentiated Services Codepoint (DSCP)
127366095Scy	# in the differentiated services field (DS) of the outgoing
128366095Scy	# IP packets
129366095Scy	# ip-dscp: 0
130366095Scy
131238106Sdes	# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
132368129Scy	# is set with msg-buffer-size).
133368129Scy	# edns-buffer-size: 1232
134238106Sdes
135266114Sdes	# Maximum UDP response size (not applied to TCP response).
136266114Sdes	# Suggested values are 512 to 4096. Default is 4096. 65536 disables it.
137266114Sdes	# max-udp-size: 4096
138266114Sdes
139356345Scy	# max memory to use for stream(tcp and tls) waiting result buffers.
140356345Scy	# stream-wait-size: 4m
141356345Scy
142238106Sdes	# buffer size for handling DNS data. No messages larger than this
143238106Sdes	# size can be sent or received, by UDP or TCP. In bytes.
144238106Sdes	# msg-buffer-size: 65552
145238106Sdes
146238106Sdes	# the amount of memory to use for the message cache.
147292206Sdes	# plain value in bytes or you can append k, m or G. default is "4Mb".
148238106Sdes	# msg-cache-size: 4m
149238106Sdes
150238106Sdes	# the number of slabs to use for the message cache.
151238106Sdes	# the number of slabs must be a power of 2.
152238106Sdes	# more slabs reduce lock contention, but fragment memory usage.
153238106Sdes	# msg-cache-slabs: 4
154238106Sdes
155238106Sdes	# the number of queries that a thread gets to service.
156238106Sdes	# num-queries-per-thread: 1024
157238106Sdes
158238106Sdes	# if very busy, 50% queries run to completion, 50% get timeout in msec
159238106Sdes	# jostle-timeout: 200
160292206Sdes
161266114Sdes	# msec to wait before close of port on timeout UDP. 0 disables.
162266114Sdes	# delay-close: 0
163238106Sdes
164368693Scy	# perform connect for UDP sockets to mitigate ICMP side channel.
165368693Scy	# udp-connect: yes
166368693Scy
167356345Scy	# msec for waiting for an unknown server to reply.  Increase if you
168356345Scy	# are behind a slow satellite link, to eg. 1128.
169356345Scy	# unknown-server-time-limit: 376
170356345Scy
171238106Sdes	# the amount of memory to use for the RRset cache.
172292206Sdes	# plain value in bytes or you can append k, m or G. default is "4Mb".
173238106Sdes	# rrset-cache-size: 4m
174238106Sdes
175238106Sdes	# the number of slabs to use for the RRset cache.
176238106Sdes	# the number of slabs must be a power of 2.
177238106Sdes	# more slabs reduce lock contention, but fragment memory usage.
178238106Sdes	# rrset-cache-slabs: 4
179238106Sdes
180238106Sdes	# the time to live (TTL) value lower bound, in seconds. Default 0.
181238106Sdes	# If more than an hour could easily give trouble due to stale data.
182238106Sdes	# cache-min-ttl: 0
183238106Sdes
184238106Sdes	# the time to live (TTL) value cap for RRsets and messages in the
185238106Sdes	# cache. Items are not cached for longer. In seconds.
186238106Sdes	# cache-max-ttl: 86400
187238106Sdes
188287917Sdes	# the time to live (TTL) value cap for negative responses in the cache
189287917Sdes	# cache-max-negative-ttl: 3600
190287917Sdes
191238106Sdes	# the time to live (TTL) value for cached roundtrip times, lameness and
192238106Sdes	# EDNS version information for hosts. In seconds.
193238106Sdes	# infra-host-ttl: 900
194292206Sdes
195282089Sdes	# minimum wait time for responses, increase if uplink is long. In msec.
196282089Sdes	# infra-cache-min-rtt: 50
197238106Sdes
198368693Scy	# enable to make server probe down hosts more frequently.
199368693Scy	# infra-keep-probing: no
200368693Scy
201238106Sdes	# the number of slabs to use for the Infrastructure cache.
202238106Sdes	# the number of slabs must be a power of 2.
203238106Sdes	# more slabs reduce lock contention, but fragment memory usage.
204238106Sdes	# infra-cache-slabs: 4
205238106Sdes
206238106Sdes	# the maximum number of hosts that are cached (roundtrip, EDNS, lame).
207238106Sdes	# infra-cache-numhosts: 10000
208356345Scy
209307729Sdes	# define a number of tags here, use with local-zone, access-control.
210307729Sdes	# repeat the define-tag statement to add additional tags.
211307729Sdes	# define-tag: "tag1 tag2 tag3"
212238106Sdes
213238106Sdes	# Enable IPv4, "yes" or "no".
214238106Sdes	# do-ip4: yes
215238106Sdes
216238106Sdes	# Enable IPv6, "yes" or "no".
217238106Sdes	# do-ip6: yes
218238106Sdes
219238106Sdes	# Enable UDP, "yes" or "no".
220238106Sdes	# do-udp: yes
221238106Sdes
222238106Sdes	# Enable TCP, "yes" or "no".
223238106Sdes	# do-tcp: yes
224238106Sdes
225238106Sdes	# upstream connections use TCP only (and no UDP), "yes" or "no"
226238106Sdes	# useful for tunneling scenarios, default no.
227238106Sdes	# tcp-upstream: no
228238106Sdes
229356345Scy	# upstream connections also use UDP (even if do-udp is no).
230356345Scy	# useful if if you want UDP upstream, but don't provide UDP downstream.
231356345Scy	# udp-upstream-without-downstream: no
232356345Scy
233296415Sdes	# Maximum segment size (MSS) of TCP socket on which the server
234296415Sdes	# responds to queries. Default is 0, system default MSS.
235296415Sdes	# tcp-mss: 0
236296415Sdes
237296415Sdes	# Maximum segment size (MSS) of TCP socket for outgoing queries.
238296415Sdes	# Default is 0, system default MSS.
239296415Sdes	# outgoing-tcp-mss: 0
240296415Sdes
241356345Scy	# Idle TCP timeout, connection closed in milliseconds
242356345Scy	# tcp-idle-timeout: 30000
243356345Scy
244356345Scy	# Enable EDNS TCP keepalive option.
245356345Scy	# edns-tcp-keepalive: no
246356345Scy
247356345Scy	# Timeout for EDNS TCP keepalive, in msec.
248356345Scy	# edns-tcp-keepalive-timeout: 120000
249356345Scy
250356345Scy	# Use systemd socket activation for UDP, TCP, and control sockets.
251356345Scy	# use-systemd: no
252356345Scy
253238106Sdes	# Detach from the terminal, run in background, "yes" or "no".
254356345Scy	# Set the value to "no" when unbound runs as systemd service.
255238106Sdes	# do-daemonize: yes
256238106Sdes
257238106Sdes	# control which clients are allowed to make (recursive) queries
258238106Sdes	# to this server. Specify classless netblocks with /size and action.
259238106Sdes	# By default everything is refused, except for localhost.
260238106Sdes	# Choose deny (drop message), refuse (polite error reply),
261356345Scy	# allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on),
262356345Scy	# allow_snoop (recursive and nonrecursive ok)
263266114Sdes	# deny_non_local (drop queries unless can be answered from local-data)
264266114Sdes	# refuse_non_local (like deny_non_local but polite error reply).
265238106Sdes	# access-control: 0.0.0.0/0 refuse
266238106Sdes	# access-control: 127.0.0.0/8 allow
267238106Sdes	# access-control: ::0/0 refuse
268238106Sdes	# access-control: ::1 allow
269238106Sdes	# access-control: ::ffff:127.0.0.1 allow
270238106Sdes
271307729Sdes	# tag access-control with list of tags (in "" with spaces between)
272307729Sdes	# Clients using this access control element use localzones that
273307729Sdes	# are tagged with one of these tags.
274307729Sdes	# access-control-tag: 192.0.2.0/24 "tag2 tag3"
275307729Sdes
276307729Sdes	# set action for particular tag for given access control element
277307729Sdes	# if you have multiple tag values, the tag used to lookup the action
278307729Sdes	# is the first tag match between access-control-tag and local-zone-tag
279307729Sdes	# where "first" comes from the order of the define-tag values.
280307729Sdes	# access-control-tag-action: 192.0.2.0/24 tag3 refuse
281307729Sdes
282307729Sdes	# set redirect data for particular tag for access control element
283307729Sdes	# access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1"
284307729Sdes
285356345Scy	# Set view for access control element
286356345Scy	# access-control-view: 192.0.2.0/24 viewname
287356345Scy
288238106Sdes	# if given, a chroot(2) is done to the given directory.
289238106Sdes	# i.e. you can chroot to the working directory, for example,
290238106Sdes	# for extra security, but make sure all files are in that directory.
291238106Sdes	#
292238106Sdes	# If chroot is enabled, you should pass the configfile (from the
293238106Sdes	# commandline) as a full path from the original root. After the
294292206Sdes	# chroot has been performed the now defunct portion of the config
295292206Sdes	# file path is removed to be able to reread the config after a reload.
296238106Sdes	#
297238106Sdes	# All other file paths (working dir, logfile, roothints, and
298238106Sdes	# key files) can be specified in several ways:
299238106Sdes	# 	o as an absolute path relative to the new root.
300238106Sdes	# 	o as a relative path to the working directory.
301238106Sdes	# 	o as an absolute path relative to the original root.
302238106Sdes	# In the last case the path is adjusted to remove the unused portion.
303238106Sdes	#
304292206Sdes	# The pid file can be absolute and outside of the chroot, it is
305238106Sdes	# written just prior to performing the chroot and dropping permissions.
306238106Sdes	#
307356345Scy	# Additionally, unbound may need to access /dev/urandom (for entropy).
308238106Sdes	# How to do this is specific to your OS.
309238106Sdes	#
310238106Sdes	# If you give "" no chroot is performed. The path must not end in a /.
311238106Sdes	# chroot: "@UNBOUND_CHROOT_DIR@"
312238106Sdes
313238106Sdes	# if given, user privileges are dropped (after binding port),
314238106Sdes	# and the given username is assumed. Default is user "unbound".
315238106Sdes	# If you give "" no privileges are dropped.
316238106Sdes	# username: "@UNBOUND_USERNAME@"
317238106Sdes
318292206Sdes	# the working directory. The relative files in this config are
319238106Sdes	# relative to this directory. If you give "" the working directory
320238106Sdes	# is not changed.
321307729Sdes	# If you give a server: directory: dir before include: file statements
322307729Sdes	# then those includes can be relative to the working directory.
323238106Sdes	# directory: "@UNBOUND_RUN_DIR@"
324238106Sdes
325292206Sdes	# the log file, "" means log to stderr.
326238106Sdes	# Use of this option sets use-syslog to "no".
327238106Sdes	# logfile: ""
328238106Sdes
329292206Sdes	# Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
330356345Scy	# log to. If yes, it overrides the logfile.
331292206Sdes	# use-syslog: yes
332238106Sdes
333356345Scy	# Log identity to report. if empty, defaults to the name of argv[0]
334356345Scy	# (usually "unbound").
335356345Scy	# log-identity: ""
336356345Scy
337238106Sdes	# print UTC timestamp in ascii to logfile, default is epoch in seconds.
338238106Sdes	# log-time-ascii: no
339292206Sdes
340238106Sdes	# print one line with time, IP, name, type, class for every query.
341238106Sdes	# log-queries: no
342238106Sdes
343356345Scy	# print one line per reply, with time, IP, name, type, class, rcode,
344356345Scy	# timetoresolve, fromcache and responsesize.
345356345Scy	# log-replies: no
346356345Scy
347356345Scy	# log with tag 'query' and 'reply' instead of 'info' for
348356345Scy	# filtering log-queries and log-replies from the log.
349356345Scy	# log-tag-queryreply: no
350356345Scy
351356345Scy	# log the local-zone actions, like local-zone type inform is enabled
352356345Scy	# also for the other local zone types.
353356345Scy	# log-local-actions: no
354356345Scy
355356345Scy	# print log lines that say why queries return SERVFAIL to clients.
356356345Scy	# log-servfail: no
357356345Scy
358238106Sdes	# the pid file. Can be an absolute path outside of chroot/work dir.
359238106Sdes	# pidfile: "@UNBOUND_PIDFILE@"
360238106Sdes
361238106Sdes	# file to read root hints from.
362292206Sdes	# get one from https://www.internic.net/domain/named.cache
363238106Sdes	# root-hints: ""
364238106Sdes
365238106Sdes	# enable to not answer id.server and hostname.bind queries.
366238106Sdes	# hide-identity: no
367238106Sdes
368238106Sdes	# enable to not answer version.server and version.bind queries.
369238106Sdes	# hide-version: no
370238106Sdes
371356345Scy	# enable to not answer trustanchor.unbound queries.
372356345Scy	# hide-trustanchor: no
373356345Scy
374238106Sdes	# the identity to report. Leave "" or default to return hostname.
375238106Sdes	# identity: ""
376238106Sdes
377238106Sdes	# the version to report. Leave "" or default to return package version.
378238106Sdes	# version: ""
379238106Sdes
380369939Sgit2svn	# NSID identity (hex string, or "ascii_somestring"). default disabled.
381369939Sgit2svn	# nsid: "aabbccdd"
382369939Sgit2svn
383238106Sdes	# the target fetch policy.
384292206Sdes	# series of integers describing the policy per dependency depth.
385292206Sdes	# The number of values in the list determines the maximum dependency
386238106Sdes	# depth the recursor will pursue before giving up. Each integer means:
387238106Sdes	# 	-1 : fetch all targets opportunistically,
388238106Sdes	# 	0: fetch on demand,
389238106Sdes	#	positive value: fetch that many targets opportunistically.
390238106Sdes	# Enclose the list of numbers between quotes ("").
391238106Sdes	# target-fetch-policy: "3 2 1 0 0"
392238106Sdes
393292206Sdes	# Harden against very small EDNS buffer sizes.
394369939Sgit2svn	# harden-short-bufsize: yes
395238106Sdes
396238106Sdes	# Harden against unseemly large queries.
397238106Sdes	# harden-large-queries: no
398238106Sdes
399292206Sdes	# Harden against out of zone rrsets, to avoid spoofing attempts.
400238106Sdes	# harden-glue: yes
401238106Sdes
402238106Sdes	# Harden against receiving dnssec-stripped data. If you turn it
403292206Sdes	# off, failing to validate dnskey data for a trustanchor will
404238106Sdes	# trigger insecure mode for that zone (like without a trustanchor).
405238106Sdes	# Default on, which insists on dnssec data for trust-anchored zones.
406238106Sdes	# harden-dnssec-stripped: yes
407238106Sdes
408238106Sdes	# Harden against queries that fall under dnssec-signed nxdomain names.
409356345Scy	# harden-below-nxdomain: yes
410238106Sdes
411356345Scy	# Harden the referral path by performing additional queries for
412238106Sdes	# infrastructure data.  Validates the replies (if possible).
413292206Sdes	# Default off, because the lookups burden the server.  Experimental
414238106Sdes	# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
415238106Sdes	# harden-referral-path: no
416238106Sdes
417287917Sdes	# Harden against algorithm downgrade when multiple algorithms are
418287917Sdes	# advertised in the DS record.  If no, allows the weakest algorithm
419287917Sdes	# to validate the zone.
420289063Sdes	# harden-algo-downgrade: no
421287917Sdes
422292206Sdes	# Sent minimum amount of information to upstream servers to enhance
423292206Sdes	# privacy. Only sent minimum required labels of the QNAME and set QTYPE
424356345Scy	# to A when possible.
425356345Scy	# qname-minimisation: yes
426292206Sdes
427356345Scy	# QNAME minimisation in strict mode. Do not fall-back to sending full
428356345Scy	# QNAME to potentially broken nameservers. A lot of domains will not be
429356345Scy	# resolvable when this option in enabled.
430356345Scy	# This option only has effect when qname-minimisation is enabled.
431356345Scy	# qname-minimisation-strict: no
432356345Scy
433356345Scy	# Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN
434356345Scy	# and other denials, using information from previous NXDOMAINs answers.
435356345Scy	# aggressive-nsec: no
436356345Scy
437238106Sdes	# Use 0x20-encoded random bits in the query to foil spoof attempts.
438238106Sdes	# This feature is an experimental implementation of draft dns-0x20.
439238106Sdes	# use-caps-for-id: no
440292206Sdes
441287917Sdes	# Domains (and domains in them) without support for dns-0x20 and
442287917Sdes	# the fallback fails because they keep sending different answers.
443368129Scy	# caps-exempt: "licdn.com"
444368129Scy	# caps-exempt: "senderbase.org"
445238106Sdes
446292206Sdes	# Enforce privacy of these addresses. Strips them away from answers.
447292206Sdes	# It may cause DNSSEC validation to additionally mark it as bogus.
448292206Sdes	# Protects against 'DNS Rebinding' (uses browser as network proxy).
449292206Sdes	# Only 'private-domain' and 'local-data' names are allowed to have
450238106Sdes	# these private addresses. No default.
451238106Sdes	# private-address: 10.0.0.0/8
452238106Sdes	# private-address: 172.16.0.0/12
453238106Sdes	# private-address: 192.168.0.0/16
454238106Sdes	# private-address: 169.254.0.0/16
455238106Sdes	# private-address: fd00::/8
456238106Sdes	# private-address: fe80::/10
457292206Sdes	# private-address: ::ffff:0:0/96
458238106Sdes
459238106Sdes	# Allow the domain (and its subdomains) to contain private addresses.
460238106Sdes	# local-data statements are allowed to contain private addresses too.
461238106Sdes	# private-domain: "example.com"
462238106Sdes
463238106Sdes	# If nonzero, unwanted replies are not only reported in statistics,
464238106Sdes	# but also a running total is kept per thread. If it reaches the
465238106Sdes	# threshold, a warning is printed and a defensive action is taken,
466238106Sdes	# the cache is cleared to flush potential poison out of it.
467238106Sdes	# A suggested value is 10000000, the default is 0 (turned off).
468238106Sdes	# unwanted-reply-threshold: 0
469238106Sdes
470238106Sdes	# Do not query the following addresses. No DNS queries are sent there.
471238106Sdes	# List one address per entry. List classless netblocks with /size,
472238106Sdes	# do-not-query-address: 127.0.0.1/8
473238106Sdes	# do-not-query-address: ::1
474238106Sdes
475238106Sdes	# if yes, the above default do-not-query-address entries are present.
476238106Sdes	# if no, localhost can be queried (for testing and debugging).
477238106Sdes	# do-not-query-localhost: yes
478238106Sdes
479238106Sdes	# if yes, perform prefetching of almost expired message cache entries.
480238106Sdes	# prefetch: no
481238106Sdes
482238106Sdes	# if yes, perform key lookups adjacent to normal lookups.
483238106Sdes	# prefetch-key: no
484238106Sdes
485356345Scy	# deny queries of type ANY with an empty response.
486356345Scy	# deny-any: no
487356345Scy
488238106Sdes	# if yes, Unbound rotates RRSet order in response.
489366095Scy	# rrset-roundrobin: yes
490238106Sdes
491238106Sdes	# if yes, Unbound doesn't insert authority/additional sections
492238106Sdes	# into response messages when those sections are not required.
493356345Scy	# minimal-responses: yes
494238106Sdes
495307729Sdes	# true to disable DNSSEC lameness check in iterator.
496307729Sdes	# disable-dnssec-lame-check: no
497307729Sdes
498238106Sdes	# module configuration of the server. A string with identifiers
499276605Sdes	# separated by spaces. Syntax: "[dns64] [validator] iterator"
500356345Scy	# most modules have to be listed at the beginning of the line,
501356345Scy	# except cachedb(just before iterator), and python (at the beginning,
502356345Scy	# or, just before the iterator).
503238106Sdes	# module-config: "validator iterator"
504238106Sdes
505238106Sdes	# File with trusted keys, kept uptodate using RFC5011 probes,
506238106Sdes	# initial file like trust-anchor-file, then it stores metadata.
507238106Sdes	# Use several entries, one per domain name, to track multiple zones.
508238106Sdes	#
509238106Sdes	# If you want to perform DNSSEC validation, run unbound-anchor before
510238106Sdes	# you start unbound (i.e. in the system boot scripts).  And enable:
511238106Sdes	# Please note usage of unbound-anchor root anchor is at your own risk
512238106Sdes	# and under the terms of our LICENSE (see that file in the source).
513238106Sdes	# auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
514238106Sdes
515356345Scy	# trust anchor signaling sends a RFC8145 key tag query after priming.
516356345Scy	# trust-anchor-signaling: yes
517356345Scy
518356345Scy	# Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel)
519356345Scy	# root-key-sentinel: yes
520356345Scy
521238106Sdes	# File with trusted keys for validation. Specify more than one file
522238106Sdes	# with several entries, one file per entry.
523238106Sdes	# Zone file format, with DS and DNSKEY entries.
524238106Sdes	# Note this gets out of date, use auto-trust-anchor-file please.
525238106Sdes	# trust-anchor-file: ""
526292206Sdes
527238106Sdes	# Trusted key for validation. DS or DNSKEY. specify the RR on a
528238106Sdes	# single line, surrounded by "". TTL is ignored. class is IN default.
529238106Sdes	# Note this gets out of date, use auto-trust-anchor-file please.
530238106Sdes	# (These examples are from August 2007 and may not be valid anymore).
531238106Sdes	# trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
532238106Sdes	# trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
533238106Sdes
534238106Sdes	# File with trusted keys for validation. Specify more than one file
535238106Sdes	# with several entries, one file per entry. Like trust-anchor-file
536292206Sdes	# but has a different file format. Format is BIND-9 style format,
537238106Sdes	# the trusted-keys { name flag proto algo "key"; }; clauses are read.
538238106Sdes	# you need external update procedures to track changes in keys.
539238106Sdes	# trusted-keys-file: ""
540238106Sdes
541238106Sdes	# Ignore chain of trust. Domain is treated as insecure.
542238106Sdes	# domain-insecure: "example.com"
543238106Sdes
544238106Sdes	# Override the date for validation with a specific fixed date.
545238106Sdes	# Do not set this unless you are debugging signature inception
546238106Sdes	# and expiration. "" or "0" turns the feature off. -1 ignores date.
547238106Sdes	# val-override-date: ""
548238106Sdes
549238106Sdes	# The time to live for bogus data, rrsets and messages. This avoids
550238106Sdes	# some of the revalidation, until the time interval expires. in secs.
551238106Sdes	# val-bogus-ttl: 60
552238106Sdes
553238106Sdes	# The signature inception and expiration dates are allowed to be off
554238106Sdes	# by 10% of the signature lifetime (expir-incep) from our local clock.
555238106Sdes	# This leeway is capped with a minimum and a maximum.  In seconds.
556238106Sdes	# val-sig-skew-min: 3600
557238106Sdes	# val-sig-skew-max: 86400
558238106Sdes
559238106Sdes	# Should additional section of secure message also be kept clean of
560238106Sdes	# unsecure data. Useful to shield the users of this validator from
561292206Sdes	# potential bogus data in the additional section. All unsigned data
562238106Sdes	# in the additional section is removed from secure messages.
563238106Sdes	# val-clean-additional: yes
564238106Sdes
565238106Sdes	# Turn permissive mode on to permit bogus messages. Thus, messages
566238106Sdes	# for which security checks failed will be returned to clients,
567238106Sdes	# instead of SERVFAIL. It still performs the security checks, which
568238106Sdes	# result in interesting log files and possibly the AD bit in
569238106Sdes	# replies if the message is found secure. The default is off.
570238106Sdes	# val-permissive-mode: no
571238106Sdes
572238106Sdes	# Ignore the CD flag in incoming queries and refuse them bogus data.
573238106Sdes	# Enable it if the only clients of unbound are legacy servers (w2008)
574238106Sdes	# that set CD but cannot validate themselves.
575238106Sdes	# ignore-cd-flag: no
576238106Sdes
577361435Scy	# Serve expired responses from cache, with serve-expired-reply-ttl in
578361435Scy	# the response, and then attempt to fetch the data afresh.
579356345Scy	# serve-expired: no
580356345Scy	#
581356345Scy	# Limit serving of expired responses to configured seconds after
582356345Scy	# expiration. 0 disables the limit.
583356345Scy	# serve-expired-ttl: 0
584356345Scy	#
585356345Scy	# Set the TTL of expired records to the serve-expired-ttl value after a
586356345Scy	# failed attempt to retrieve the record from upstream. This makes sure
587356345Scy	# that the expired records will be served as long as there are queries
588356345Scy	# for it.
589356345Scy	# serve-expired-ttl-reset: no
590361435Scy	#
591361435Scy	# TTL value to use when replying with expired data.
592361435Scy	# serve-expired-reply-ttl: 30
593361435Scy	#
594361435Scy	# Time in milliseconds before replying to the client with expired data.
595361435Scy	# This essentially enables the serve-stale behavior as specified in
596368129Scy	# RFC 8767 that first tries to resolve before
597361435Scy	# immediately responding with expired data.  0 disables this behavior.
598361435Scy	# A recommended value is 1800.
599361435Scy	# serve-expired-client-timeout: 0
600356345Scy
601369939Sgit2svn	# Return the original TTL as received from the upstream name server rather
602369939Sgit2svn	# than the decrementing TTL as stored in the cache.  Enabling this feature
603369939Sgit2svn	# does not impact cache expiry, it only changes the TTL unbound embeds in
604369939Sgit2svn	# responses to queries. Note that enabling this feature implicitly disables
605369939Sgit2svn	# enforcement of the configured minimum and maximum TTL.
606369939Sgit2svn	# serve-original-ttl: no
607369939Sgit2svn
608238106Sdes	# Have the validator log failed validations for your diagnosis.
609238106Sdes	# 0: off. 1: A line per failed user query. 2: With reason and bad IP.
610238106Sdes	# val-log-level: 0
611238106Sdes
612238106Sdes	# It is possible to configure NSEC3 maximum iteration counts per
613238106Sdes	# keysize. Keep this table very short, as linear search is done.
614238106Sdes	# A message with an NSEC3 with larger count is marked insecure.
615238106Sdes	# List in ascending order the keysize and count values.
616238106Sdes	# val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
617292206Sdes
618238106Sdes	# instruct the auto-trust-anchor-file probing to add anchors after ttl.
619238106Sdes	# add-holddown: 2592000 # 30 days
620238106Sdes
621238106Sdes	# instruct the auto-trust-anchor-file probing to del anchors after ttl.
622238106Sdes	# del-holddown: 2592000 # 30 days
623238106Sdes
624238106Sdes	# auto-trust-anchor-file probing removes missing anchors after ttl.
625238106Sdes	# If the value 0 is given, missing anchors are not removed.
626238106Sdes	# keep-missing: 31622400 # 366 days
627238106Sdes
628307729Sdes	# debug option that allows very small holddown times for key rollover,
629307729Sdes	# otherwise the RFC mandates probe intervals must be at least 1 hour.
630289063Sdes	# permit-small-holddown: no
631289063Sdes
632238106Sdes	# the amount of memory to use for the key cache.
633292206Sdes	# plain value in bytes or you can append k, m or G. default is "4Mb".
634238106Sdes	# key-cache-size: 4m
635238106Sdes
636238106Sdes	# the number of slabs to use for the key cache.
637238106Sdes	# the number of slabs must be a power of 2.
638238106Sdes	# more slabs reduce lock contention, but fragment memory usage.
639238106Sdes	# key-cache-slabs: 4
640238106Sdes
641368129Scy	# the amount of memory to use for the negative cache.
642292206Sdes	# plain value in bytes or you can append k, m or G. default is "1Mb".
643238106Sdes	# neg-cache-size: 1m
644282089Sdes
645266114Sdes	# By default, for a number of zones a small default 'nothing here'
646266114Sdes	# reply is built-in.  Query traffic is thus blocked.  If you
647266114Sdes	# wish to serve such zone you can unblock them by uncommenting one
648266114Sdes	# of the nodefault statements below.
649266114Sdes	# You may also have to use domain-insecure: zone to make DNSSEC work,
650266114Sdes	# unless you have your own trust anchors for this zone.
651266114Sdes	# local-zone: "localhost." nodefault
652266114Sdes	# local-zone: "127.in-addr.arpa." nodefault
653266114Sdes	# 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
654296415Sdes	# local-zone: "onion." nodefault
655356345Scy	# local-zone: "test." nodefault
656356345Scy	# local-zone: "invalid." nodefault
657266114Sdes	# local-zone: "10.in-addr.arpa." nodefault
658266114Sdes	# local-zone: "16.172.in-addr.arpa." nodefault
659266114Sdes	# local-zone: "17.172.in-addr.arpa." nodefault
660266114Sdes	# local-zone: "18.172.in-addr.arpa." nodefault
661266114Sdes	# local-zone: "19.172.in-addr.arpa." nodefault
662266114Sdes	# local-zone: "20.172.in-addr.arpa." nodefault
663266114Sdes	# local-zone: "21.172.in-addr.arpa." nodefault
664266114Sdes	# local-zone: "22.172.in-addr.arpa." nodefault
665266114Sdes	# local-zone: "23.172.in-addr.arpa." nodefault
666266114Sdes	# local-zone: "24.172.in-addr.arpa." nodefault
667266114Sdes	# local-zone: "25.172.in-addr.arpa." nodefault
668266114Sdes	# local-zone: "26.172.in-addr.arpa." nodefault
669266114Sdes	# local-zone: "27.172.in-addr.arpa." nodefault
670266114Sdes	# local-zone: "28.172.in-addr.arpa." nodefault
671266114Sdes	# local-zone: "29.172.in-addr.arpa." nodefault
672266114Sdes	# local-zone: "30.172.in-addr.arpa." nodefault
673266114Sdes	# local-zone: "31.172.in-addr.arpa." nodefault
674266114Sdes	# local-zone: "168.192.in-addr.arpa." nodefault
675266114Sdes	# local-zone: "0.in-addr.arpa." nodefault
676266114Sdes	# local-zone: "254.169.in-addr.arpa." nodefault
677266114Sdes	# local-zone: "2.0.192.in-addr.arpa." nodefault
678266114Sdes	# local-zone: "100.51.198.in-addr.arpa." nodefault
679266114Sdes	# local-zone: "113.0.203.in-addr.arpa." nodefault
680266114Sdes	# local-zone: "255.255.255.255.in-addr.arpa." nodefault
681266114Sdes	# 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
682266114Sdes	# local-zone: "d.f.ip6.arpa." nodefault
683266114Sdes	# local-zone: "8.e.f.ip6.arpa." nodefault
684266114Sdes	# local-zone: "9.e.f.ip6.arpa." nodefault
685266114Sdes	# local-zone: "a.e.f.ip6.arpa." nodefault
686266114Sdes	# local-zone: "b.e.f.ip6.arpa." nodefault
687266114Sdes	# local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
688276605Sdes	# And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
689292206Sdes
690356345Scy	# Add example.com into ipset
691356345Scy	# local-zone: "example.com" ipset
692356345Scy
693295535Sdes	# If unbound is running service for the local host then it is useful
694276605Sdes	# to perform lan-wide lookups to the upstream, and unblock the
695276605Sdes	# long list of local-zones above.  If this unbound is a dns server
696276605Sdes	# for a network of computers, disabled is better and stops information
697276605Sdes	# leakage of local lan information.
698276605Sdes	# unblock-lan-zones: no
699266114Sdes
700295535Sdes	# The insecure-lan-zones option disables validation for
701295535Sdes	# these zones, as if they were all listed as domain-insecure.
702295535Sdes	# insecure-lan-zones: no
703295535Sdes
704238106Sdes	# a number of locally served zones can be configured.
705238106Sdes	# 	local-zone: <zone> <type>
706238106Sdes	# 	local-data: "<resource record string>"
707292206Sdes	# o deny serves local data (if any), else, drops queries.
708238106Sdes	# o refuse serves local data (if any), else, replies with error.
709238106Sdes	# o static serves local data, else, nxdomain or nodata answer.
710238106Sdes	# o transparent gives local data, but resolves normally for other names
711238106Sdes	# o redirect serves the zone data for any subdomain in the zone.
712238106Sdes	# o nodefault can be used to normally resolve AS112 zones.
713238106Sdes	# o typetransparent resolves normally for other types and other names
714356345Scy	# o inform acts like transparent, but logs client IP address
715287917Sdes	# o inform_deny drops queries and logs client IP address
716356345Scy	# o inform_redirect redirects queries and logs client IP address
717369939Sgit2svn	# o always_transparent, always_refuse, always_nxdomain, always_nodata,
718369939Sgit2svn	#   always_deny resolve in that way but ignore local data for
719369939Sgit2svn	#   that name
720369939Sgit2svn	# o always_null returns 0.0.0.0 or ::0 for any name in the zone.
721356345Scy	# o noview breaks out of that view towards global local-zones.
722238106Sdes	#
723238106Sdes	# defaults are localhost address, reverse for 127.0.0.1 and ::1
724238106Sdes	# and nxdomain for AS112 zones. If you configure one of these zones
725238106Sdes	# the default content is omitted, or you can omit it with 'nodefault'.
726292206Sdes	#
727238106Sdes	# If you configure local-data without specifying local-zone, by
728238106Sdes	# default a transparent local-zone is created for the data.
729238106Sdes	#
730238106Sdes	# You can add locally served data with
731238106Sdes	# local-zone: "local." static
732238106Sdes	# local-data: "mycomputer.local. IN A 192.0.2.51"
733238106Sdes	# local-data: 'mytext.local TXT "content of text record"'
734238106Sdes	#
735238106Sdes	# You can override certain queries with
736238106Sdes	# local-data: "adserver.example.com A 127.0.0.1"
737238106Sdes	#
738238106Sdes	# You can redirect a domain to a fixed address with
739238106Sdes	# (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
740238106Sdes	# local-zone: "example.com" redirect
741238106Sdes	# local-data: "example.com A 192.0.2.3"
742238106Sdes	#
743238106Sdes	# Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
744238106Sdes	# You can also add PTR records using local-data directly, but then
745238106Sdes	# you need to do the reverse notation yourself.
746238106Sdes	# local-data-ptr: "192.0.2.3 www.example.com"
747238106Sdes
748307729Sdes	# tag a localzone with a list of tag names (in "" with spaces between)
749307729Sdes	# local-zone-tag: "example.com" "tag2 tag3"
750307729Sdes
751307729Sdes	# add a netblock specific override to a localzone, with zone type
752307729Sdes	# local-zone-override: "example.com" 192.0.2.0/24 refuse
753307729Sdes
754368129Scy	# service clients over TLS (on the TCP sockets) with plain DNS inside
755368129Scy	# the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484.
756368129Scy	# Give the certificate to use and private key.
757238106Sdes	# default is "" (disabled).  requires restart to take effect.
758356345Scy	# tls-service-key: "path/to/privatekeyfile.key"
759356345Scy	# tls-service-pem: "path/to/publiccertfile.pem"
760356345Scy	# tls-port: 853
761368129Scy	# https-port: 443
762238106Sdes
763356345Scy	# cipher setting for TLSv1.2
764356345Scy	# 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"
765356345Scy	# cipher setting for TLSv1.3
766356345Scy	# 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"
767356345Scy
768369939Sgit2svn	# Pad responses to padded queries received over TLS
769369939Sgit2svn	# pad-responses: yes
770369939Sgit2svn
771369939Sgit2svn	# Padded responses will be padded to the closest multiple of this size.
772369939Sgit2svn	# pad-responses-block-size: 468
773369939Sgit2svn
774366095Scy	# Use the SNI extension for TLS connections.  Default is yes.
775366095Scy	# Changing the value requires a reload.
776366095Scy	# tls-use-sni: yes
777366095Scy
778356345Scy	# Add the secret file for TLS Session Ticket.
779356345Scy	# Secret file must be 80 bytes of random data.
780356345Scy	# First key use to encrypt and decrypt TLS session tickets.
781356345Scy	# Other keys use to decrypt only.
782356345Scy	# requires restart to take effect.
783356345Scy	# tls-session-ticket-keys: "path/to/secret_file1"
784356345Scy	# tls-session-ticket-keys: "path/to/secret_file2"
785356345Scy
786356345Scy	# request upstream over TLS (with plain DNS inside the TLS stream).
787238106Sdes	# Default is no.  Can be turned on and off with unbound-control.
788356345Scy	# tls-upstream: no
789238106Sdes
790356345Scy	# Certificates used to authenticate connections made upstream.
791356345Scy	# tls-cert-bundle: ""
792356345Scy
793356345Scy	# Add system certs to the cert bundle, from the Windows Cert Store
794356345Scy	# tls-win-cert: no
795356345Scy
796369939Sgit2svn	# Pad queries over TLS upstreams
797369939Sgit2svn	# pad-queries: yes
798369939Sgit2svn
799369939Sgit2svn	# Padded queries will be padded to the closest multiple of this size.
800369939Sgit2svn	# pad-queries-block-size: 128
801369939Sgit2svn
802356345Scy	# Also serve tls on these port numbers (eg. 443, ...), by listing
803356345Scy	# tls-additional-port: portno for each of the port numbers.
804356345Scy
805368129Scy	# HTTP endpoint to provide DNS-over-HTTPS service on.
806368129Scy	# http-endpoint: "/dns-query"
807368129Scy
808368129Scy	# HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use.
809368129Scy	# http-max-streams: 100
810368129Scy
811368129Scy	# Maximum number of bytes used for all HTTP/2 query buffers.
812368129Scy	# http-query-buffer-size: 4m
813368129Scy
814368129Scy	# Maximum number of bytes used for all HTTP/2 response buffers.
815368129Scy	# http-response-buffer-size: 4m
816368129Scy
817368129Scy	# Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS
818368129Scy	# service.
819368129Scy	# http-nodelay: yes
820368129Scy
821368693Scy	# Disable TLS for DNS-over-HTTP downstream service.
822368693Scy	# http-notls-downstream: no
823368693Scy
824276605Sdes	# DNS64 prefix. Must be specified when DNS64 is use.
825276605Sdes	# Enable dns64 in module-config.  Used to synthesize IPv6 from IPv4.
826276605Sdes	# dns64-prefix: 64:ff9b::0/96
827276605Sdes
828356345Scy	# DNS64 ignore AAAA records for these domains and use A instead.
829356345Scy	# dns64-ignore-aaaa: "example.com"
830356345Scy
831287917Sdes	# ratelimit for uncached, new queries, this limits recursion effort.
832287917Sdes	# ratelimiting is experimental, and may help against randomqueryflood.
833287917Sdes	# if 0(default) it is disabled, otherwise state qps allowed per zone.
834287917Sdes	# ratelimit: 0
835287917Sdes
836287917Sdes	# ratelimits are tracked in a cache, size in bytes of cache (or k,m).
837287917Sdes	# ratelimit-size: 4m
838287917Sdes	# ratelimit cache slabs, reduces lock contention if equal to cpucount.
839287917Sdes	# ratelimit-slabs: 4
840292206Sdes
841287917Sdes	# 0 blocks when ratelimited, otherwise let 1/xth traffic through
842287917Sdes	# ratelimit-factor: 10
843287917Sdes
844287917Sdes	# override the ratelimit for a specific domain name.
845287917Sdes	# give this setting multiple times to have multiple overrides.
846287917Sdes	# ratelimit-for-domain: example.com 1000
847287917Sdes	# override the ratelimits for all domains below a domain name
848287917Sdes	# can give this multiple times, the name closest to the zone is used.
849307729Sdes	# ratelimit-below-domain: com 1000
850287917Sdes
851356345Scy	# global query ratelimit for all ip addresses.
852356345Scy	# feature is experimental.
853356345Scy	# if 0(default) it is disabled, otherwise states qps allowed per ip address
854356345Scy	# ip-ratelimit: 0
855356345Scy
856356345Scy	# ip ratelimits are tracked in a cache, size in bytes of cache (or k,m).
857356345Scy	# ip-ratelimit-size: 4m
858356345Scy	# ip ratelimit cache slabs, reduces lock contention if equal to cpucount.
859356345Scy	# ip-ratelimit-slabs: 4
860356345Scy
861356345Scy	# 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through
862356345Scy	# ip-ratelimit-factor: 10
863356345Scy
864356345Scy	# Limit the number of connections simultaneous from a netblock
865356345Scy	# tcp-connection-limit: 192.0.2.0/24 12
866356345Scy
867356345Scy	# select from the fastest servers this many times out of 1000. 0 means
868356345Scy	# the fast server select is disabled. prefetches are not sped up.
869356345Scy	# fast-server-permil: 0
870356345Scy	# the number of servers that will be used in the fast server selection.
871356345Scy	# fast-server-num: 3
872356345Scy
873356345Scy	# Specific options for ipsecmod. unbound needs to be configured with
874356345Scy	# --enable-ipsecmod for these to take effect.
875356345Scy	#
876356345Scy	# Enable or disable ipsecmod (it still needs to be defined in
877356345Scy	# module-config above). Can be used when ipsecmod needs to be
878356345Scy	# enabled/disabled via remote-control(below).
879356345Scy	# ipsecmod-enabled: yes
880356345Scy	#
881356345Scy	# Path to executable external hook. It must be defined when ipsecmod is
882356345Scy	# listed in module-config (above).
883356345Scy	# ipsecmod-hook: "./my_executable"
884356345Scy	#
885356345Scy	# When enabled unbound will reply with SERVFAIL if the return value of
886356345Scy	# the ipsecmod-hook is not 0.
887356345Scy	# ipsecmod-strict: no
888356345Scy	#
889356345Scy	# Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY.
890356345Scy	# ipsecmod-max-ttl: 3600
891356345Scy	#
892356345Scy	# Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for
893356345Scy	# testing.
894356345Scy	# ipsecmod-ignore-bogus: no
895356345Scy	#
896356345Scy	# Domains for which ipsecmod will be triggered. If not defined (default)
897368129Scy	# all domains are treated as being allowed.
898368129Scy	# ipsecmod-allow: "example.com"
899368129Scy	# ipsecmod-allow: "nlnetlabs.nl"
900356345Scy
901356345Scy
902238106Sdes# Python config section. To enable:
903238106Sdes# o use --with-pythonmodule to configure before compiling.
904238106Sdes# o list python in the module-config string (above) to enable.
905356345Scy#   It can be at the start, it gets validated results, or just before
906356345Scy#   the iterator and process before DNSSEC validation.
907238106Sdes# o and give a python-script to run.
908238106Sdespython:
909238106Sdes	# Script file to load
910238106Sdes	# python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py"
911238106Sdes
912366095Scy# Dynamic library config section. To enable:
913366095Scy# o use --with-dynlibmodule to configure before compiling.
914366095Scy# o list dynlib in the module-config string (above) to enable.
915366095Scy#   It can be placed anywhere, the dynlib module is only a very thin wrapper
916366095Scy#   to load modules dynamically.
917366095Scy# o and give a dynlib-file to run. If more than one dynlib entry is listed in
918366095Scy#   the module-config then you need one dynlib-file per instance.
919366095Scydynlib:
920366095Scy	# Script file to load
921366095Scy	# dynlib-file: "@UNBOUND_SHARE_DIR@/dynlib.so"
922366095Scy
923292206Sdes# Remote control config section.
924238106Sdesremote-control:
925238106Sdes	# Enable remote control with unbound-control(8) here.
926238106Sdes	# set up the keys and certificates with unbound-control-setup.
927238106Sdes	# control-enable: no
928238106Sdes
929238106Sdes	# what interfaces are listened to for remote control.
930238106Sdes	# give 0.0.0.0 and ::0 to listen to all interfaces.
931356345Scy	# set to an absolute path to use a unix local name pipe, certificates
932356345Scy	# are not used for that, so key and cert files need not be present.
933238106Sdes	# control-interface: 127.0.0.1
934238106Sdes	# control-interface: ::1
935238106Sdes
936238106Sdes	# port number for remote control operations.
937238106Sdes	# control-port: 8953
938238106Sdes
939356345Scy	# for localhost, you can disable use of TLS by setting this to "no"
940356345Scy	# For local sockets this option is ignored, and TLS is not used.
941356345Scy	# control-use-cert: "yes"
942356345Scy
943238106Sdes	# unbound server key file.
944238106Sdes	# server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key"
945238106Sdes
946238106Sdes	# unbound server certificate file.
947238106Sdes	# server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem"
948238106Sdes
949238106Sdes	# unbound-control key file.
950238106Sdes	# control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key"
951238106Sdes
952238106Sdes	# unbound-control certificate file.
953238106Sdes	# control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem"
954238106Sdes
955238106Sdes# Stub zones.
956292206Sdes# Create entries like below, to make all queries for 'example.com' and
957292206Sdes# 'example.org' go to the given list of nameservers. list zero or more
958292206Sdes# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
959238106Sdes# the list is treated as priming hints (default is no).
960238106Sdes# With stub-first yes, it attempts without the stub if it fails.
961289063Sdes# Consider adding domain-insecure: name and local-zone: name nodefault
962289063Sdes# to the server: section if the stub is a locally served zone.
963238106Sdes# stub-zone:
964238106Sdes#	name: "example.com"
965238106Sdes#	stub-addr: 192.0.2.68
966238106Sdes#	stub-prime: no
967238106Sdes#	stub-first: no
968356345Scy#	stub-tls-upstream: no
969356345Scy#	stub-no-cache: no
970238106Sdes# stub-zone:
971238106Sdes#	name: "example.org"
972238106Sdes#	stub-host: ns.example.com.
973238106Sdes
974238106Sdes# Forward zones
975238106Sdes# Create entries like below, to make all queries for 'example.com' and
976238106Sdes# 'example.org' go to the given list of servers. These servers have to handle
977238106Sdes# recursion to other nameservers. List zero or more nameservers by hostname
978238106Sdes# or by ipaddress. Use an entry with name "." to forward all queries.
979238106Sdes# If you enable forward-first, it attempts without the forward if it fails.
980238106Sdes# forward-zone:
981238106Sdes# 	name: "example.com"
982238106Sdes# 	forward-addr: 192.0.2.68
983238106Sdes# 	forward-addr: 192.0.2.73@5355  # forward to port 5355.
984238106Sdes# 	forward-first: no
985356345Scy# 	forward-tls-upstream: no
986356345Scy#	forward-no-cache: no
987238106Sdes# forward-zone:
988238106Sdes# 	name: "example.org"
989238106Sdes# 	forward-host: fwd.example.com
990356345Scy
991356345Scy# Authority zones
992356345Scy# The data for these zones is kept locally, from a file or downloaded.
993356345Scy# The data can be served to downstream clients, or used instead of the
994356345Scy# upstream (which saves a lookup to the upstream).  The first example
995356345Scy# has a copy of the root for local usage.  The second serves example.org
996356345Scy# authoritatively.  zonefile: reads from file (and writes to it if you also
997368129Scy# download it), primary: fetches with AXFR and IXFR, or url to zonefile.
998368129Scy# With allow-notify: you can give additional (apart from primaries) sources of
999356345Scy# notifies.
1000356345Scy# auth-zone:
1001356345Scy#	name: "."
1002368129Scy#	primary: 199.9.14.201         # b.root-servers.net
1003368129Scy#	primary: 192.33.4.12          # c.root-servers.net
1004368129Scy#	primary: 199.7.91.13          # d.root-servers.net
1005368129Scy#	primary: 192.5.5.241          # f.root-servers.net
1006368129Scy#	primary: 192.112.36.4         # g.root-servers.net
1007368129Scy#	primary: 193.0.14.129         # k.root-servers.net
1008368129Scy#	primary: 192.0.47.132         # xfr.cjr.dns.icann.org
1009368129Scy#	primary: 192.0.32.132         # xfr.lax.dns.icann.org
1010368129Scy#	primary: 2001:500:200::b      # b.root-servers.net
1011368129Scy#	primary: 2001:500:2::c        # c.root-servers.net
1012368129Scy#	primary: 2001:500:2d::d       # d.root-servers.net
1013368129Scy#	primary: 2001:500:2f::f       # f.root-servers.net
1014368129Scy#	primary: 2001:500:12::d0d     # g.root-servers.net
1015368129Scy#	primary: 2001:7fd::1          # k.root-servers.net
1016368129Scy#	primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org
1017368129Scy#	primary: 2620:0:2d0:202::132  # xfr.lax.dns.icann.org
1018356345Scy#	fallback-enabled: yes
1019356345Scy#	for-downstream: no
1020356345Scy#	for-upstream: yes
1021356345Scy# auth-zone:
1022356345Scy#	name: "example.org"
1023356345Scy#	for-downstream: yes
1024356345Scy#	for-upstream: yes
1025356345Scy#	zonefile: "example.org.zone"
1026356345Scy
1027356345Scy# Views
1028356345Scy# Create named views. Name must be unique. Map views to requests using
1029356345Scy# the access-control-view option. Views can contain zero or more local-zone
1030356345Scy# and local-data options. Options from matching views will override global
1031356345Scy# options. Global options will be used if no matching view is found.
1032356345Scy# With view-first yes, it will try to answer using the global local-zone and
1033356345Scy# local-data elements if there is no view specific match.
1034356345Scy# view:
1035356345Scy#	name: "viewname"
1036356345Scy#	local-zone: "example.com" redirect
1037356345Scy#	local-data: "example.com A 192.0.2.3"
1038356345Scy#	local-data-ptr: "192.0.2.3 www.example.com"
1039356345Scy#	view-first: no
1040356345Scy# view:
1041356345Scy#	name: "anotherview"
1042356345Scy#	local-zone: "example.com" refuse
1043356345Scy
1044356345Scy# DNSCrypt
1045356345Scy# Caveats:
1046356345Scy# 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper
1047356345Scy#   for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage
1048356345Scy# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to
1049356345Scy#   listen on `dnscrypt-port` with the follo0wing snippet:
1050356345Scy# server:
1051356345Scy#     interface: 0.0.0.0@443
1052356345Scy#     interface: ::0@443
1053356345Scy#
1054356345Scy# Finally, `dnscrypt` config has its own section.
1055356345Scy# dnscrypt:
1056356345Scy#     dnscrypt-enable: yes
1057356345Scy#     dnscrypt-port: 443
1058356345Scy#     dnscrypt-provider: 2.dnscrypt-cert.example.com.
1059356345Scy#     dnscrypt-secret-key: /path/unbound-conf/keys1/1.key
1060356345Scy#     dnscrypt-secret-key: /path/unbound-conf/keys2/1.key
1061356345Scy#     dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert
1062356345Scy#     dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert
1063356345Scy
1064356345Scy# CacheDB
1065356345Scy# Enable external backend DB as auxiliary cache.  Specify the backend name
1066356345Scy# (default is "testframe", which has no use other than for debugging and
1067356345Scy# testing) and backend-specific options.  The 'cachedb' module must be
1068356345Scy# included in module-config, just before the iterator module.
1069356345Scy# cachedb:
1070356345Scy#     backend: "testframe"
1071356345Scy#     # secret seed string to calculate hashed keys
1072356345Scy#     secret-seed: "default"
1073356345Scy#
1074356345Scy#     # For "redis" backend:
1075356345Scy#     # redis server's IP address or host name
1076356345Scy#     redis-server-host: 127.0.0.1
1077356345Scy#     # redis server's TCP port
1078356345Scy#     redis-server-port: 6379
1079356345Scy#     # timeout (in ms) for communication with the redis server
1080356345Scy#     redis-timeout: 100
1081366095Scy#     # set timeout on redis records based on DNS response TTL
1082366095Scy#     redis-expire-records: no
1083356345Scy
1084356345Scy# IPSet
1085356345Scy# Add specify domain into set via ipset.
1086366095Scy# Note: To enable ipset unbound needs to run as root user.
1087356345Scy# ipset:
1088356345Scy#     # set name for ip v4 addresses
1089356345Scy#     name-v4: "list-v4"
1090356345Scy#     # set name for ip v6 addresses
1091356345Scy#     name-v6: "list-v6"
1092356345Scy#
1093356345Scy
1094366095Scy# Dnstap logging support, if compiled in.  To enable, set the dnstap-enable
1095366095Scy# to yes and also some of dnstap-log-..-messages to yes.  And select an
1096366095Scy# upstream log destination, by socket path, TCP or TLS destination.
1097366095Scy# dnstap:
1098366095Scy# 	dnstap-enable: no
1099366095Scy# 	# if set to yes frame streams will be used in bidirectional mode
1100366095Scy# 	dnstap-bidirectional: yes
1101366095Scy# 	dnstap-socket-path: "@DNSTAP_SOCKET_PATH@"
1102366095Scy# 	# if "" use the unix socket in dnstap-socket-path, otherwise,
1103366095Scy# 	# set it to "IPaddress[@port]" of the destination.
1104366095Scy# 	dnstap-ip: ""
1105366095Scy# 	# if set to yes if you want to use TLS to dnstap-ip, no for TCP.
1106366095Scy# 	dnstap-tls: yes
1107366095Scy# 	# name for authenticating the upstream server. or "" disabled.
1108366095Scy# 	dnstap-tls-server-name: ""
1109366095Scy# 	# if "", it uses the cert bundle from the main unbound config.
1110366095Scy# 	dnstap-tls-cert-bundle: ""
1111366095Scy# 	# key file for client authentication, or "" disabled.
1112366095Scy# 	dnstap-tls-client-key-file: ""
1113366095Scy# 	# cert file for client authentication, or "" disabled.
1114366095Scy# 	dnstap-tls-client-cert-file: ""
1115366095Scy# 	dnstap-send-identity: no
1116366095Scy# 	dnstap-send-version: no
1117366095Scy# 	# if "" it uses the hostname.
1118366095Scy# 	dnstap-identity: ""
1119366095Scy# 	# if "" it uses the package version.
1120366095Scy# 	dnstap-version: ""
1121366095Scy# 	dnstap-log-resolver-query-messages: no
1122366095Scy# 	dnstap-log-resolver-response-messages: no
1123366095Scy# 	dnstap-log-client-query-messages: no
1124366095Scy# 	dnstap-log-client-response-messages: no
1125366095Scy# 	dnstap-log-forwarder-query-messages: no
1126366095Scy# 	dnstap-log-forwarder-response-messages: no
1127366095Scy
1128361435Scy# Response Policy Zones
1129361435Scy# RPZ policies. Applied in order of configuration. QNAME and Response IP
1130361435Scy# Address trigger are the only supported triggers. Supported actions are:
1131361435Scy# NXDOMAIN, NODATA, PASSTHRU, DROP and Local Data. Policies can be loaded from
1132361435Scy# file, using zone transfer, or using HTTP. The respip module needs to be added
1133361435Scy# to the module-config, e.g.: module-config: "respip validator iterator".
1134361435Scy# rpz:
1135361435Scy#     name: "rpz.example.com"
1136361435Scy#     zonefile: "rpz.example.com"
1137368129Scy#     primary: 192.0.2.0
1138361435Scy#     allow-notify: 192.0.2.0/32
1139361435Scy#     url: http://www.example.com/rpz.example.org.zone
1140361435Scy#     rpz-action-override: cname
1141361435Scy#     rpz-cname-override: www.example.org
1142361435Scy#     rpz-log: yes
1143361435Scy#     rpz-log-name: "example policy"
1144361435Scy#     tags: "example"
1145