2 # Example configuration file.
4 # See unbound.conf(5) man page, version 1.4.21.
8 #Use this to include other text into the file.
9 #include: "otherfile.conf"
11 # The server clause sets the main parameters.
13 # whitespace is not necessary, but looks cleaner.
15 # verbosity number, 0 is least verbose. 1 is default.
18 # print statistics to the log (for every thread) every N seconds.
19 # Set to "" or 0 to disable. Default is disabled.
20 # statistics-interval: 0
22 # enable cumulative statistics, without clearing them after printing.
23 # statistics-cumulative: no
25 # enable extended statistics (query types, answer codes, status)
26 # printed from unbound-control. default off, because of speed.
27 # extended-statistics: no
29 # number of threads to create. 1 disables threading.
32 # specify the interfaces to answer queries from by ip-address.
33 # The default is to listen to localhost (127.0.0.1 and ::1).
34 # specify 0.0.0.0 and ::0 to bind to all available interfaces.
35 # specify every interface[@port] on a new 'interface:' labelled line.
36 # The listen interfaces are not changed on reload, only on restart.
37 # interface: 192.0.2.153
38 # interface: 192.0.2.154
39 # interface: 192.0.2.154@5003
40 # interface: 2001:DB8::5
42 # enable this feature to copy the source address of queries to reply.
43 # Socket options are not supported on all platforms. experimental.
44 # interface-automatic: no
46 # port to answer queries from
49 # specify the interfaces to send outgoing queries to authoritative
50 # server from by ip-address. If none, the default (all) interface
51 # is used. Specify every interface on a 'outgoing-interface:' line.
52 # outgoing-interface: 192.0.2.153
53 # outgoing-interface: 2001:DB8::5
54 # outgoing-interface: 2001:DB8::6
56 # number of ports to allocate per thread, determines the size of the
57 # port range that can be open simultaneously. About double the
58 # num-queries-per-thread, or, use as many as the OS will allow you.
59 # outgoing-range: 4096
61 # permit unbound to use this port number or port range for
62 # making outgoing queries, using an outgoing interface.
63 # outgoing-port-permit: 32768
65 # deny unbound the use this of port number or port range for
66 # making outgoing queries, using an outgoing interface.
67 # Use this to make sure unbound does not grab a UDP port that some
68 # other server on this computer needs. The default is to avoid
69 # IANA-assigned port numbers.
70 # If multiple outgoing-port-permit and outgoing-port-avoid options
71 # are present, they are processed in order.
72 # outgoing-port-avoid: "3200-3208"
74 # number of outgoing simultaneous tcp buffers to hold per thread.
75 # outgoing-num-tcp: 10
77 # number of incoming simultaneous tcp buffers to hold per thread.
78 # incoming-num-tcp: 10
80 # buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
81 # 0 is system default. Use 4m to catch query spikes for busy servers.
84 # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
85 # 0 is system default. Use 4m to handle spikes on very busy servers.
88 # EDNS reassembly buffer to advertise to UDP peers (the actual buffer
89 # is set with msg-buffer-size). 1480 can solve fragmentation (timeouts).
90 # edns-buffer-size: 4096
92 # Maximum UDP response size (not applied to TCP response).
93 # Suggested values are 512 to 4096. Default is 4096. 65536 disables it.
96 # buffer size for handling DNS data. No messages larger than this
97 # size can be sent or received, by UDP or TCP. In bytes.
98 # msg-buffer-size: 65552
100 # the amount of memory to use for the message cache.
101 # plain value in bytes or you can append k, m or G. default is "4Mb".
104 # the number of slabs to use for the message cache.
105 # the number of slabs must be a power of 2.
106 # more slabs reduce lock contention, but fragment memory usage.
109 # the number of queries that a thread gets to service.
110 # num-queries-per-thread: 1024
112 # if very busy, 50% queries run to completion, 50% get timeout in msec
113 # jostle-timeout: 200
115 # the amount of memory to use for the RRset cache.
116 # plain value in bytes or you can append k, m or G. default is "4Mb".
117 # rrset-cache-size: 4m
119 # the number of slabs to use for the RRset cache.
120 # the number of slabs must be a power of 2.
121 # more slabs reduce lock contention, but fragment memory usage.
122 # rrset-cache-slabs: 4
124 # the time to live (TTL) value lower bound, in seconds. Default 0.
125 # If more than an hour could easily give trouble due to stale data.
128 # the time to live (TTL) value cap for RRsets and messages in the
129 # cache. Items are not cached for longer. In seconds.
130 # cache-max-ttl: 86400
132 # the time to live (TTL) value for cached roundtrip times, lameness and
133 # EDNS version information for hosts. In seconds.
134 # infra-host-ttl: 900
136 # the number of slabs to use for the Infrastructure cache.
137 # the number of slabs must be a power of 2.
138 # more slabs reduce lock contention, but fragment memory usage.
139 # infra-cache-slabs: 4
141 # the maximum number of hosts that are cached (roundtrip, EDNS, lame).
142 # infra-cache-numhosts: 10000
144 # Enable IPv4, "yes" or "no".
147 # Enable IPv6, "yes" or "no".
150 # Enable UDP, "yes" or "no".
153 # Enable TCP, "yes" or "no".
156 # upstream connections use TCP only (and no UDP), "yes" or "no"
157 # useful for tunneling scenarios, default no.
160 # Detach from the terminal, run in background, "yes" or "no".
163 # control which clients are allowed to make (recursive) queries
164 # to this server. Specify classless netblocks with /size and action.
165 # By default everything is refused, except for localhost.
166 # Choose deny (drop message), refuse (polite error reply),
167 # allow (recursive ok), allow_snoop (recursive and nonrecursive ok)
168 # access-control: 0.0.0.0/0 refuse
169 # access-control: 127.0.0.0/8 allow
170 # access-control: ::0/0 refuse
171 # access-control: ::1 allow
172 # access-control: ::ffff:127.0.0.1 allow
174 # if given, a chroot(2) is done to the given directory.
175 # i.e. you can chroot to the working directory, for example,
176 # for extra security, but make sure all files are in that directory.
178 # If chroot is enabled, you should pass the configfile (from the
179 # commandline) as a full path from the original root. After the
180 # chroot has been performed the now defunct portion of the config
181 # file path is removed to be able to reread the config after a reload.
183 # All other file paths (working dir, logfile, roothints, and
184 # key files) can be specified in several ways:
185 # o as an absolute path relative to the new root.
186 # o as a relative path to the working directory.
187 # o as an absolute path relative to the original root.
188 # In the last case the path is adjusted to remove the unused portion.
190 # The pid file can be absolute and outside of the chroot, it is
191 # written just prior to performing the chroot and dropping permissions.
193 # Additionally, unbound may need to access /dev/random (for entropy).
194 # How to do this is specific to your OS.
196 # If you give "" no chroot is performed. The path must not end in a /.
197 # chroot: "@UNBOUND_CHROOT_DIR@"
199 # if given, user privileges are dropped (after binding port),
200 # and the given username is assumed. Default is user "unbound".
201 # If you give "" no privileges are dropped.
202 # username: "@UNBOUND_USERNAME@"
204 # the working directory. The relative files in this config are
205 # relative to this directory. If you give "" the working directory
207 # directory: "@UNBOUND_RUN_DIR@"
209 # the log file, "" means log to stderr.
210 # Use of this option sets use-syslog to "no".
213 # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
214 # log to, with identity "unbound". If yes, it overrides the logfile.
217 # print UTC timestamp in ascii to logfile, default is epoch in seconds.
220 # print one line with time, IP, name, type, class for every query.
223 # the pid file. Can be an absolute path outside of chroot/work dir.
224 # pidfile: "@UNBOUND_PIDFILE@"
226 # file to read root hints from.
227 # get one from ftp://FTP.INTERNIC.NET/domain/named.cache
230 # enable to not answer id.server and hostname.bind queries.
233 # enable to not answer version.server and version.bind queries.
236 # the identity to report. Leave "" or default to return hostname.
239 # the version to report. Leave "" or default to return package version.
242 # the target fetch policy.
243 # series of integers describing the policy per dependency depth.
244 # The number of values in the list determines the maximum dependency
245 # depth the recursor will pursue before giving up. Each integer means:
246 # -1 : fetch all targets opportunistically,
247 # 0: fetch on demand,
248 # positive value: fetch that many targets opportunistically.
249 # Enclose the list of numbers between quotes ("").
250 # target-fetch-policy: "3 2 1 0 0"
252 # Harden against very small EDNS buffer sizes.
253 # harden-short-bufsize: no
255 # Harden against unseemly large queries.
256 # harden-large-queries: no
258 # Harden against out of zone rrsets, to avoid spoofing attempts.
261 # Harden against receiving dnssec-stripped data. If you turn it
262 # off, failing to validate dnskey data for a trustanchor will
263 # trigger insecure mode for that zone (like without a trustanchor).
264 # Default on, which insists on dnssec data for trust-anchored zones.
265 # harden-dnssec-stripped: yes
267 # Harden against queries that fall under dnssec-signed nxdomain names.
268 # harden-below-nxdomain: no
270 # Harden the referral path by performing additional queries for
271 # infrastructure data. Validates the replies (if possible).
272 # Default off, because the lookups burden the server. Experimental
273 # implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
274 # harden-referral-path: no
276 # Use 0x20-encoded random bits in the query to foil spoof attempts.
277 # This feature is an experimental implementation of draft dns-0x20.
278 # use-caps-for-id: no
280 # Enforce privacy of these addresses. Strips them away from answers.
281 # It may cause DNSSEC validation to additionally mark it as bogus.
282 # Protects against 'DNS Rebinding' (uses browser as network proxy).
283 # Only 'private-domain' and 'local-data' names are allowed to have
284 # these private addresses. No default.
285 # private-address: 10.0.0.0/8
286 # private-address: 172.16.0.0/12
287 # private-address: 192.168.0.0/16
288 # private-address: 169.254.0.0/16
289 # private-address: fd00::/8
290 # private-address: fe80::/10
292 # Allow the domain (and its subdomains) to contain private addresses.
293 # local-data statements are allowed to contain private addresses too.
294 # private-domain: "example.com"
296 # If nonzero, unwanted replies are not only reported in statistics,
297 # but also a running total is kept per thread. If it reaches the
298 # threshold, a warning is printed and a defensive action is taken,
299 # the cache is cleared to flush potential poison out of it.
300 # A suggested value is 10000000, the default is 0 (turned off).
301 # unwanted-reply-threshold: 0
303 # Do not query the following addresses. No DNS queries are sent there.
304 # List one address per entry. List classless netblocks with /size,
305 # do-not-query-address: 127.0.0.1/8
306 # do-not-query-address: ::1
308 # if yes, the above default do-not-query-address entries are present.
309 # if no, localhost can be queried (for testing and debugging).
310 # do-not-query-localhost: yes
312 # if yes, perform prefetching of almost expired message cache entries.
315 # if yes, perform key lookups adjacent to normal lookups.
318 # if yes, Unbound rotates RRSet order in response.
319 # rrset-roundrobin: no
321 # if yes, Unbound doesn't insert authority/additional sections
322 # into response messages when those sections are not required.
323 # minimal-responses: no
325 # module configuration of the server. A string with identifiers
326 # separated by spaces. "iterator" or "validator iterator"
327 # module-config: "validator iterator"
329 # File with trusted keys, kept uptodate using RFC5011 probes,
330 # initial file like trust-anchor-file, then it stores metadata.
331 # Use several entries, one per domain name, to track multiple zones.
333 # If you want to perform DNSSEC validation, run unbound-anchor before
334 # you start unbound (i.e. in the system boot scripts). And enable:
335 # Please note usage of unbound-anchor root anchor is at your own risk
336 # and under the terms of our LICENSE (see that file in the source).
337 # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
339 # File with DLV trusted keys. Same format as trust-anchor-file.
340 # There can be only one DLV configured, it is trusted from root down.
341 # Download http://ftp.isc.org/www/dlv/dlv.isc.org.key
342 # dlv-anchor-file: "dlv.isc.org.key"
344 # File with trusted keys for validation. Specify more than one file
345 # with several entries, one file per entry.
346 # Zone file format, with DS and DNSKEY entries.
347 # Note this gets out of date, use auto-trust-anchor-file please.
348 # trust-anchor-file: ""
350 # Trusted key for validation. DS or DNSKEY. specify the RR on a
351 # single line, surrounded by "". TTL is ignored. class is IN default.
352 # Note this gets out of date, use auto-trust-anchor-file please.
353 # (These examples are from August 2007 and may not be valid anymore).
354 # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
355 # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
357 # File with trusted keys for validation. Specify more than one file
358 # with several entries, one file per entry. Like trust-anchor-file
359 # but has a different file format. Format is BIND-9 style format,
360 # the trusted-keys { name flag proto algo "key"; }; clauses are read.
361 # you need external update procedures to track changes in keys.
362 # trusted-keys-file: ""
364 # Ignore chain of trust. Domain is treated as insecure.
365 # domain-insecure: "example.com"
367 # Override the date for validation with a specific fixed date.
368 # Do not set this unless you are debugging signature inception
369 # and expiration. "" or "0" turns the feature off. -1 ignores date.
370 # val-override-date: ""
372 # The time to live for bogus data, rrsets and messages. This avoids
373 # some of the revalidation, until the time interval expires. in secs.
376 # The signature inception and expiration dates are allowed to be off
377 # by 10% of the signature lifetime (expir-incep) from our local clock.
378 # This leeway is capped with a minimum and a maximum. In seconds.
379 # val-sig-skew-min: 3600
380 # val-sig-skew-max: 86400
382 # Should additional section of secure message also be kept clean of
383 # unsecure data. Useful to shield the users of this validator from
384 # potential bogus data in the additional section. All unsigned data
385 # in the additional section is removed from secure messages.
386 # val-clean-additional: yes
388 # Turn permissive mode on to permit bogus messages. Thus, messages
389 # for which security checks failed will be returned to clients,
390 # instead of SERVFAIL. It still performs the security checks, which
391 # result in interesting log files and possibly the AD bit in
392 # replies if the message is found secure. The default is off.
393 # val-permissive-mode: no
395 # Ignore the CD flag in incoming queries and refuse them bogus data.
396 # Enable it if the only clients of unbound are legacy servers (w2008)
397 # that set CD but cannot validate themselves.
400 # Have the validator log failed validations for your diagnosis.
401 # 0: off. 1: A line per failed user query. 2: With reason and bad IP.
404 # It is possible to configure NSEC3 maximum iteration counts per
405 # keysize. Keep this table very short, as linear search is done.
406 # A message with an NSEC3 with larger count is marked insecure.
407 # List in ascending order the keysize and count values.
408 # val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
410 # instruct the auto-trust-anchor-file probing to add anchors after ttl.
411 # add-holddown: 2592000 # 30 days
413 # instruct the auto-trust-anchor-file probing to del anchors after ttl.
414 # del-holddown: 2592000 # 30 days
416 # auto-trust-anchor-file probing removes missing anchors after ttl.
417 # If the value 0 is given, missing anchors are not removed.
418 # keep-missing: 31622400 # 366 days
420 # the amount of memory to use for the key cache.
421 # plain value in bytes or you can append k, m or G. default is "4Mb".
424 # the number of slabs to use for the key cache.
425 # the number of slabs must be a power of 2.
426 # more slabs reduce lock contention, but fragment memory usage.
429 # the amount of memory to use for the negative cache (used for DLV).
430 # plain value in bytes or you can append k, m or G. default is "1Mb".
433 # By default, for a number of zones a small default 'nothing here'
434 # reply is built-in. Query traffic is thus blocked. If you
435 # wish to serve such zone you can unblock them by uncommenting one
436 # of the nodefault statements below.
437 # You may also have to use domain-insecure: zone to make DNSSEC work,
438 # unless you have your own trust anchors for this zone.
439 # local-zone: "localhost." nodefault
440 # local-zone: "127.in-addr.arpa." nodefault
441 # 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
442 # local-zone: "10.in-addr.arpa." nodefault
443 # local-zone: "16.172.in-addr.arpa." nodefault
444 # local-zone: "17.172.in-addr.arpa." nodefault
445 # local-zone: "18.172.in-addr.arpa." nodefault
446 # local-zone: "19.172.in-addr.arpa." nodefault
447 # local-zone: "20.172.in-addr.arpa." nodefault
448 # local-zone: "21.172.in-addr.arpa." nodefault
449 # local-zone: "22.172.in-addr.arpa." nodefault
450 # local-zone: "23.172.in-addr.arpa." nodefault
451 # local-zone: "24.172.in-addr.arpa." nodefault
452 # local-zone: "25.172.in-addr.arpa." nodefault
453 # local-zone: "26.172.in-addr.arpa." nodefault
454 # local-zone: "27.172.in-addr.arpa." nodefault
455 # local-zone: "28.172.in-addr.arpa." nodefault
456 # local-zone: "29.172.in-addr.arpa." nodefault
457 # local-zone: "30.172.in-addr.arpa." nodefault
458 # local-zone: "31.172.in-addr.arpa." nodefault
459 # local-zone: "168.192.in-addr.arpa." nodefault
460 # local-zone: "0.in-addr.arpa." nodefault
461 # local-zone: "254.169.in-addr.arpa." nodefault
462 # local-zone: "2.0.192.in-addr.arpa." nodefault
463 # local-zone: "100.51.198.in-addr.arpa." nodefault
464 # local-zone: "113.0.203.in-addr.arpa." nodefault
465 # local-zone: "255.255.255.255.in-addr.arpa." nodefault
466 # 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
467 # local-zone: "d.f.ip6.arpa." nodefault
468 # local-zone: "8.e.f.ip6.arpa." nodefault
469 # local-zone: "9.e.f.ip6.arpa." nodefault
470 # local-zone: "a.e.f.ip6.arpa." nodefault
471 # local-zone: "b.e.f.ip6.arpa." nodefault
472 # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
474 # a number of locally served zones can be configured.
475 # local-zone: <zone> <type>
476 # local-data: "<resource record string>"
477 # o deny serves local data (if any), else, drops queries.
478 # o refuse serves local data (if any), else, replies with error.
479 # o static serves local data, else, nxdomain or nodata answer.
480 # o transparent gives local data, but resolves normally for other names
481 # o redirect serves the zone data for any subdomain in the zone.
482 # o nodefault can be used to normally resolve AS112 zones.
483 # o typetransparent resolves normally for other types and other names
485 # defaults are localhost address, reverse for 127.0.0.1 and ::1
486 # and nxdomain for AS112 zones. If you configure one of these zones
487 # the default content is omitted, or you can omit it with 'nodefault'.
489 # If you configure local-data without specifying local-zone, by
490 # default a transparent local-zone is created for the data.
492 # You can add locally served data with
493 # local-zone: "local." static
494 # local-data: "mycomputer.local. IN A 192.0.2.51"
495 # local-data: 'mytext.local TXT "content of text record"'
497 # You can override certain queries with
498 # local-data: "adserver.example.com A 127.0.0.1"
500 # You can redirect a domain to a fixed address with
501 # (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
502 # local-zone: "example.com" redirect
503 # local-data: "example.com A 192.0.2.3"
505 # Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
506 # You can also add PTR records using local-data directly, but then
507 # you need to do the reverse notation yourself.
508 # local-data-ptr: "192.0.2.3 www.example.com"
510 # service clients over SSL (on the TCP sockets), with plain DNS inside
511 # the SSL stream. Give the certificate to use and private key.
512 # default is "" (disabled). requires restart to take effect.
513 # ssl-service-key: "path/to/privatekeyfile.key"
514 # ssl-service-pem: "path/to/publiccertfile.pem"
517 # request upstream over SSL (with plain DNS inside the SSL stream).
518 # Default is no. Can be turned on and off with unbound-control.
521 # Python config section. To enable:
522 # o use --with-pythonmodule to configure before compiling.
523 # o list python in the module-config string (above) to enable.
524 # o and give a python-script to run.
526 # Script file to load
527 # python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py"
529 # Remote control config section.
531 # Enable remote control with unbound-control(8) here.
532 # set up the keys and certificates with unbound-control-setup.
535 # what interfaces are listened to for remote control.
536 # give 0.0.0.0 and ::0 to listen to all interfaces.
537 # control-interface: 127.0.0.1
538 # control-interface: ::1
540 # port number for remote control operations.
543 # unbound server key file.
544 # server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key"
546 # unbound server certificate file.
547 # server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem"
549 # unbound-control key file.
550 # control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key"
552 # unbound-control certificate file.
553 # control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem"
556 # Create entries like below, to make all queries for 'example.com' and
557 # 'example.org' go to the given list of nameservers. list zero or more
558 # nameservers by hostname or by ipaddress. If you set stub-prime to yes,
559 # the list is treated as priming hints (default is no).
560 # With stub-first yes, it attempts without the stub if it fails.
562 # name: "example.com"
563 # stub-addr: 192.0.2.68
567 # name: "example.org"
568 # stub-host: ns.example.com.
571 # Create entries like below, to make all queries for 'example.com' and
572 # 'example.org' go to the given list of servers. These servers have to handle
573 # recursion to other nameservers. List zero or more nameservers by hostname
574 # or by ipaddress. Use an entry with name "." to forward all queries.
575 # If you enable forward-first, it attempts without the forward if it fails.
577 # name: "example.com"
578 # forward-addr: 192.0.2.68
579 # forward-addr: 192.0.2.73@5355 # forward to port 5355.
582 # name: "example.org"
583 # forward-host: fwd.example.com