1# 2# Example configuration file. 3# 4# See unbound.conf(5) man page, version 1.12.0. 5# 6# this is a comment. 7 8# Use this anywhere in the file to include other text into this file. 9#include: "otherfile.conf" 10 11# Use this anywhere in the file to include other text, that explicitly starts a 12# clause, into this file. Text after this directive needs to start a clause. 13#include-toplevel: "otherfile.conf" 14 15# The server clause sets the main parameters. 16server: 17 # whitespace is not necessary, but looks cleaner. 18 19 # verbosity number, 0 is least verbose. 1 is default. 20 verbosity: 1 21 22 # print statistics to the log (for every thread) every N seconds. 23 # Set to "" or 0 to disable. Default is disabled. 24 # statistics-interval: 0 25 26 # enable shm for stats, default no. if you enable also enable 27 # statistics-interval, every time it also writes stats to the 28 # shared memory segment keyed with shm-key. 29 # shm-enable: no 30 31 # shm for stats uses this key, and key+1 for the shared mem segment. 32 # shm-key: 11777 33 34 # enable cumulative statistics, without clearing them after printing. 35 # statistics-cumulative: no 36 37 # enable extended statistics (query types, answer codes, status) 38 # printed from unbound-control. default off, because of speed. 39 # extended-statistics: no 40 41 # number of threads to create. 1 disables threading. 42 # num-threads: 1 43 44 # specify the interfaces to answer queries from by ip-address. 45 # The default is to listen to localhost (127.0.0.1 and ::1). 46 # specify 0.0.0.0 and ::0 to bind to all available interfaces. 47 # specify every interface[@port] on a new 'interface:' labelled line. 48 # The listen interfaces are not changed on reload, only on restart. 49 # interface: 192.0.2.153 50 # interface: 192.0.2.154 51 # interface: 192.0.2.154@5003 52 # interface: 2001:DB8::5 53 54 # enable this feature to copy the source address of queries to reply. 55 # Socket options are not supported on all platforms. experimental. 56 # interface-automatic: no 57 58 # port to answer queries from 59 # port: 53 60 61 # specify the interfaces to send outgoing queries to authoritative 62 # server from by ip-address. If none, the default (all) interface 63 # is used. Specify every interface on a 'outgoing-interface:' line. 64 # outgoing-interface: 192.0.2.153 65 # outgoing-interface: 2001:DB8::5 66 # outgoing-interface: 2001:DB8::6 67 68 # Specify a netblock to use remainder 64 bits as random bits for 69 # upstream queries. Uses freebind option (Linux). 70 # outgoing-interface: 2001:DB8::/64 71 # Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo 72 # And: ip -6 route add local 2001:db8::/64 dev lo 73 # And set prefer-ip6: yes to use the ip6 randomness from a netblock. 74 # Set this to yes to prefer ipv6 upstream servers over ipv4. 75 # prefer-ip6: no 76 77 # Prefer ipv4 upstream servers, even if ipv6 is available. 78 # prefer-ip4: no 79 80 # number of ports to allocate per thread, determines the size of the 81 # port range that can be open simultaneously. About double the 82 # num-queries-per-thread, or, use as many as the OS will allow you. 83 # outgoing-range: 4096 84 85 # permit unbound to use this port number or port range for 86 # making outgoing queries, using an outgoing interface. 87 # outgoing-port-permit: 32768 88 89 # deny unbound the use this of port number or port range for 90 # making outgoing queries, using an outgoing interface. 91 # Use this to make sure unbound does not grab a UDP port that some 92 # other server on this computer needs. The default is to avoid 93 # IANA-assigned port numbers. 94 # If multiple outgoing-port-permit and outgoing-port-avoid options 95 # are present, they are processed in order. 96 # outgoing-port-avoid: "3200-3208" 97 98 # number of outgoing simultaneous tcp buffers to hold per thread. 99 # outgoing-num-tcp: 10 100 101 # number of incoming simultaneous tcp buffers to hold per thread. 102 # incoming-num-tcp: 10 103 104 # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). 105 # 0 is system default. Use 4m to catch query spikes for busy servers. 106 # so-rcvbuf: 0 107 108 # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option). 109 # 0 is system default. Use 4m to handle spikes on very busy servers. 110 # so-sndbuf: 0 111 112 # use SO_REUSEPORT to distribute queries over threads. 113 # at extreme load it could be better to turn it off to distribute even. 114 # so-reuseport: yes 115 116 # use IP_TRANSPARENT so the interface: addresses can be non-local 117 # and you can config non-existing IPs that are going to work later on 118 # (uses IP_BINDANY on FreeBSD). 119 # ip-transparent: no 120 121 # use IP_FREEBIND so the interface: addresses can be non-local 122 # and you can bind to nonexisting IPs and interfaces that are down. 123 # Linux only. On Linux you also have ip-transparent that is similar. 124 # ip-freebind: no 125 126 # the value of the Differentiated Services Codepoint (DSCP) 127 # in the differentiated services field (DS) of the outgoing 128 # IP packets 129 # ip-dscp: 0 130 131 # EDNS reassembly buffer to advertise to UDP peers (the actual buffer 132 # is set with msg-buffer-size). 133 # edns-buffer-size: 1232 134 135 # Maximum UDP response size (not applied to TCP response). 136 # Suggested values are 512 to 4096. Default is 4096. 65536 disables it. 137 # max-udp-size: 4096 138 139 # max memory to use for stream(tcp and tls) waiting result buffers. 140 # stream-wait-size: 4m 141 142 # buffer size for handling DNS data. No messages larger than this 143 # size can be sent or received, by UDP or TCP. In bytes. 144 # msg-buffer-size: 65552 145 146 # the amount of memory to use for the message cache. 147 # plain value in bytes or you can append k, m or G. default is "4Mb". 148 # msg-cache-size: 4m 149 150 # the number of slabs to use for the message cache. 151 # the number of slabs must be a power of 2. 152 # more slabs reduce lock contention, but fragment memory usage. 153 # msg-cache-slabs: 4 154 155 # the number of queries that a thread gets to service. 156 # num-queries-per-thread: 1024 157 158 # if very busy, 50% queries run to completion, 50% get timeout in msec 159 # jostle-timeout: 200 160 161 # msec to wait before close of port on timeout UDP. 0 disables. 162 # delay-close: 0 163 164 # msec for waiting for an unknown server to reply. Increase if you 165 # are behind a slow satellite link, to eg. 1128. 166 # unknown-server-time-limit: 376 167 168 # the amount of memory to use for the RRset cache. 169 # plain value in bytes or you can append k, m or G. default is "4Mb". 170 # rrset-cache-size: 4m 171 172 # the number of slabs to use for the RRset cache. 173 # the number of slabs must be a power of 2. 174 # more slabs reduce lock contention, but fragment memory usage. 175 # rrset-cache-slabs: 4 176 177 # the time to live (TTL) value lower bound, in seconds. Default 0. 178 # If more than an hour could easily give trouble due to stale data. 179 # cache-min-ttl: 0 180 181 # the time to live (TTL) value cap for RRsets and messages in the 182 # cache. Items are not cached for longer. In seconds. 183 # cache-max-ttl: 86400 184 185 # the time to live (TTL) value cap for negative responses in the cache 186 # cache-max-negative-ttl: 3600 187 188 # the time to live (TTL) value for cached roundtrip times, lameness and 189 # EDNS version information for hosts. In seconds. 190 # infra-host-ttl: 900 191 192 # minimum wait time for responses, increase if uplink is long. In msec. 193 # infra-cache-min-rtt: 50 194 195 # the number of slabs to use for the Infrastructure cache. 196 # the number of slabs must be a power of 2. 197 # more slabs reduce lock contention, but fragment memory usage. 198 # infra-cache-slabs: 4 199 200 # the maximum number of hosts that are cached (roundtrip, EDNS, lame). 201 # infra-cache-numhosts: 10000 202 203 # define a number of tags here, use with local-zone, access-control. 204 # repeat the define-tag statement to add additional tags. 205 # define-tag: "tag1 tag2 tag3" 206 207 # Enable IPv4, "yes" or "no". 208 # do-ip4: yes 209 210 # Enable IPv6, "yes" or "no". 211 # do-ip6: yes 212 213 # Enable UDP, "yes" or "no". 214 # do-udp: yes 215 216 # Enable TCP, "yes" or "no". 217 # do-tcp: yes 218 219 # upstream connections use TCP only (and no UDP), "yes" or "no" 220 # useful for tunneling scenarios, default no. 221 # tcp-upstream: no 222 223 # upstream connections also use UDP (even if do-udp is no). 224 # useful if if you want UDP upstream, but don't provide UDP downstream. 225 # udp-upstream-without-downstream: no 226 227 # Maximum segment size (MSS) of TCP socket on which the server 228 # responds to queries. Default is 0, system default MSS. 229 # tcp-mss: 0 230 231 # Maximum segment size (MSS) of TCP socket for outgoing queries. 232 # Default is 0, system default MSS. 233 # outgoing-tcp-mss: 0 234 235 # Idle TCP timeout, connection closed in milliseconds 236 # tcp-idle-timeout: 30000 237 238 # Enable EDNS TCP keepalive option. 239 # edns-tcp-keepalive: no 240 241 # Timeout for EDNS TCP keepalive, in msec. 242 # edns-tcp-keepalive-timeout: 120000 243 244 # Use systemd socket activation for UDP, TCP, and control sockets. 245 # use-systemd: no 246 247 # Detach from the terminal, run in background, "yes" or "no". 248 # Set the value to "no" when unbound runs as systemd service. 249 # do-daemonize: yes 250 251 # control which clients are allowed to make (recursive) queries 252 # to this server. Specify classless netblocks with /size and action. 253 # By default everything is refused, except for localhost. 254 # Choose deny (drop message), refuse (polite error reply), 255 # allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on), 256 # allow_snoop (recursive and nonrecursive ok) 257 # deny_non_local (drop queries unless can be answered from local-data) 258 # refuse_non_local (like deny_non_local but polite error reply). 259 # access-control: 0.0.0.0/0 refuse 260 # access-control: 127.0.0.0/8 allow 261 # access-control: ::0/0 refuse 262 # access-control: ::1 allow 263 # access-control: ::ffff:127.0.0.1 allow 264 265 # tag access-control with list of tags (in "" with spaces between) 266 # Clients using this access control element use localzones that 267 # are tagged with one of these tags. 268 # access-control-tag: 192.0.2.0/24 "tag2 tag3" 269 270 # set action for particular tag for given access control element 271 # if you have multiple tag values, the tag used to lookup the action 272 # is the first tag match between access-control-tag and local-zone-tag 273 # where "first" comes from the order of the define-tag values. 274 # access-control-tag-action: 192.0.2.0/24 tag3 refuse 275 276 # set redirect data for particular tag for access control element 277 # access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1" 278 279 # Set view for access control element 280 # access-control-view: 192.0.2.0/24 viewname 281 282 # if given, a chroot(2) is done to the given directory. 283 # i.e. you can chroot to the working directory, for example, 284 # for extra security, but make sure all files are in that directory. 285 # 286 # If chroot is enabled, you should pass the configfile (from the 287 # commandline) as a full path from the original root. After the 288 # chroot has been performed the now defunct portion of the config 289 # file path is removed to be able to reread the config after a reload. 290 # 291 # All other file paths (working dir, logfile, roothints, and 292 # key files) can be specified in several ways: 293 # o as an absolute path relative to the new root. 294 # o as a relative path to the working directory. 295 # o as an absolute path relative to the original root. 296 # In the last case the path is adjusted to remove the unused portion. 297 # 298 # The pid file can be absolute and outside of the chroot, it is 299 # written just prior to performing the chroot and dropping permissions. 300 # 301 # Additionally, unbound may need to access /dev/urandom (for entropy). 302 # How to do this is specific to your OS. 303 # 304 # If you give "" no chroot is performed. The path must not end in a /. 305 # chroot: "@UNBOUND_CHROOT_DIR@" 306 307 # if given, user privileges are dropped (after binding port), 308 # and the given username is assumed. Default is user "unbound". 309 # If you give "" no privileges are dropped. 310 # username: "@UNBOUND_USERNAME@" 311 312 # the working directory. The relative files in this config are 313 # relative to this directory. If you give "" the working directory 314 # is not changed. 315 # If you give a server: directory: dir before include: file statements 316 # then those includes can be relative to the working directory. 317 # directory: "@UNBOUND_RUN_DIR@" 318 319 # the log file, "" means log to stderr. 320 # Use of this option sets use-syslog to "no". 321 # logfile: "" 322 323 # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to 324 # log to. If yes, it overrides the logfile. 325 # use-syslog: yes 326 327 # Log identity to report. if empty, defaults to the name of argv[0] 328 # (usually "unbound"). 329 # log-identity: "" 330 331 # print UTC timestamp in ascii to logfile, default is epoch in seconds. 332 # log-time-ascii: no 333 334 # print one line with time, IP, name, type, class for every query. 335 # log-queries: no 336 337 # print one line per reply, with time, IP, name, type, class, rcode, 338 # timetoresolve, fromcache and responsesize. 339 # log-replies: no 340 341 # log with tag 'query' and 'reply' instead of 'info' for 342 # filtering log-queries and log-replies from the log. 343 # log-tag-queryreply: no 344 345 # log the local-zone actions, like local-zone type inform is enabled 346 # also for the other local zone types. 347 # log-local-actions: no 348 349 # print log lines that say why queries return SERVFAIL to clients. 350 # log-servfail: no 351 352 # the pid file. Can be an absolute path outside of chroot/work dir. 353 # pidfile: "@UNBOUND_PIDFILE@" 354 355 # file to read root hints from. 356 # get one from https://www.internic.net/domain/named.cache 357 # root-hints: "" 358 359 # enable to not answer id.server and hostname.bind queries. 360 # hide-identity: no 361 362 # enable to not answer version.server and version.bind queries. 363 # hide-version: no 364 365 # enable to not answer trustanchor.unbound queries. 366 # hide-trustanchor: no 367 368 # the identity to report. Leave "" or default to return hostname. 369 # identity: "" 370 371 # the version to report. Leave "" or default to return package version. 372 # version: "" 373 374 # the target fetch policy. 375 # series of integers describing the policy per dependency depth. 376 # The number of values in the list determines the maximum dependency 377 # depth the recursor will pursue before giving up. Each integer means: 378 # -1 : fetch all targets opportunistically, 379 # 0: fetch on demand, 380 # positive value: fetch that many targets opportunistically. 381 # Enclose the list of numbers between quotes (""). 382 # target-fetch-policy: "3 2 1 0 0" 383 384 # Harden against very small EDNS buffer sizes. 385 # harden-short-bufsize: no 386 387 # Harden against unseemly large queries. 388 # harden-large-queries: no 389 390 # Harden against out of zone rrsets, to avoid spoofing attempts. 391 # harden-glue: yes 392 393 # Harden against receiving dnssec-stripped data. If you turn it 394 # off, failing to validate dnskey data for a trustanchor will 395 # trigger insecure mode for that zone (like without a trustanchor). 396 # Default on, which insists on dnssec data for trust-anchored zones. 397 # harden-dnssec-stripped: yes 398 399 # Harden against queries that fall under dnssec-signed nxdomain names. 400 # harden-below-nxdomain: yes 401 402 # Harden the referral path by performing additional queries for 403 # infrastructure data. Validates the replies (if possible). 404 # Default off, because the lookups burden the server. Experimental 405 # implementation of draft-wijngaards-dnsext-resolver-side-mitigation. 406 # harden-referral-path: no 407 408 # Harden against algorithm downgrade when multiple algorithms are 409 # advertised in the DS record. If no, allows the weakest algorithm 410 # to validate the zone. 411 # harden-algo-downgrade: no 412 413 # Sent minimum amount of information to upstream servers to enhance 414 # privacy. Only sent minimum required labels of the QNAME and set QTYPE 415 # to A when possible. 416 # qname-minimisation: yes 417 418 # QNAME minimisation in strict mode. Do not fall-back to sending full 419 # QNAME to potentially broken nameservers. A lot of domains will not be 420 # resolvable when this option in enabled. 421 # This option only has effect when qname-minimisation is enabled. 422 # qname-minimisation-strict: no 423 424 # Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN 425 # and other denials, using information from previous NXDOMAINs answers. 426 # aggressive-nsec: no 427 428 # Use 0x20-encoded random bits in the query to foil spoof attempts. 429 # This feature is an experimental implementation of draft dns-0x20. 430 # use-caps-for-id: no 431 432 # Domains (and domains in them) without support for dns-0x20 and 433 # the fallback fails because they keep sending different answers. 434 # caps-exempt: "licdn.com" 435 # caps-exempt: "senderbase.org" 436 437 # Enforce privacy of these addresses. Strips them away from answers. 438 # It may cause DNSSEC validation to additionally mark it as bogus. 439 # Protects against 'DNS Rebinding' (uses browser as network proxy). 440 # Only 'private-domain' and 'local-data' names are allowed to have 441 # these private addresses. No default. 442 # private-address: 10.0.0.0/8 443 # private-address: 172.16.0.0/12 444 # private-address: 192.168.0.0/16 445 # private-address: 169.254.0.0/16 446 # private-address: fd00::/8 447 # private-address: fe80::/10 448 # private-address: ::ffff:0:0/96 449 450 # Allow the domain (and its subdomains) to contain private addresses. 451 # local-data statements are allowed to contain private addresses too. 452 # private-domain: "example.com" 453 454 # If nonzero, unwanted replies are not only reported in statistics, 455 # but also a running total is kept per thread. If it reaches the 456 # threshold, a warning is printed and a defensive action is taken, 457 # the cache is cleared to flush potential poison out of it. 458 # A suggested value is 10000000, the default is 0 (turned off). 459 # unwanted-reply-threshold: 0 460 461 # Do not query the following addresses. No DNS queries are sent there. 462 # List one address per entry. List classless netblocks with /size, 463 # do-not-query-address: 127.0.0.1/8 464 # do-not-query-address: ::1 465 466 # if yes, the above default do-not-query-address entries are present. 467 # if no, localhost can be queried (for testing and debugging). 468 # do-not-query-localhost: yes 469 470 # if yes, perform prefetching of almost expired message cache entries. 471 # prefetch: no 472 473 # if yes, perform key lookups adjacent to normal lookups. 474 # prefetch-key: no 475 476 # deny queries of type ANY with an empty response. 477 # deny-any: no 478 479 # if yes, Unbound rotates RRSet order in response. 480 # rrset-roundrobin: yes 481 482 # if yes, Unbound doesn't insert authority/additional sections 483 # into response messages when those sections are not required. 484 # minimal-responses: yes 485 486 # true to disable DNSSEC lameness check in iterator. 487 # disable-dnssec-lame-check: no 488 489 # module configuration of the server. A string with identifiers 490 # separated by spaces. Syntax: "[dns64] [validator] iterator" 491 # most modules have to be listed at the beginning of the line, 492 # except cachedb(just before iterator), and python (at the beginning, 493 # or, just before the iterator). 494 # module-config: "validator iterator" 495 496 # File with trusted keys, kept uptodate using RFC5011 probes, 497 # initial file like trust-anchor-file, then it stores metadata. 498 # Use several entries, one per domain name, to track multiple zones. 499 # 500 # If you want to perform DNSSEC validation, run unbound-anchor before 501 # you start unbound (i.e. in the system boot scripts). And enable: 502 # Please note usage of unbound-anchor root anchor is at your own risk 503 # and under the terms of our LICENSE (see that file in the source). 504 # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" 505 506 # trust anchor signaling sends a RFC8145 key tag query after priming. 507 # trust-anchor-signaling: yes 508 509 # Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel) 510 # root-key-sentinel: yes 511 512 # File with trusted keys for validation. Specify more than one file 513 # with several entries, one file per entry. 514 # Zone file format, with DS and DNSKEY entries. 515 # Note this gets out of date, use auto-trust-anchor-file please. 516 # trust-anchor-file: "" 517 518 # Trusted key for validation. DS or DNSKEY. specify the RR on a 519 # single line, surrounded by "". TTL is ignored. class is IN default. 520 # Note this gets out of date, use auto-trust-anchor-file please. 521 # (These examples are from August 2007 and may not be valid anymore). 522 # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ==" 523 # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A" 524 525 # File with trusted keys for validation. Specify more than one file 526 # with several entries, one file per entry. Like trust-anchor-file 527 # but has a different file format. Format is BIND-9 style format, 528 # the trusted-keys { name flag proto algo "key"; }; clauses are read. 529 # you need external update procedures to track changes in keys. 530 # trusted-keys-file: "" 531 532 # Ignore chain of trust. Domain is treated as insecure. 533 # domain-insecure: "example.com" 534 535 # Override the date for validation with a specific fixed date. 536 # Do not set this unless you are debugging signature inception 537 # and expiration. "" or "0" turns the feature off. -1 ignores date. 538 # val-override-date: "" 539 540 # The time to live for bogus data, rrsets and messages. This avoids 541 # some of the revalidation, until the time interval expires. in secs. 542 # val-bogus-ttl: 60 543 544 # The signature inception and expiration dates are allowed to be off 545 # by 10% of the signature lifetime (expir-incep) from our local clock. 546 # This leeway is capped with a minimum and a maximum. In seconds. 547 # val-sig-skew-min: 3600 548 # val-sig-skew-max: 86400 549 550 # Should additional section of secure message also be kept clean of 551 # unsecure data. Useful to shield the users of this validator from 552 # potential bogus data in the additional section. All unsigned data 553 # in the additional section is removed from secure messages. 554 # val-clean-additional: yes 555 556 # Turn permissive mode on to permit bogus messages. Thus, messages 557 # for which security checks failed will be returned to clients, 558 # instead of SERVFAIL. It still performs the security checks, which 559 # result in interesting log files and possibly the AD bit in 560 # replies if the message is found secure. The default is off. 561 # val-permissive-mode: no 562 563 # Ignore the CD flag in incoming queries and refuse them bogus data. 564 # Enable it if the only clients of unbound are legacy servers (w2008) 565 # that set CD but cannot validate themselves. 566 # ignore-cd-flag: no 567 568 # Serve expired responses from cache, with serve-expired-reply-ttl in 569 # the response, and then attempt to fetch the data afresh. 570 # serve-expired: no 571 # 572 # Limit serving of expired responses to configured seconds after 573 # expiration. 0 disables the limit. 574 # serve-expired-ttl: 0 575 # 576 # Set the TTL of expired records to the serve-expired-ttl value after a 577 # failed attempt to retrieve the record from upstream. This makes sure 578 # that the expired records will be served as long as there are queries 579 # for it. 580 # serve-expired-ttl-reset: no 581 # 582 # TTL value to use when replying with expired data. 583 # serve-expired-reply-ttl: 30 584 # 585 # Time in milliseconds before replying to the client with expired data. 586 # This essentially enables the serve-stale behavior as specified in 587 # RFC 8767 that first tries to resolve before 588 # immediately responding with expired data. 0 disables this behavior. 589 # A recommended value is 1800. 590 # serve-expired-client-timeout: 0 591 592 # Have the validator log failed validations for your diagnosis. 593 # 0: off. 1: A line per failed user query. 2: With reason and bad IP. 594 # val-log-level: 0 595 596 # It is possible to configure NSEC3 maximum iteration counts per 597 # keysize. Keep this table very short, as linear search is done. 598 # A message with an NSEC3 with larger count is marked insecure. 599 # List in ascending order the keysize and count values. 600 # val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500" 601 602 # instruct the auto-trust-anchor-file probing to add anchors after ttl. 603 # add-holddown: 2592000 # 30 days 604 605 # instruct the auto-trust-anchor-file probing to del anchors after ttl. 606 # del-holddown: 2592000 # 30 days 607 608 # auto-trust-anchor-file probing removes missing anchors after ttl. 609 # If the value 0 is given, missing anchors are not removed. 610 # keep-missing: 31622400 # 366 days 611 612 # debug option that allows very small holddown times for key rollover, 613 # otherwise the RFC mandates probe intervals must be at least 1 hour. 614 # permit-small-holddown: no 615 616 # the amount of memory to use for the key cache. 617 # plain value in bytes or you can append k, m or G. default is "4Mb". 618 # key-cache-size: 4m 619 620 # the number of slabs to use for the key cache. 621 # the number of slabs must be a power of 2. 622 # more slabs reduce lock contention, but fragment memory usage. 623 # key-cache-slabs: 4 624 625 # the amount of memory to use for the negative cache. 626 # plain value in bytes or you can append k, m or G. default is "1Mb". 627 # neg-cache-size: 1m 628 629 # By default, for a number of zones a small default 'nothing here' 630 # reply is built-in. Query traffic is thus blocked. If you 631 # wish to serve such zone you can unblock them by uncommenting one 632 # of the nodefault statements below. 633 # You may also have to use domain-insecure: zone to make DNSSEC work, 634 # unless you have your own trust anchors for this zone. 635 # local-zone: "localhost." nodefault 636 # local-zone: "127.in-addr.arpa." nodefault 637 # 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 638 # local-zone: "onion." nodefault 639 # local-zone: "test." nodefault 640 # local-zone: "invalid." nodefault 641 # local-zone: "10.in-addr.arpa." nodefault 642 # local-zone: "16.172.in-addr.arpa." nodefault 643 # local-zone: "17.172.in-addr.arpa." nodefault 644 # local-zone: "18.172.in-addr.arpa." nodefault 645 # local-zone: "19.172.in-addr.arpa." nodefault 646 # local-zone: "20.172.in-addr.arpa." nodefault 647 # local-zone: "21.172.in-addr.arpa." nodefault 648 # local-zone: "22.172.in-addr.arpa." nodefault 649 # local-zone: "23.172.in-addr.arpa." nodefault 650 # local-zone: "24.172.in-addr.arpa." nodefault 651 # local-zone: "25.172.in-addr.arpa." nodefault 652 # local-zone: "26.172.in-addr.arpa." nodefault 653 # local-zone: "27.172.in-addr.arpa." nodefault 654 # local-zone: "28.172.in-addr.arpa." nodefault 655 # local-zone: "29.172.in-addr.arpa." nodefault 656 # local-zone: "30.172.in-addr.arpa." nodefault 657 # local-zone: "31.172.in-addr.arpa." nodefault 658 # local-zone: "168.192.in-addr.arpa." nodefault 659 # local-zone: "0.in-addr.arpa." nodefault 660 # local-zone: "254.169.in-addr.arpa." nodefault 661 # local-zone: "2.0.192.in-addr.arpa." nodefault 662 # local-zone: "100.51.198.in-addr.arpa." nodefault 663 # local-zone: "113.0.203.in-addr.arpa." nodefault 664 # local-zone: "255.255.255.255.in-addr.arpa." nodefault 665 # 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 666 # local-zone: "d.f.ip6.arpa." nodefault 667 # local-zone: "8.e.f.ip6.arpa." nodefault 668 # local-zone: "9.e.f.ip6.arpa." nodefault 669 # local-zone: "a.e.f.ip6.arpa." nodefault 670 # local-zone: "b.e.f.ip6.arpa." nodefault 671 # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault 672 # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. 673 674 # Add example.com into ipset 675 # local-zone: "example.com" ipset 676 677 # If unbound is running service for the local host then it is useful 678 # to perform lan-wide lookups to the upstream, and unblock the 679 # long list of local-zones above. If this unbound is a dns server 680 # for a network of computers, disabled is better and stops information 681 # leakage of local lan information. 682 # unblock-lan-zones: no 683 684 # The insecure-lan-zones option disables validation for 685 # these zones, as if they were all listed as domain-insecure. 686 # insecure-lan-zones: no 687 688 # a number of locally served zones can be configured. 689 # local-zone: <zone> <type> 690 # local-data: "<resource record string>" 691 # o deny serves local data (if any), else, drops queries. 692 # o refuse serves local data (if any), else, replies with error. 693 # o static serves local data, else, nxdomain or nodata answer. 694 # o transparent gives local data, but resolves normally for other names 695 # o redirect serves the zone data for any subdomain in the zone. 696 # o nodefault can be used to normally resolve AS112 zones. 697 # o typetransparent resolves normally for other types and other names 698 # o inform acts like transparent, but logs client IP address 699 # o inform_deny drops queries and logs client IP address 700 # o inform_redirect redirects queries and logs client IP address 701 # o always_transparent, always_refuse, always_nxdomain, resolve in 702 # that way but ignore local data for that name 703 # o noview breaks out of that view towards global local-zones. 704 # 705 # defaults are localhost address, reverse for 127.0.0.1 and ::1 706 # and nxdomain for AS112 zones. If you configure one of these zones 707 # the default content is omitted, or you can omit it with 'nodefault'. 708 # 709 # If you configure local-data without specifying local-zone, by 710 # default a transparent local-zone is created for the data. 711 # 712 # You can add locally served data with 713 # local-zone: "local." static 714 # local-data: "mycomputer.local. IN A 192.0.2.51" 715 # local-data: 'mytext.local TXT "content of text record"' 716 # 717 # You can override certain queries with 718 # local-data: "adserver.example.com A 127.0.0.1" 719 # 720 # You can redirect a domain to a fixed address with 721 # (this makes example.com, www.example.com, etc, all go to 192.0.2.3) 722 # local-zone: "example.com" redirect 723 # local-data: "example.com A 192.0.2.3" 724 # 725 # Shorthand to make PTR records, "IPv4 name" or "IPv6 name". 726 # You can also add PTR records using local-data directly, but then 727 # you need to do the reverse notation yourself. 728 # local-data-ptr: "192.0.2.3 www.example.com" 729 730 # tag a localzone with a list of tag names (in "" with spaces between) 731 # local-zone-tag: "example.com" "tag2 tag3" 732 733 # add a netblock specific override to a localzone, with zone type 734 # local-zone-override: "example.com" 192.0.2.0/24 refuse 735 736 # service clients over TLS (on the TCP sockets) with plain DNS inside 737 # the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484. 738 # Give the certificate to use and private key. 739 # default is "" (disabled). requires restart to take effect. 740 # tls-service-key: "path/to/privatekeyfile.key" 741 # tls-service-pem: "path/to/publiccertfile.pem" 742 # tls-port: 853 743 # https-port: 443 744 745 # cipher setting for TLSv1.2 746 # 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" 747 # cipher setting for TLSv1.3 748 # 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" 749 750 # Use the SNI extension for TLS connections. Default is yes. 751 # Changing the value requires a reload. 752 # tls-use-sni: yes 753 754 # Add the secret file for TLS Session Ticket. 755 # Secret file must be 80 bytes of random data. 756 # First key use to encrypt and decrypt TLS session tickets. 757 # Other keys use to decrypt only. 758 # requires restart to take effect. 759 # tls-session-ticket-keys: "path/to/secret_file1" 760 # tls-session-ticket-keys: "path/to/secret_file2" 761 762 # request upstream over TLS (with plain DNS inside the TLS stream). 763 # Default is no. Can be turned on and off with unbound-control. 764 # tls-upstream: no 765 766 # Certificates used to authenticate connections made upstream. 767 # tls-cert-bundle: "" 768 769 # Add system certs to the cert bundle, from the Windows Cert Store 770 # tls-win-cert: no 771 772 # Also serve tls on these port numbers (eg. 443, ...), by listing 773 # tls-additional-port: portno for each of the port numbers. 774 775 # HTTP endpoint to provide DNS-over-HTTPS service on. 776 # http-endpoint: "/dns-query" 777 778 # HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use. 779 # http-max-streams: 100 780 781 # Maximum number of bytes used for all HTTP/2 query buffers. 782 # http-query-buffer-size: 4m 783 784 # Maximum number of bytes used for all HTTP/2 response buffers. 785 # http-response-buffer-size: 4m 786 787 # Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS 788 # service. 789 # http-nodelay: yes 790 791 # DNS64 prefix. Must be specified when DNS64 is use. 792 # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4. 793 # dns64-prefix: 64:ff9b::0/96 794 795 # DNS64 ignore AAAA records for these domains and use A instead. 796 # dns64-ignore-aaaa: "example.com" 797 798 # ratelimit for uncached, new queries, this limits recursion effort. 799 # ratelimiting is experimental, and may help against randomqueryflood. 800 # if 0(default) it is disabled, otherwise state qps allowed per zone. 801 # ratelimit: 0 802 803 # ratelimits are tracked in a cache, size in bytes of cache (or k,m). 804 # ratelimit-size: 4m 805 # ratelimit cache slabs, reduces lock contention if equal to cpucount. 806 # ratelimit-slabs: 4 807 808 # 0 blocks when ratelimited, otherwise let 1/xth traffic through 809 # ratelimit-factor: 10 810 811 # override the ratelimit for a specific domain name. 812 # give this setting multiple times to have multiple overrides. 813 # ratelimit-for-domain: example.com 1000 814 # override the ratelimits for all domains below a domain name 815 # can give this multiple times, the name closest to the zone is used. 816 # ratelimit-below-domain: com 1000 817 818 # global query ratelimit for all ip addresses. 819 # feature is experimental. 820 # if 0(default) it is disabled, otherwise states qps allowed per ip address 821 # ip-ratelimit: 0 822 823 # ip ratelimits are tracked in a cache, size in bytes of cache (or k,m). 824 # ip-ratelimit-size: 4m 825 # ip ratelimit cache slabs, reduces lock contention if equal to cpucount. 826 # ip-ratelimit-slabs: 4 827 828 # 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through 829 # ip-ratelimit-factor: 10 830 831 # Limit the number of connections simultaneous from a netblock 832 # tcp-connection-limit: 192.0.2.0/24 12 833 834 # select from the fastest servers this many times out of 1000. 0 means 835 # the fast server select is disabled. prefetches are not sped up. 836 # fast-server-permil: 0 837 # the number of servers that will be used in the fast server selection. 838 # fast-server-num: 3 839 840 # Specific options for ipsecmod. unbound needs to be configured with 841 # --enable-ipsecmod for these to take effect. 842 # 843 # Enable or disable ipsecmod (it still needs to be defined in 844 # module-config above). Can be used when ipsecmod needs to be 845 # enabled/disabled via remote-control(below). 846 # ipsecmod-enabled: yes 847 # 848 # Path to executable external hook. It must be defined when ipsecmod is 849 # listed in module-config (above). 850 # ipsecmod-hook: "./my_executable" 851 # 852 # When enabled unbound will reply with SERVFAIL if the return value of 853 # the ipsecmod-hook is not 0. 854 # ipsecmod-strict: no 855 # 856 # Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY. 857 # ipsecmod-max-ttl: 3600 858 # 859 # Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for 860 # testing. 861 # ipsecmod-ignore-bogus: no 862 # 863 # Domains for which ipsecmod will be triggered. If not defined (default) 864 # all domains are treated as being allowed. 865 # ipsecmod-allow: "example.com" 866 # ipsecmod-allow: "nlnetlabs.nl" 867 868 869# Python config section. To enable: 870# o use --with-pythonmodule to configure before compiling. 871# o list python in the module-config string (above) to enable. 872# It can be at the start, it gets validated results, or just before 873# the iterator and process before DNSSEC validation. 874# o and give a python-script to run. 875python: 876 # Script file to load 877 # python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py" 878 879# Dynamic library config section. To enable: 880# o use --with-dynlibmodule to configure before compiling. 881# o list dynlib in the module-config string (above) to enable. 882# It can be placed anywhere, the dynlib module is only a very thin wrapper 883# to load modules dynamically. 884# o and give a dynlib-file to run. If more than one dynlib entry is listed in 885# the module-config then you need one dynlib-file per instance. 886dynlib: 887 # Script file to load 888 # dynlib-file: "@UNBOUND_SHARE_DIR@/dynlib.so" 889 890# Remote control config section. 891remote-control: 892 # Enable remote control with unbound-control(8) here. 893 # set up the keys and certificates with unbound-control-setup. 894 # control-enable: no 895 896 # what interfaces are listened to for remote control. 897 # give 0.0.0.0 and ::0 to listen to all interfaces. 898 # set to an absolute path to use a unix local name pipe, certificates 899 # are not used for that, so key and cert files need not be present. 900 # control-interface: 127.0.0.1 901 # control-interface: ::1 902 903 # port number for remote control operations. 904 # control-port: 8953 905 906 # for localhost, you can disable use of TLS by setting this to "no" 907 # For local sockets this option is ignored, and TLS is not used. 908 # control-use-cert: "yes" 909 910 # unbound server key file. 911 # server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key" 912 913 # unbound server certificate file. 914 # server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem" 915 916 # unbound-control key file. 917 # control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key" 918 919 # unbound-control certificate file. 920 # control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem" 921 922# Stub zones. 923# Create entries like below, to make all queries for 'example.com' and 924# 'example.org' go to the given list of nameservers. list zero or more 925# nameservers by hostname or by ipaddress. If you set stub-prime to yes, 926# the list is treated as priming hints (default is no). 927# With stub-first yes, it attempts without the stub if it fails. 928# Consider adding domain-insecure: name and local-zone: name nodefault 929# to the server: section if the stub is a locally served zone. 930# stub-zone: 931# name: "example.com" 932# stub-addr: 192.0.2.68 933# stub-prime: no 934# stub-first: no 935# stub-tls-upstream: no 936# stub-no-cache: no 937# stub-zone: 938# name: "example.org" 939# stub-host: ns.example.com. 940 941# Forward zones 942# Create entries like below, to make all queries for 'example.com' and 943# 'example.org' go to the given list of servers. These servers have to handle 944# recursion to other nameservers. List zero or more nameservers by hostname 945# or by ipaddress. Use an entry with name "." to forward all queries. 946# If you enable forward-first, it attempts without the forward if it fails. 947# forward-zone: 948# name: "example.com" 949# forward-addr: 192.0.2.68 950# forward-addr: 192.0.2.73@5355 # forward to port 5355. 951# forward-first: no 952# forward-tls-upstream: no 953# forward-no-cache: no 954# forward-zone: 955# name: "example.org" 956# forward-host: fwd.example.com 957 958# Authority zones 959# The data for these zones is kept locally, from a file or downloaded. 960# The data can be served to downstream clients, or used instead of the 961# upstream (which saves a lookup to the upstream). The first example 962# has a copy of the root for local usage. The second serves example.org 963# authoritatively. zonefile: reads from file (and writes to it if you also 964# download it), primary: fetches with AXFR and IXFR, or url to zonefile. 965# With allow-notify: you can give additional (apart from primaries) sources of 966# notifies. 967# auth-zone: 968# name: "." 969# primary: 199.9.14.201 # b.root-servers.net 970# primary: 192.33.4.12 # c.root-servers.net 971# primary: 199.7.91.13 # d.root-servers.net 972# primary: 192.5.5.241 # f.root-servers.net 973# primary: 192.112.36.4 # g.root-servers.net 974# primary: 193.0.14.129 # k.root-servers.net 975# primary: 192.0.47.132 # xfr.cjr.dns.icann.org 976# primary: 192.0.32.132 # xfr.lax.dns.icann.org 977# primary: 2001:500:200::b # b.root-servers.net 978# primary: 2001:500:2::c # c.root-servers.net 979# primary: 2001:500:2d::d # d.root-servers.net 980# primary: 2001:500:2f::f # f.root-servers.net 981# primary: 2001:500:12::d0d # g.root-servers.net 982# primary: 2001:7fd::1 # k.root-servers.net 983# primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org 984# primary: 2620:0:2d0:202::132 # xfr.lax.dns.icann.org 985# fallback-enabled: yes 986# for-downstream: no 987# for-upstream: yes 988# auth-zone: 989# name: "example.org" 990# for-downstream: yes 991# for-upstream: yes 992# zonefile: "example.org.zone" 993 994# Views 995# Create named views. Name must be unique. Map views to requests using 996# the access-control-view option. Views can contain zero or more local-zone 997# and local-data options. Options from matching views will override global 998# options. Global options will be used if no matching view is found. 999# With view-first yes, it will try to answer using the global local-zone and 1000# local-data elements if there is no view specific match. 1001# view: 1002# name: "viewname" 1003# local-zone: "example.com" redirect 1004# local-data: "example.com A 192.0.2.3" 1005# local-data-ptr: "192.0.2.3 www.example.com" 1006# view-first: no 1007# view: 1008# name: "anotherview" 1009# local-zone: "example.com" refuse 1010 1011# DNSCrypt 1012# Caveats: 1013# 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper 1014# for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage 1015# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to 1016# listen on `dnscrypt-port` with the follo0wing snippet: 1017# server: 1018# interface: 0.0.0.0@443 1019# interface: ::0@443 1020# 1021# Finally, `dnscrypt` config has its own section. 1022# dnscrypt: 1023# dnscrypt-enable: yes 1024# dnscrypt-port: 443 1025# dnscrypt-provider: 2.dnscrypt-cert.example.com. 1026# dnscrypt-secret-key: /path/unbound-conf/keys1/1.key 1027# dnscrypt-secret-key: /path/unbound-conf/keys2/1.key 1028# dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert 1029# dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert 1030 1031# CacheDB 1032# Enable external backend DB as auxiliary cache. Specify the backend name 1033# (default is "testframe", which has no use other than for debugging and 1034# testing) and backend-specific options. The 'cachedb' module must be 1035# included in module-config, just before the iterator module. 1036# cachedb: 1037# backend: "testframe" 1038# # secret seed string to calculate hashed keys 1039# secret-seed: "default" 1040# 1041# # For "redis" backend: 1042# # redis server's IP address or host name 1043# redis-server-host: 127.0.0.1 1044# # redis server's TCP port 1045# redis-server-port: 6379 1046# # timeout (in ms) for communication with the redis server 1047# redis-timeout: 100 1048# # set timeout on redis records based on DNS response TTL 1049# redis-expire-records: no 1050 1051# IPSet 1052# Add specify domain into set via ipset. 1053# Note: To enable ipset unbound needs to run as root user. 1054# ipset: 1055# # set name for ip v4 addresses 1056# name-v4: "list-v4" 1057# # set name for ip v6 addresses 1058# name-v6: "list-v6" 1059# 1060 1061# Dnstap logging support, if compiled in. To enable, set the dnstap-enable 1062# to yes and also some of dnstap-log-..-messages to yes. And select an 1063# upstream log destination, by socket path, TCP or TLS destination. 1064# dnstap: 1065# dnstap-enable: no 1066# # if set to yes frame streams will be used in bidirectional mode 1067# dnstap-bidirectional: yes 1068# dnstap-socket-path: "@DNSTAP_SOCKET_PATH@" 1069# # if "" use the unix socket in dnstap-socket-path, otherwise, 1070# # set it to "IPaddress[@port]" of the destination. 1071# dnstap-ip: "" 1072# # if set to yes if you want to use TLS to dnstap-ip, no for TCP. 1073# dnstap-tls: yes 1074# # name for authenticating the upstream server. or "" disabled. 1075# dnstap-tls-server-name: "" 1076# # if "", it uses the cert bundle from the main unbound config. 1077# dnstap-tls-cert-bundle: "" 1078# # key file for client authentication, or "" disabled. 1079# dnstap-tls-client-key-file: "" 1080# # cert file for client authentication, or "" disabled. 1081# dnstap-tls-client-cert-file: "" 1082# dnstap-send-identity: no 1083# dnstap-send-version: no 1084# # if "" it uses the hostname. 1085# dnstap-identity: "" 1086# # if "" it uses the package version. 1087# dnstap-version: "" 1088# dnstap-log-resolver-query-messages: no 1089# dnstap-log-resolver-response-messages: no 1090# dnstap-log-client-query-messages: no 1091# dnstap-log-client-response-messages: no 1092# dnstap-log-forwarder-query-messages: no 1093# dnstap-log-forwarder-response-messages: no 1094 1095# Response Policy Zones 1096# RPZ policies. Applied in order of configuration. QNAME and Response IP 1097# Address trigger are the only supported triggers. Supported actions are: 1098# NXDOMAIN, NODATA, PASSTHRU, DROP and Local Data. Policies can be loaded from 1099# file, using zone transfer, or using HTTP. The respip module needs to be added 1100# to the module-config, e.g.: module-config: "respip validator iterator". 1101# rpz: 1102# name: "rpz.example.com" 1103# zonefile: "rpz.example.com" 1104# primary: 192.0.2.0 1105# allow-notify: 192.0.2.0/32 1106# url: http://www.example.com/rpz.example.org.zone 1107# rpz-action-override: cname 1108# rpz-cname-override: www.example.org 1109# rpz-log: yes 1110# rpz-log-name: "example policy" 1111# tags: "example" 1112