1# 2# Example configuration file. 3# 4# See unbound.conf(5) man page, version 1.4.16. 5# 6# this is a comment. 7 8#Use this to include other text into the file. 9#include: "otherfile.conf" 10 11# The server clause sets the main parameters. 12server: 13 # whitespace is not necessary, but looks cleaner. 14 15 # verbosity number, 0 is least verbose. 1 is default. 16 verbosity: 1 17 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 21 22 # enable cumulative statistics, without clearing them after printing. 23 # statistics-cumulative: no 24 25 # enable extended statistics (query types, answer codes, status) 26 # printed from unbound-control. default off, because of speed. 27 # extended-statistics: no 28 29 # number of threads to create. 1 disables threading. 30 # num-threads: 1 31 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 41 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 45 46 # port to answer queries from 47 # port: 53 48 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 55 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 60 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 64 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 # outgoing-port-avoid: "3200-3208" 71 72 # number of outgoing simultaneous tcp buffers to hold per thread. 73 # outgoing-num-tcp: 10 74 75 # number of incoming simultaneous tcp buffers to hold per thread. 76 # incoming-num-tcp: 10 77 78 # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). 79 # 0 is system default. Use 4m to catch query spikes for busy servers. 80 # so-rcvbuf: 0 81 82 # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option). 83 # 0 is system default. Use 4m to handle spikes on very busy servers. 84 # so-sndbuf: 0 85 86 # EDNS reassembly buffer to advertise to UDP peers (the actual buffer 87 # is set with msg-buffer-size). 1480 can solve fragmentation (timeouts). 88 # edns-buffer-size: 4096 89 90 # buffer size for handling DNS data. No messages larger than this 91 # size can be sent or received, by UDP or TCP. In bytes. 92 # msg-buffer-size: 65552 93 94 # the amount of memory to use for the message cache. 95 # plain value in bytes or you can append k, m or G. default is "4Mb". 96 # msg-cache-size: 4m 97 98 # the number of slabs to use for the message cache. 99 # the number of slabs must be a power of 2. 100 # more slabs reduce lock contention, but fragment memory usage. 101 # msg-cache-slabs: 4 102 103 # the number of queries that a thread gets to service. 104 # num-queries-per-thread: 1024 105 106 # if very busy, 50% queries run to completion, 50% get timeout in msec 107 # jostle-timeout: 200 108 109 # the amount of memory to use for the RRset cache. 110 # plain value in bytes or you can append k, m or G. default is "4Mb". 111 # rrset-cache-size: 4m 112 113 # the number of slabs to use for the RRset cache. 114 # the number of slabs must be a power of 2. 115 # more slabs reduce lock contention, but fragment memory usage. 116 # rrset-cache-slabs: 4 117 118 # the time to live (TTL) value lower bound, in seconds. Default 0. 119 # If more than an hour could easily give trouble due to stale data. 120 # cache-min-ttl: 0 121 122 # the time to live (TTL) value cap for RRsets and messages in the 123 # cache. Items are not cached for longer. In seconds. 124 # cache-max-ttl: 86400 125 126 # the time to live (TTL) value for cached roundtrip times, lameness and 127 # EDNS version information for hosts. In seconds. 128 # infra-host-ttl: 900 129 130 # the number of slabs to use for the Infrastructure cache. 131 # the number of slabs must be a power of 2. 132 # more slabs reduce lock contention, but fragment memory usage. 133 # infra-cache-slabs: 4 134 135 # the maximum number of hosts that are cached (roundtrip, EDNS, lame). 136 # infra-cache-numhosts: 10000 137 138 # Enable IPv4, "yes" or "no". 139 # do-ip4: yes 140 141 # Enable IPv6, "yes" or "no". 142 # do-ip6: yes 143 144 # Enable UDP, "yes" or "no". 145 # do-udp: yes 146 147 # Enable TCP, "yes" or "no". 148 # do-tcp: yes 149 150 # upstream connections use TCP only (and no UDP), "yes" or "no" 151 # useful for tunneling scenarios, default no. 152 # tcp-upstream: no 153 154 # Detach from the terminal, run in background, "yes" or "no". 155 # do-daemonize: yes 156 157 # control which clients are allowed to make (recursive) queries 158 # to this server. Specify classless netblocks with /size and action. 159 # By default everything is refused, except for localhost. 160 # Choose deny (drop message), refuse (polite error reply), 161 # allow (recursive ok), allow_snoop (recursive and nonrecursive ok) 162 # access-control: 0.0.0.0/0 refuse 163 # access-control: 127.0.0.0/8 allow 164 # access-control: ::0/0 refuse 165 # access-control: ::1 allow 166 # access-control: ::ffff:127.0.0.1 allow 167 168 # if given, a chroot(2) is done to the given directory. 169 # i.e. you can chroot to the working directory, for example, 170 # for extra security, but make sure all files are in that directory. 171 # 172 # If chroot is enabled, you should pass the configfile (from the 173 # commandline) as a full path from the original root. After the 174 # chroot has been performed the now defunct portion of the config 175 # file path is removed to be able to reread the config after a reload. 176 # 177 # All other file paths (working dir, logfile, roothints, and 178 # key files) can be specified in several ways: 179 # o as an absolute path relative to the new root. 180 # o as a relative path to the working directory. 181 # o as an absolute path relative to the original root. 182 # In the last case the path is adjusted to remove the unused portion. 183 # 184 # The pid file can be absolute and outside of the chroot, it is 185 # written just prior to performing the chroot and dropping permissions. 186 # 187 # Additionally, unbound may need to access /dev/random (for entropy). 188 # How to do this is specific to your OS. 189 # 190 # If you give "" no chroot is performed. The path must not end in a /. 191 # chroot: "@UNBOUND_CHROOT_DIR@" 192 193 # if given, user privileges are dropped (after binding port), 194 # and the given username is assumed. Default is user "unbound". 195 # If you give "" no privileges are dropped. 196 # username: "@UNBOUND_USERNAME@" 197 198 # the working directory. The relative files in this config are 199 # relative to this directory. If you give "" the working directory 200 # is not changed. 201 # directory: "@UNBOUND_RUN_DIR@" 202 203 # the log file, "" means log to stderr. 204 # Use of this option sets use-syslog to "no". 205 # logfile: "" 206 207 # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to 208 # log to, with identity "unbound". If yes, it overrides the logfile. 209 # use-syslog: yes 210 211 # print UTC timestamp in ascii to logfile, default is epoch in seconds. 212 # log-time-ascii: no 213 214 # print one line with time, IP, name, type, class for every query. 215 # log-queries: no 216 217 # the pid file. Can be an absolute path outside of chroot/work dir. 218 # pidfile: "@UNBOUND_PIDFILE@" 219 220 # file to read root hints from. 221 # get one from ftp://FTP.INTERNIC.NET/domain/named.cache 222 # root-hints: "" 223 224 # enable to not answer id.server and hostname.bind queries. 225 # hide-identity: no 226 227 # enable to not answer version.server and version.bind queries. 228 # hide-version: no 229 230 # the identity to report. Leave "" or default to return hostname. 231 # identity: "" 232 233 # the version to report. Leave "" or default to return package version. 234 # version: "" 235 236 # the target fetch policy. 237 # series of integers describing the policy per dependency depth. 238 # The number of values in the list determines the maximum dependency 239 # depth the recursor will pursue before giving up. Each integer means: 240 # -1 : fetch all targets opportunistically, 241 # 0: fetch on demand, 242 # positive value: fetch that many targets opportunistically. 243 # Enclose the list of numbers between quotes (""). 244 # target-fetch-policy: "3 2 1 0 0" 245 246 # Harden against very small EDNS buffer sizes. 247 # harden-short-bufsize: no 248 249 # Harden against unseemly large queries. 250 # harden-large-queries: no 251 252 # Harden against out of zone rrsets, to avoid spoofing attempts. 253 # harden-glue: yes 254 255 # Harden against receiving dnssec-stripped data. If you turn it 256 # off, failing to validate dnskey data for a trustanchor will 257 # trigger insecure mode for that zone (like without a trustanchor). 258 # Default on, which insists on dnssec data for trust-anchored zones. 259 # harden-dnssec-stripped: yes 260 261 # Harden against queries that fall under dnssec-signed nxdomain names. 262 # harden-below-nxdomain: no 263 264 # Harden the referral path by performing additional queries for 265 # infrastructure data. Validates the replies (if possible). 266 # Default off, because the lookups burden the server. Experimental 267 # implementation of draft-wijngaards-dnsext-resolver-side-mitigation. 268 # harden-referral-path: no 269 270 # Use 0x20-encoded random bits in the query to foil spoof attempts. 271 # This feature is an experimental implementation of draft dns-0x20. 272 # use-caps-for-id: no 273 274 # Enforce privacy of these addresses. Strips them away from answers. 275 # It may cause DNSSEC validation to additionally mark it as bogus. 276 # Protects against 'DNS Rebinding' (uses browser as network proxy). 277 # Only 'private-domain' and 'local-data' names are allowed to have 278 # these private addresses. No default. 279 # private-address: 10.0.0.0/8 280 # private-address: 172.16.0.0/12 281 # private-address: 192.168.0.0/16 282 # private-address: 169.254.0.0/16 283 # private-address: fd00::/8 284 # private-address: fe80::/10 285 286 # Allow the domain (and its subdomains) to contain private addresses. 287 # local-data statements are allowed to contain private addresses too. 288 # private-domain: "example.com" 289 290 # If nonzero, unwanted replies are not only reported in statistics, 291 # but also a running total is kept per thread. If it reaches the 292 # threshold, a warning is printed and a defensive action is taken, 293 # the cache is cleared to flush potential poison out of it. 294 # A suggested value is 10000000, the default is 0 (turned off). 295 # unwanted-reply-threshold: 0 296 297 # Do not query the following addresses. No DNS queries are sent there. 298 # List one address per entry. List classless netblocks with /size, 299 # do-not-query-address: 127.0.0.1/8 300 # do-not-query-address: ::1 301 302 # if yes, the above default do-not-query-address entries are present. 303 # if no, localhost can be queried (for testing and debugging). 304 # do-not-query-localhost: yes 305 306 # if yes, perform prefetching of almost expired message cache entries. 307 # prefetch: no 308 309 # if yes, perform key lookups adjacent to normal lookups. 310 # prefetch-key: no 311 312 # module configuration of the server. A string with identifiers 313 # separated by spaces. "iterator" or "validator iterator" 314 # module-config: "validator iterator" 315 316 # File with trusted keys, kept uptodate using RFC5011 probes, 317 # initial file like trust-anchor-file, then it stores metadata. 318 # Use several entries, one per domain name, to track multiple zones. 319 # 320 # If you want to perform DNSSEC validation, run unbound-anchor before 321 # you start unbound (i.e. in the system boot scripts). And enable: 322 # Please note usage of unbound-anchor root anchor is at your own risk 323 # and under the terms of our LICENSE (see that file in the source). 324 # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" 325 326 # File with DLV trusted keys. Same format as trust-anchor-file. 327 # There can be only one DLV configured, it is trusted from root down. 328 # Download http://ftp.isc.org/www/dlv/dlv.isc.org.key 329 # dlv-anchor-file: "dlv.isc.org.key" 330 331 # File with trusted keys for validation. Specify more than one file 332 # with several entries, one file per entry. 333 # Zone file format, with DS and DNSKEY entries. 334 # Note this gets out of date, use auto-trust-anchor-file please. 335 # trust-anchor-file: "" 336 337 # Trusted key for validation. DS or DNSKEY. specify the RR on a 338 # single line, surrounded by "". TTL is ignored. class is IN default. 339 # Note this gets out of date, use auto-trust-anchor-file please. 340 # (These examples are from August 2007 and may not be valid anymore). 341 # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ==" 342 # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A" 343 344 # File with trusted keys for validation. Specify more than one file 345 # with several entries, one file per entry. Like trust-anchor-file 346 # but has a different file format. Format is BIND-9 style format, 347 # the trusted-keys { name flag proto algo "key"; }; clauses are read. 348 # you need external update procedures to track changes in keys. 349 # trusted-keys-file: "" 350 351 # Ignore chain of trust. Domain is treated as insecure. 352 # domain-insecure: "example.com" 353 354 # Override the date for validation with a specific fixed date. 355 # Do not set this unless you are debugging signature inception 356 # and expiration. "" or "0" turns the feature off. -1 ignores date. 357 # val-override-date: "" 358 359 # The time to live for bogus data, rrsets and messages. This avoids 360 # some of the revalidation, until the time interval expires. in secs. 361 # val-bogus-ttl: 60 362 363 # The signature inception and expiration dates are allowed to be off 364 # by 10% of the signature lifetime (expir-incep) from our local clock. 365 # This leeway is capped with a minimum and a maximum. In seconds. 366 # val-sig-skew-min: 3600 367 # val-sig-skew-max: 86400 368 369 # Should additional section of secure message also be kept clean of 370 # unsecure data. Useful to shield the users of this validator from 371 # potential bogus data in the additional section. All unsigned data 372 # in the additional section is removed from secure messages. 373 # val-clean-additional: yes 374 375 # Turn permissive mode on to permit bogus messages. Thus, messages 376 # for which security checks failed will be returned to clients, 377 # instead of SERVFAIL. It still performs the security checks, which 378 # result in interesting log files and possibly the AD bit in 379 # replies if the message is found secure. The default is off. 380 # val-permissive-mode: no 381 382 # Ignore the CD flag in incoming queries and refuse them bogus data. 383 # Enable it if the only clients of unbound are legacy servers (w2008) 384 # that set CD but cannot validate themselves. 385 # ignore-cd-flag: no 386 387 # Have the validator log failed validations for your diagnosis. 388 # 0: off. 1: A line per failed user query. 2: With reason and bad IP. 389 # val-log-level: 0 390 391 # It is possible to configure NSEC3 maximum iteration counts per 392 # keysize. Keep this table very short, as linear search is done. 393 # A message with an NSEC3 with larger count is marked insecure. 394 # List in ascending order the keysize and count values. 395 # val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500" 396 397 # instruct the auto-trust-anchor-file probing to add anchors after ttl. 398 # add-holddown: 2592000 # 30 days 399 400 # instruct the auto-trust-anchor-file probing to del anchors after ttl. 401 # del-holddown: 2592000 # 30 days 402 403 # auto-trust-anchor-file probing removes missing anchors after ttl. 404 # If the value 0 is given, missing anchors are not removed. 405 # keep-missing: 31622400 # 366 days 406 407 # the amount of memory to use for the key cache. 408 # plain value in bytes or you can append k, m or G. default is "4Mb". 409 # key-cache-size: 4m 410 411 # the number of slabs to use for the key cache. 412 # the number of slabs must be a power of 2. 413 # more slabs reduce lock contention, but fragment memory usage. 414 # key-cache-slabs: 4 415 416 # the amount of memory to use for the negative cache (used for DLV). 417 # plain value in bytes or you can append k, m or G. default is "1Mb". 418 # neg-cache-size: 1m 419 420 # a number of locally served zones can be configured. 421 # local-zone: <zone> <type> 422 # local-data: "<resource record string>" 423 # o deny serves local data (if any), else, drops queries. 424 # o refuse serves local data (if any), else, replies with error. 425 # o static serves local data, else, nxdomain or nodata answer. 426 # o transparent gives local data, but resolves normally for other names 427 # o redirect serves the zone data for any subdomain in the zone. 428 # o nodefault can be used to normally resolve AS112 zones. 429 # o typetransparent resolves normally for other types and other names 430 # 431 # defaults are localhost address, reverse for 127.0.0.1 and ::1 432 # and nxdomain for AS112 zones. If you configure one of these zones 433 # the default content is omitted, or you can omit it with 'nodefault'. 434 # 435 # If you configure local-data without specifying local-zone, by 436 # default a transparent local-zone is created for the data. 437 # 438 # You can add locally served data with 439 # local-zone: "local." static 440 # local-data: "mycomputer.local. IN A 192.0.2.51" 441 # local-data: 'mytext.local TXT "content of text record"' 442 # 443 # You can override certain queries with 444 # local-data: "adserver.example.com A 127.0.0.1" 445 # 446 # You can redirect a domain to a fixed address with 447 # (this makes example.com, www.example.com, etc, all go to 192.0.2.3) 448 # local-zone: "example.com" redirect 449 # local-data: "example.com A 192.0.2.3" 450 # 451 # Shorthand to make PTR records, "IPv4 name" or "IPv6 name". 452 # You can also add PTR records using local-data directly, but then 453 # you need to do the reverse notation yourself. 454 # local-data-ptr: "192.0.2.3 www.example.com" 455 456 # service clients over SSL (on the TCP sockets), with plain DNS inside 457 # the SSL stream. Give the certificate to use and private key. 458 # default is "" (disabled). requires restart to take effect. 459 # ssl-service-key: "path/to/privatekeyfile.key" 460 # ssl-service-pem: "path/to/publiccertfile.pem" 461 # ssl-port: 443 462 463 # request upstream over SSL (with plain DNS inside the SSL stream). 464 # Default is no. Can be turned on and off with unbound-control. 465 # ssl-upstream: no 466 467# Python config section. To enable: 468# o use --with-pythonmodule to configure before compiling. 469# o list python in the module-config string (above) to enable. 470# o and give a python-script to run. 471python: 472 # Script file to load 473 # python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py" 474 475# Remote control config section. 476remote-control: 477 # Enable remote control with unbound-control(8) here. 478 # set up the keys and certificates with unbound-control-setup. 479 # control-enable: no 480 481 # what interfaces are listened to for remote control. 482 # give 0.0.0.0 and ::0 to listen to all interfaces. 483 # control-interface: 127.0.0.1 484 # control-interface: ::1 485 486 # port number for remote control operations. 487 # control-port: 8953 488 489 # unbound server key file. 490 # server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key" 491 492 # unbound server certificate file. 493 # server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem" 494 495 # unbound-control key file. 496 # control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key" 497 498 # unbound-control certificate file. 499 # control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem" 500 501# Stub zones. 502# Create entries like below, to make all queries for 'example.com' and 503# 'example.org' go to the given list of nameservers. list zero or more 504# nameservers by hostname or by ipaddress. If you set stub-prime to yes, 505# the list is treated as priming hints (default is no). 506# stub-zone: 507# name: "example.com" 508# stub-addr: 192.0.2.68 509# stub-prime: no 510# stub-zone: 511# name: "example.org" 512# stub-host: ns.example.com. 513 514# Forward zones 515# Create entries like below, to make all queries for 'example.com' and 516# 'example.org' go to the given list of servers. These servers have to handle 517# recursion to other nameservers. List zero or more nameservers by hostname 518# or by ipaddress. Use an entry with name "." to forward all queries. 519# forward-zone: 520# name: "example.com" 521# forward-addr: 192.0.2.68 522# forward-addr: 192.0.2.73@5355 # forward to port 5355. 523# forward-zone: 524# name: "example.org" 525# forward-host: fwd.example.com 526