1 # To test, all options are used.
3 # Example configuration file.
5 # See unbound.conf(5) man page.
9 #Use this to include other text into the file.
10 #include: "otherfile.conf"
12 # The server clause sets the main parameters.
14 # whitespace is not necessary, but looks cleaner.
16 # verbosity number, 0 is least verbose. 1 is default.
19 # number of threads to create. 1 disables threading.
22 # specify the interfaces to answer queries from by ip-address.
23 # If you give none the default (all) interface is used.
24 # specify every interface on a new 'interface:' labelled line.
25 interface: 192.0.2.153
26 interface: 192.0.2.154
27 interface: 2001:DB8::5
29 # port to answer queries from
32 # number of port to allocate per thread, determines the size of the
33 # port range. A larger port range gives more resistance to certain
34 # spoof attacks, as it gets harder to guess which port is used.
35 # But also takes more system resources (for open sockets).
38 outgoing-port-permit: 1000-1020
39 outgoing-port-avoid: 2000-2048
40 outgoing-port-avoid: 3000
42 # number of outgoing simultaneous tcp buffers to hold per thread.
45 # number of incoming simultaneous tcp buffers to hold per thread.
48 # buffer size for handling DNS data. No messages larger than this
49 # size can be sent or received, by UDP or TCP. In bytes.
50 msg-buffer-size: 65552
52 # the amount of memory to use for the message cache.
53 # in bytes. default is 4 Mb
54 msg-cache-size: 4194304
56 # the number of slabs to use for the message cache.
57 # the number of slabs must be a power of 2.
58 # more slabs reduce lock contention, but fragment memory usage.
61 # the number of queries that a thread gets to service.
62 num-queries-per-thread: 1024
64 # the amount of memory to use for the RRset cache.
65 # in bytes. default is 4 Mb
66 rrset-cache-size: 4194304
68 # the number of slabs to use for the RRset cache.
69 # the number of slabs must be a power of 2.
70 # more slabs reduce lock contention, but fragment memory usage.
73 # the time to live (TTL) value for cached roundtrip times and
74 # EDNS version information for hosts. In seconds.
77 # the time to live (TTL) value for cached lame delegations. In sec.
80 # the number of slabs to use for the Infrastructure cache.
81 # the number of slabs must be a power of 2.
82 # more slabs reduce lock contention, but fragment memory usage.
85 # the maximum number of hosts that are cached (roundtrip times, EDNS).
86 infra-cache-numhosts: 10000
88 # the maximum size of the lame zones cached per host. in bytes.
89 infra-cache-lame-size: 10240
91 # Enable IPv4, "yes" or "no".
94 # Enable IPv6, "yes" or "no".
97 # Enable UDP, "yes" or "no".
100 # Enable TCP, "yes" or "no".
103 # if given, a chroot(2) is done to the given directory.
104 # i.e. you can chroot to the working directory, for example,
105 # for extra security, but make sure all files are in that directory.
108 # if given, user privileges are dropped (after binding port),
109 # and the given username is assumed. Default is nothing "".
112 # the working directory.
115 # the log file, "" means log to stderr.
116 # Use of this option sets use-syslog to "no".
119 # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
120 # log to, with identity "unbound". If yes, it overrides the logfile.
124 pidfile: "unbound.pid"
126 # enable to not answer id.server and hostname.bind queries.
129 # enable to not answer version.server and version.bind queries.
132 # the identity to report. Leave "" or default to return hostname.
135 # the version to report. Leave "" or default to return package version.
138 # the target fetch policy.
139 # series of integers describing the policy per dependency depth.
140 # The number of values in the list determines the maximum dependency
141 # depth the recursor will pursue before giving up. Each integer means:
142 # -1 : fetch all targets opportunistically,
143 # 0: fetch on demand,
144 # positive value: fetch that many targets opportunistically.
145 # Enclose the list of numbers between quotes ("").
146 target-fetch-policy: "3 2 1 0 0"
148 # Harden against very small EDNS buffer sizes.
149 harden-short-bufsize: yes
151 # Harden against unseemly large queries.
152 harden-large-queries: yes
154 # Harden against out of zone rrsets, to avoid spoofing attempts.
157 # Do not query the following addresses. No DNS queries are sent there.
158 # List one address per entry. To block other ports than the default
159 # DNS port, use "1.2.3.4@123" to block port 123 for 1.2.3.4.
160 do-not-query-address: 127.0.0.1
161 do-not-query-address: 127.0.0.2
162 do-not-query-address: 127.255.255.255
163 do-not-query-address: ::1
165 # module configuration of the server. A string with identifiers
166 # separated by spaces. "iterator" or "validator iterator"
167 module-config: "validator iterator"
169 # File with trusted keys for validation. Specify more than one file
170 # with several entries, one file per entry.
171 # Zone file format, with DS and DNSKEY entries.
172 trust-anchor-file: ""
174 # Trusted key for validation. DS or DNSKEY. specify the RR on a
175 # single line, surrounded by "". TTL is ignored. class is IN default.
176 # (These examples are from August 2007 and may not be valid anymore).
177 trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
178 trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
180 # File with trusted keys for validation. Specify more than one file
181 # with several entries, one file per entry. Like trust-anchor-file
182 # but has a different file format. Format is BIND-9 style format,
183 # the trusted-keys { name flag proto algo "key"; }; clauses are read.
184 trusted-keys-file: ""
186 # Override the date for validation with a specific fixed date.
187 # Do not set this unless you are debugging signature inception
188 # and expiration. "" or "0" turns the feature off.
189 val-override-date: ""
191 # The time to live for bogus data, rrsets and messages. This avoids
192 # some of the revalidation, until the time interval expires. in secs.
195 # Should additional section of secure message also be kept clean of
196 # unsecure data. Useful to shield the users of this validator from
197 # potential bogus data in the additional section. All unsigned data
198 # in the additional section is removed from secure messages.
199 val-clean-additional: yes
201 # Turn permissive mode on to permit bogus messages. Thus, messages
202 # for which security checks failed will be returned to clients,
203 # instead of SERVFAIL. It still performs the security checks, which
204 # result in interesting log files and possibly the AD bit in
205 # replies if the message is found secure. The default is off.
206 val-permissive-mode: no
208 # It is possible to configure NSEC3 maximum iteration counts per
209 # keysize. Keep this table very short, as linear search is done.
210 # A message with an NSEC3 with larger count is marked insecure.
211 # List in ascending order the keysize and count values.
212 val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
214 # the amount of memory to use for the key cache.
215 # in bytes. default is 4 Mb
216 key-cache-size: 4194304
218 # the number of slabs to use for the key cache.
219 # the number of slabs must be a power of 2.
220 # more slabs reduce lock contention, but fragment memory usage.
223 # the value of the Differentiated Services Codepoint (DSCP)
224 # in the differentiated services field (DS) of the outgoing
229 # Create entries like below, to make all queries for 'example.com' and
230 # 'example.org' go to the given list of nameservers. list zero or more
231 # nameservers by hostname or by ipaddress.
234 stub-addr: 192.0.2.68
237 stub-host: ns.example.com.
240 # Create entries like below, to make all queries for 'example.com' and
241 # 'example.org' go to the given list of servers. These servers have to handle
242 # recursion to other nameservers. List zero or more nameservers by hostname
243 # or by ipaddress. Use an entry with name "." to forward all queries.
246 forward-addr: 192.0.2.68
247 forward-addr: 192.0.2.73@5355 # forward to port 5355.
250 forward-host: fwd.example.com