1b7579f77SDag-Erling Smørgrav# 2b7579f77SDag-Erling Smørgrav# Example configuration file. 3b7579f77SDag-Erling Smørgrav# 4*be771a7bSCy Schubert# See unbound.conf(5) man page, version 1.23.0. 5b7579f77SDag-Erling Smørgrav# 6b7579f77SDag-Erling Smørgrav# this is a comment. 7b7579f77SDag-Erling Smørgrav 825039b37SCy Schubert# Use this anywhere in the file to include other text into this file. 9b7579f77SDag-Erling Smørgrav#include: "otherfile.conf" 10b7579f77SDag-Erling Smørgrav 1125039b37SCy Schubert# Use this anywhere in the file to include other text, that explicitly starts a 1225039b37SCy Schubert# clause, into this file. Text after this directive needs to start a clause. 1325039b37SCy Schubert#include-toplevel: "otherfile.conf" 1425039b37SCy Schubert 15b7579f77SDag-Erling Smørgrav# The server clause sets the main parameters. 16b7579f77SDag-Erling Smørgravserver: 17b7579f77SDag-Erling Smørgrav # whitespace is not necessary, but looks cleaner. 18b7579f77SDag-Erling Smørgrav 19b7579f77SDag-Erling Smørgrav # verbosity number, 0 is least verbose. 1 is default. 20865f46b2SCy Schubert # verbosity: 1 21b7579f77SDag-Erling Smørgrav 22b7579f77SDag-Erling Smørgrav # print statistics to the log (for every thread) every N seconds. 23b7579f77SDag-Erling Smørgrav # Set to "" or 0 to disable. Default is disabled. 24b7579f77SDag-Erling Smørgrav # statistics-interval: 0 25b7579f77SDag-Erling Smørgrav 2665b390aaSDag-Erling Smørgrav # enable shm for stats, default no. if you enable also enable 2765b390aaSDag-Erling Smørgrav # statistics-interval, every time it also writes stats to the 2865b390aaSDag-Erling Smørgrav # shared memory segment keyed with shm-key. 2965b390aaSDag-Erling Smørgrav # shm-enable: no 3065b390aaSDag-Erling Smørgrav 3165b390aaSDag-Erling Smørgrav # shm for stats uses this key, and key+1 for the shared mem segment. 3265b390aaSDag-Erling Smørgrav # shm-key: 11777 3365b390aaSDag-Erling Smørgrav 34b7579f77SDag-Erling Smørgrav # enable cumulative statistics, without clearing them after printing. 35b7579f77SDag-Erling Smørgrav # statistics-cumulative: no 36b7579f77SDag-Erling Smørgrav 37b7579f77SDag-Erling Smørgrav # enable extended statistics (query types, answer codes, status) 381838dec3SCy Schubert # printed from unbound-control. Default off, because of speed. 39b7579f77SDag-Erling Smørgrav # extended-statistics: no 40b7579f77SDag-Erling Smørgrav 411838dec3SCy Schubert # Inhibits selected extended statistics (qtype, qclass, qopcode, rcode, 421838dec3SCy Schubert # rpz-actions) from printing if their value is 0. 431838dec3SCy Schubert # Default on. 441838dec3SCy Schubert # statistics-inhibit-zero: yes 451838dec3SCy Schubert 46b7579f77SDag-Erling Smørgrav # number of threads to create. 1 disables threading. 47b7579f77SDag-Erling Smørgrav # num-threads: 1 48b7579f77SDag-Erling Smørgrav 49b7579f77SDag-Erling Smørgrav # specify the interfaces to answer queries from by ip-address. 50b7579f77SDag-Erling Smørgrav # The default is to listen to localhost (127.0.0.1 and ::1). 51b7579f77SDag-Erling Smørgrav # specify 0.0.0.0 and ::0 to bind to all available interfaces. 52b7579f77SDag-Erling Smørgrav # specify every interface[@port] on a new 'interface:' labelled line. 53b7579f77SDag-Erling Smørgrav # The listen interfaces are not changed on reload, only on restart. 54b7579f77SDag-Erling Smørgrav # interface: 192.0.2.153 55b7579f77SDag-Erling Smørgrav # interface: 192.0.2.154 56b7579f77SDag-Erling Smørgrav # interface: 192.0.2.154@5003 57b7579f77SDag-Erling Smørgrav # interface: 2001:DB8::5 58865f46b2SCy Schubert # interface: eth0@5003 59b7579f77SDag-Erling Smørgrav 60b7579f77SDag-Erling Smørgrav # enable this feature to copy the source address of queries to reply. 61b7579f77SDag-Erling Smørgrav # Socket options are not supported on all platforms. experimental. 62b7579f77SDag-Erling Smørgrav # interface-automatic: no 63b7579f77SDag-Erling Smørgrav 64a39a5a69SCy Schubert # instead of the default port, open additional ports separated by 65a39a5a69SCy Schubert # spaces when interface-automatic is enabled, by listing them here. 66a39a5a69SCy Schubert # interface-automatic-ports: "" 67a39a5a69SCy Schubert 68b7579f77SDag-Erling Smørgrav # port to answer queries from 69b7579f77SDag-Erling Smørgrav # port: 53 70b7579f77SDag-Erling Smørgrav 71b7579f77SDag-Erling Smørgrav # specify the interfaces to send outgoing queries to authoritative 72b7579f77SDag-Erling Smørgrav # server from by ip-address. If none, the default (all) interface 73b7579f77SDag-Erling Smørgrav # is used. Specify every interface on a 'outgoing-interface:' line. 74b7579f77SDag-Erling Smørgrav # outgoing-interface: 192.0.2.153 75b7579f77SDag-Erling Smørgrav # outgoing-interface: 2001:DB8::5 76b7579f77SDag-Erling Smørgrav # outgoing-interface: 2001:DB8::6 77b7579f77SDag-Erling Smørgrav 78b5663de9SDag-Erling Smørgrav # Specify a netblock to use remainder 64 bits as random bits for 79b5663de9SDag-Erling Smørgrav # upstream queries. Uses freebind option (Linux). 80b5663de9SDag-Erling Smørgrav # outgoing-interface: 2001:DB8::/64 81b5663de9SDag-Erling Smørgrav # Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo 82b5663de9SDag-Erling Smørgrav # And: ip -6 route add local 2001:db8::/64 dev lo 83b5663de9SDag-Erling Smørgrav # And set prefer-ip6: yes to use the ip6 randomness from a netblock. 84b5663de9SDag-Erling Smørgrav # Set this to yes to prefer ipv6 upstream servers over ipv4. 85b5663de9SDag-Erling Smørgrav # prefer-ip6: no 86b5663de9SDag-Erling Smørgrav 8725039b37SCy Schubert # Prefer ipv4 upstream servers, even if ipv6 is available. 8825039b37SCy Schubert # prefer-ip4: no 8925039b37SCy Schubert 90b7579f77SDag-Erling Smørgrav # number of ports to allocate per thread, determines the size of the 91b7579f77SDag-Erling Smørgrav # port range that can be open simultaneously. About double the 92b7579f77SDag-Erling Smørgrav # num-queries-per-thread, or, use as many as the OS will allow you. 93b7579f77SDag-Erling Smørgrav # outgoing-range: 4096 94b7579f77SDag-Erling Smørgrav 959cf5bc93SCy Schubert # permit Unbound to use this port number or port range for 96b7579f77SDag-Erling Smørgrav # making outgoing queries, using an outgoing interface. 97b7579f77SDag-Erling Smørgrav # outgoing-port-permit: 32768 98b7579f77SDag-Erling Smørgrav 999cf5bc93SCy Schubert # deny Unbound the use this of port number or port range for 100b7579f77SDag-Erling Smørgrav # making outgoing queries, using an outgoing interface. 1019cf5bc93SCy Schubert # Use this to make sure Unbound does not grab a UDP port that some 102b7579f77SDag-Erling Smørgrav # other server on this computer needs. The default is to avoid 103b7579f77SDag-Erling Smørgrav # IANA-assigned port numbers. 1048ed2b524SDag-Erling Smørgrav # If multiple outgoing-port-permit and outgoing-port-avoid options 1058ed2b524SDag-Erling Smørgrav # are present, they are processed in order. 106b7579f77SDag-Erling Smørgrav # outgoing-port-avoid: "3200-3208" 107b7579f77SDag-Erling Smørgrav 108b7579f77SDag-Erling Smørgrav # number of outgoing simultaneous tcp buffers to hold per thread. 109b7579f77SDag-Erling Smørgrav # outgoing-num-tcp: 10 110b7579f77SDag-Erling Smørgrav 111b7579f77SDag-Erling Smørgrav # number of incoming simultaneous tcp buffers to hold per thread. 112b7579f77SDag-Erling Smørgrav # incoming-num-tcp: 10 113b7579f77SDag-Erling Smørgrav 114b7579f77SDag-Erling Smørgrav # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). 115b7579f77SDag-Erling Smørgrav # 0 is system default. Use 4m to catch query spikes for busy servers. 116b7579f77SDag-Erling Smørgrav # so-rcvbuf: 0 117b7579f77SDag-Erling Smørgrav 118b7579f77SDag-Erling Smørgrav # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option). 119b7579f77SDag-Erling Smørgrav # 0 is system default. Use 4m to handle spikes on very busy servers. 120b7579f77SDag-Erling Smørgrav # so-sndbuf: 0 121b7579f77SDag-Erling Smørgrav 122ff825849SDag-Erling Smørgrav # use SO_REUSEPORT to distribute queries over threads. 123e86b9096SDag-Erling Smørgrav # at extreme load it could be better to turn it off to distribute even. 1244c75e3aaSDag-Erling Smørgrav # so-reuseport: yes 12517d15b25SDag-Erling Smørgrav 12609a3aaf3SDag-Erling Smørgrav # use IP_TRANSPARENT so the interface: addresses can be non-local 12709a3aaf3SDag-Erling Smørgrav # and you can config non-existing IPs that are going to work later on 128f61ef7f6SDag-Erling Smørgrav # (uses IP_BINDANY on FreeBSD). 12909a3aaf3SDag-Erling Smørgrav # ip-transparent: no 13009a3aaf3SDag-Erling Smørgrav 131e2d15004SDag-Erling Smørgrav # use IP_FREEBIND so the interface: addresses can be non-local 132e2d15004SDag-Erling Smørgrav # and you can bind to nonexisting IPs and interfaces that are down. 133e2d15004SDag-Erling Smørgrav # Linux only. On Linux you also have ip-transparent that is similar. 134e2d15004SDag-Erling Smørgrav # ip-freebind: no 135e2d15004SDag-Erling Smørgrav 13625039b37SCy Schubert # the value of the Differentiated Services Codepoint (DSCP) 13725039b37SCy Schubert # in the differentiated services field (DS) of the outgoing 13825039b37SCy Schubert # IP packets 13925039b37SCy Schubert # ip-dscp: 0 14025039b37SCy Schubert 141b7579f77SDag-Erling Smørgrav # EDNS reassembly buffer to advertise to UDP peers (the actual buffer 142c0caa2e2SCy Schubert # is set with msg-buffer-size). 143c0caa2e2SCy Schubert # edns-buffer-size: 1232 144b7579f77SDag-Erling Smørgrav 14517d15b25SDag-Erling Smørgrav # Maximum UDP response size (not applied to TCP response). 1468f76bb7dSCy Schubert # Suggested values are 512 to 4096. Default is 1232. 65536 disables it. 1478f76bb7dSCy Schubert # max-udp-size: 1232 14817d15b25SDag-Erling Smørgrav 149e86b9096SDag-Erling Smørgrav # max memory to use for stream(tcp and tls) waiting result buffers. 150e86b9096SDag-Erling Smørgrav # stream-wait-size: 4m 151e86b9096SDag-Erling Smørgrav 152b7579f77SDag-Erling Smørgrav # buffer size for handling DNS data. No messages larger than this 153b7579f77SDag-Erling Smørgrav # size can be sent or received, by UDP or TCP. In bytes. 154b7579f77SDag-Erling Smørgrav # msg-buffer-size: 65552 155b7579f77SDag-Erling Smørgrav 156b7579f77SDag-Erling Smørgrav # the amount of memory to use for the message cache. 157b7579f77SDag-Erling Smørgrav # plain value in bytes or you can append k, m or G. default is "4Mb". 158b7579f77SDag-Erling Smørgrav # msg-cache-size: 4m 159b7579f77SDag-Erling Smørgrav 160b7579f77SDag-Erling Smørgrav # the number of slabs to use for the message cache. 161b7579f77SDag-Erling Smørgrav # the number of slabs must be a power of 2. 162b7579f77SDag-Erling Smørgrav # more slabs reduce lock contention, but fragment memory usage. 163b7579f77SDag-Erling Smørgrav # msg-cache-slabs: 4 164b7579f77SDag-Erling Smørgrav 165b7579f77SDag-Erling Smørgrav # the number of queries that a thread gets to service. 166b7579f77SDag-Erling Smørgrav # num-queries-per-thread: 1024 167b7579f77SDag-Erling Smørgrav 168b7579f77SDag-Erling Smørgrav # if very busy, 50% queries run to completion, 50% get timeout in msec 169b7579f77SDag-Erling Smørgrav # jostle-timeout: 200 170b7579f77SDag-Erling Smørgrav 17117d15b25SDag-Erling Smørgrav # msec to wait before close of port on timeout UDP. 0 disables. 17217d15b25SDag-Erling Smørgrav # delay-close: 0 17317d15b25SDag-Erling Smørgrav 174369c6923SCy Schubert # perform connect for UDP sockets to mitigate ICMP side channel. 175369c6923SCy Schubert # udp-connect: yes 176369c6923SCy Schubert 177790c6b24SCy Schubert # The number of retries, per upstream nameserver in a delegation, when 178790c6b24SCy Schubert # a throwaway response (also timeouts) is received. 17924e36522SCy Schubert # outbound-msg-retry: 5 18024e36522SCy Schubert 1811838dec3SCy Schubert # Hard limit on the number of outgoing queries Unbound will make while 1821838dec3SCy Schubert # resolving a name, making sure large NS sets do not loop. 1831838dec3SCy Schubert # It resets on query restarts (e.g., CNAME) and referrals. 1841838dec3SCy Schubert # max-sent-count: 32 1851838dec3SCy Schubert 1861838dec3SCy Schubert # Hard limit on the number of times Unbound is allowed to restart a 1871838dec3SCy Schubert # query upon encountering a CNAME record. 1881838dec3SCy Schubert # max-query-restarts: 11 1891838dec3SCy Schubert 19046d2f618SCy Schubert # Limit on number of NS records in NS RRset for incoming packets. 19146d2f618SCy Schubert # iter-scrub-ns: 20 19246d2f618SCy Schubert 19346d2f618SCy Schubert # Limit on number of CNAME, DNAME records for incoming packets. 19446d2f618SCy Schubert # iter-scrub-cname: 11 19546d2f618SCy Schubert 19646d2f618SCy Schubert # Limit on upstream queries for an incoming query and its recursion. 197*be771a7bSCy Schubert # max-global-quota: 200 19846d2f618SCy Schubert 199e86b9096SDag-Erling Smørgrav # msec for waiting for an unknown server to reply. Increase if you 200e86b9096SDag-Erling Smørgrav # are behind a slow satellite link, to eg. 1128. 201e86b9096SDag-Erling Smørgrav # unknown-server-time-limit: 376 202e86b9096SDag-Erling Smørgrav 203335c7cdaSCy Schubert # msec before recursion replies are dropped. The work item continues. 204335c7cdaSCy Schubert # discard-timeout: 1900 205335c7cdaSCy Schubert 206335c7cdaSCy Schubert # Max number of replies waiting for recursion per IP address. 207335c7cdaSCy Schubert # wait-limit: 1000 208335c7cdaSCy Schubert 209335c7cdaSCy Schubert # Max replies waiting for recursion for IP address with cookie. 210335c7cdaSCy Schubert # wait-limit-cookie: 10000 211335c7cdaSCy Schubert 212335c7cdaSCy Schubert # Apart from the default, the wait limit can be set for a netblock. 213335c7cdaSCy Schubert # wait-limit-netblock: 192.0.2.0/24 50000 214335c7cdaSCy Schubert 215335c7cdaSCy Schubert # Apart from the default, the wait limit with cookie can be adjusted. 216335c7cdaSCy Schubert # wait-limit-cookie-netblock: 192.0.2.0/24 50000 217335c7cdaSCy Schubert 218*be771a7bSCy Schubert # Defaults for loopback, it has no wait limit. 219*be771a7bSCy Schubert # wait-limit-netblock: 127.0.0.0/8 -1 220*be771a7bSCy Schubert # wait-limit-netblock: ::1/128 -1 221*be771a7bSCy Schubert # wait-limit-cookie-netblock: 127.0.0.0/8 -1 222*be771a7bSCy Schubert # wait-limit-cookie-netblock: ::1/128 -1 223*be771a7bSCy Schubert 224b7579f77SDag-Erling Smørgrav # the amount of memory to use for the RRset cache. 225b7579f77SDag-Erling Smørgrav # plain value in bytes or you can append k, m or G. default is "4Mb". 226b7579f77SDag-Erling Smørgrav # rrset-cache-size: 4m 227b7579f77SDag-Erling Smørgrav 228b7579f77SDag-Erling Smørgrav # the number of slabs to use for the RRset cache. 229b7579f77SDag-Erling Smørgrav # the number of slabs must be a power of 2. 230b7579f77SDag-Erling Smørgrav # more slabs reduce lock contention, but fragment memory usage. 231b7579f77SDag-Erling Smørgrav # rrset-cache-slabs: 4 232b7579f77SDag-Erling Smørgrav 233b7579f77SDag-Erling Smørgrav # the time to live (TTL) value lower bound, in seconds. Default 0. 234b7579f77SDag-Erling Smørgrav # If more than an hour could easily give trouble due to stale data. 235b7579f77SDag-Erling Smørgrav # cache-min-ttl: 0 236b7579f77SDag-Erling Smørgrav 237b7579f77SDag-Erling Smørgrav # the time to live (TTL) value cap for RRsets and messages in the 238b7579f77SDag-Erling Smørgrav # cache. Items are not cached for longer. In seconds. 239b7579f77SDag-Erling Smørgrav # cache-max-ttl: 86400 240b7579f77SDag-Erling Smørgrav 24109a3aaf3SDag-Erling Smørgrav # the time to live (TTL) value cap for negative responses in the cache 24209a3aaf3SDag-Erling Smørgrav # cache-max-negative-ttl: 3600 24309a3aaf3SDag-Erling Smørgrav 244335c7cdaSCy Schubert # the time to live (TTL) value lower bound, in seconds. Default 0. 245335c7cdaSCy Schubert # For negative responses in the cache. If disabled, default, 24656850988SCy Schubert # cache-min-ttl applies if configured. 247335c7cdaSCy Schubert # cache-min-negative-ttl: 0 248335c7cdaSCy Schubert 249b7579f77SDag-Erling Smørgrav # the time to live (TTL) value for cached roundtrip times, lameness and 250b7579f77SDag-Erling Smørgrav # EDNS version information for hosts. In seconds. 251b7579f77SDag-Erling Smørgrav # infra-host-ttl: 900 252b7579f77SDag-Erling Smørgrav 2536480faa8SDag-Erling Smørgrav # minimum wait time for responses, increase if uplink is long. In msec. 2546480faa8SDag-Erling Smørgrav # infra-cache-min-rtt: 50 2556480faa8SDag-Erling Smørgrav 256790c6b24SCy Schubert # maximum wait time for responses. In msec. 257790c6b24SCy Schubert # infra-cache-max-rtt: 120000 258790c6b24SCy Schubert 259369c6923SCy Schubert # enable to make server probe down hosts more frequently. 260369c6923SCy Schubert # infra-keep-probing: no 261369c6923SCy Schubert 262b7579f77SDag-Erling Smørgrav # the number of slabs to use for the Infrastructure cache. 263b7579f77SDag-Erling Smørgrav # the number of slabs must be a power of 2. 264b7579f77SDag-Erling Smørgrav # more slabs reduce lock contention, but fragment memory usage. 265b7579f77SDag-Erling Smørgrav # infra-cache-slabs: 4 266b7579f77SDag-Erling Smørgrav 267b7579f77SDag-Erling Smørgrav # the maximum number of hosts that are cached (roundtrip, EDNS, lame). 268b7579f77SDag-Erling Smørgrav # infra-cache-numhosts: 10000 269b7579f77SDag-Erling Smørgrav 270865f46b2SCy Schubert # define a number of tags here, use with local-zone, access-control, 271865f46b2SCy Schubert # interface-*. 272b5663de9SDag-Erling Smørgrav # repeat the define-tag statement to add additional tags. 273b5663de9SDag-Erling Smørgrav # define-tag: "tag1 tag2 tag3" 274b5663de9SDag-Erling Smørgrav 275b7579f77SDag-Erling Smørgrav # Enable IPv4, "yes" or "no". 276b7579f77SDag-Erling Smørgrav # do-ip4: yes 277b7579f77SDag-Erling Smørgrav 278b7579f77SDag-Erling Smørgrav # Enable IPv6, "yes" or "no". 279b7579f77SDag-Erling Smørgrav # do-ip6: yes 280b7579f77SDag-Erling Smørgrav 2818f76bb7dSCy Schubert # If running unbound on an IPv6-only host, domains that only have 2828f76bb7dSCy Schubert # IPv4 servers would become unresolveable. If NAT64 is available in 2838f76bb7dSCy Schubert # the network, unbound can use NAT64 to reach these servers with 2848f76bb7dSCy Schubert # the following option. This is NOT needed for enabling DNS64 on a 2858f76bb7dSCy Schubert # system that has IPv4 connectivity. 2868f76bb7dSCy Schubert # Consider also enabling prefer-ip6 to prefer native IPv6 connections 2878f76bb7dSCy Schubert # to nameservers. 2888f76bb7dSCy Schubert # do-nat64: no 2898f76bb7dSCy Schubert 2908f76bb7dSCy Schubert # NAT64 prefix. Defaults to using dns64-prefix value. 2918f76bb7dSCy Schubert # nat64-prefix: 64:ff9b::0/96 2928f76bb7dSCy Schubert 293b7579f77SDag-Erling Smørgrav # Enable UDP, "yes" or "no". 294b7579f77SDag-Erling Smørgrav # do-udp: yes 295b7579f77SDag-Erling Smørgrav 296b7579f77SDag-Erling Smørgrav # Enable TCP, "yes" or "no". 297b7579f77SDag-Erling Smørgrav # do-tcp: yes 298b7579f77SDag-Erling Smørgrav 299b7579f77SDag-Erling Smørgrav # upstream connections use TCP only (and no UDP), "yes" or "no" 300b7579f77SDag-Erling Smørgrav # useful for tunneling scenarios, default no. 301b7579f77SDag-Erling Smørgrav # tcp-upstream: no 302b7579f77SDag-Erling Smørgrav 3038a384985SDag-Erling Smørgrav # upstream connections also use UDP (even if do-udp is no). 3048a384985SDag-Erling Smørgrav # useful if if you want UDP upstream, but don't provide UDP downstream. 3058a384985SDag-Erling Smørgrav # udp-upstream-without-downstream: no 3068a384985SDag-Erling Smørgrav 307f61ef7f6SDag-Erling Smørgrav # Maximum segment size (MSS) of TCP socket on which the server 308f61ef7f6SDag-Erling Smørgrav # responds to queries. Default is 0, system default MSS. 309f61ef7f6SDag-Erling Smørgrav # tcp-mss: 0 310f61ef7f6SDag-Erling Smørgrav 311f61ef7f6SDag-Erling Smørgrav # Maximum segment size (MSS) of TCP socket for outgoing queries. 312f61ef7f6SDag-Erling Smørgrav # Default is 0, system default MSS. 313f61ef7f6SDag-Erling Smørgrav # outgoing-tcp-mss: 0 314f61ef7f6SDag-Erling Smørgrav 3154c75e3aaSDag-Erling Smørgrav # Idle TCP timeout, connection closed in milliseconds 3164c75e3aaSDag-Erling Smørgrav # tcp-idle-timeout: 30000 3174c75e3aaSDag-Erling Smørgrav 3184c75e3aaSDag-Erling Smørgrav # Enable EDNS TCP keepalive option. 3194c75e3aaSDag-Erling Smørgrav # edns-tcp-keepalive: no 3204c75e3aaSDag-Erling Smørgrav 321335c7cdaSCy Schubert # Timeout for EDNS TCP keepalive, in msec. Overrides tcp-idle-timeout 322335c7cdaSCy Schubert # if edns-tcp-keepalive is set. 3234c75e3aaSDag-Erling Smørgrav # edns-tcp-keepalive-timeout: 120000 3244c75e3aaSDag-Erling Smørgrav 3258f76bb7dSCy Schubert # UDP queries that have waited in the socket buffer for a long time 3268f76bb7dSCy Schubert # can be dropped. Default is 0, disabled. In seconds, such as 3. 3278f76bb7dSCy Schubert # sock-queue-timeout: 0 3288f76bb7dSCy Schubert 3293005e0a3SDag-Erling Smørgrav # Use systemd socket activation for UDP, TCP, and control sockets. 3303005e0a3SDag-Erling Smørgrav # use-systemd: no 3313005e0a3SDag-Erling Smørgrav 332b7579f77SDag-Erling Smørgrav # Detach from the terminal, run in background, "yes" or "no". 3339cf5bc93SCy Schubert # Set the value to "no" when Unbound runs as systemd service. 334b7579f77SDag-Erling Smørgrav # do-daemonize: yes 335b7579f77SDag-Erling Smørgrav 336b7579f77SDag-Erling Smørgrav # control which clients are allowed to make (recursive) queries 337b7579f77SDag-Erling Smørgrav # to this server. Specify classless netblocks with /size and action. 338b7579f77SDag-Erling Smørgrav # By default everything is refused, except for localhost. 339b7579f77SDag-Erling Smørgrav # Choose deny (drop message), refuse (polite error reply), 3403bd4df0aSDag-Erling Smørgrav # allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on), 3413bd4df0aSDag-Erling Smørgrav # allow_snoop (recursive and nonrecursive ok) 342b7c0c8c1SCy Schubert # allow_cookie (allow UDP with valid cookie or stateful transport) 34317d15b25SDag-Erling Smørgrav # deny_non_local (drop queries unless can be answered from local-data) 34417d15b25SDag-Erling Smørgrav # refuse_non_local (like deny_non_local but polite error reply). 345b7579f77SDag-Erling Smørgrav # access-control: 127.0.0.0/8 allow 346b7579f77SDag-Erling Smørgrav # access-control: ::1 allow 347b7579f77SDag-Erling Smørgrav # access-control: ::ffff:127.0.0.1 allow 348b7579f77SDag-Erling Smørgrav 349b5663de9SDag-Erling Smørgrav # tag access-control with list of tags (in "" with spaces between) 350b5663de9SDag-Erling Smørgrav # Clients using this access control element use localzones that 351b5663de9SDag-Erling Smørgrav # are tagged with one of these tags. 352b5663de9SDag-Erling Smørgrav # access-control-tag: 192.0.2.0/24 "tag2 tag3" 353b5663de9SDag-Erling Smørgrav 354865f46b2SCy Schubert # set action for particular tag for given access control element. 355b5663de9SDag-Erling Smørgrav # if you have multiple tag values, the tag used to lookup the action 356b5663de9SDag-Erling Smørgrav # is the first tag match between access-control-tag and local-zone-tag 357b5663de9SDag-Erling Smørgrav # where "first" comes from the order of the define-tag values. 358b5663de9SDag-Erling Smørgrav # access-control-tag-action: 192.0.2.0/24 tag3 refuse 359b5663de9SDag-Erling Smørgrav 360b5663de9SDag-Erling Smørgrav # set redirect data for particular tag for access control element 361b5663de9SDag-Erling Smørgrav # access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1" 362b5663de9SDag-Erling Smørgrav 363bc892140SDag-Erling Smørgrav # Set view for access control element 364bc892140SDag-Erling Smørgrav # access-control-view: 192.0.2.0/24 viewname 365bc892140SDag-Erling Smørgrav 366865f46b2SCy Schubert # Similar to 'access-control:' but for interfaces. 367865f46b2SCy Schubert # Control which listening interfaces are allowed to accept (recursive) 368865f46b2SCy Schubert # queries for this server. 369865f46b2SCy Schubert # The specified interfaces should be the same as the ones specified in 370865f46b2SCy Schubert # 'interface:' followed by the action. 371865f46b2SCy Schubert # The actions are the same as 'access-control:' above. 372865f46b2SCy Schubert # By default all the interfaces configured are refused. 373865f46b2SCy Schubert # Note: any 'access-control*:' setting overrides all 'interface-*:' 374865f46b2SCy Schubert # settings for targeted clients. 375865f46b2SCy Schubert # interface-action: 192.0.2.153 allow 376865f46b2SCy Schubert # interface-action: 192.0.2.154 allow 377865f46b2SCy Schubert # interface-action: 192.0.2.154@5003 allow 378865f46b2SCy Schubert # interface-action: 2001:DB8::5 allow 379865f46b2SCy Schubert # interface-action: eth0@5003 allow 380865f46b2SCy Schubert 381865f46b2SCy Schubert # Similar to 'access-control-tag:' but for interfaces. 382865f46b2SCy Schubert # Tag interfaces with a list of tags (in "" with spaces between). 383865f46b2SCy Schubert # Interfaces using these tags use localzones that are tagged with one 384865f46b2SCy Schubert # of these tags. 385865f46b2SCy Schubert # The specified interfaces should be the same as the ones specified in 386865f46b2SCy Schubert # 'interface:' followed by the list of tags. 387865f46b2SCy Schubert # Note: any 'access-control*:' setting overrides all 'interface-*:' 388865f46b2SCy Schubert # settings for targeted clients. 389865f46b2SCy Schubert # interface-tag: eth0@5003 "tag2 tag3" 390865f46b2SCy Schubert 391865f46b2SCy Schubert # Similar to 'access-control-tag-action:' but for interfaces. 392865f46b2SCy Schubert # Set action for particular tag for a given interface element. 393865f46b2SCy Schubert # If you have multiple tag values, the tag used to lookup the action 394865f46b2SCy Schubert # is the first tag match between interface-tag and local-zone-tag 395865f46b2SCy Schubert # where "first" comes from the order of the define-tag values. 396865f46b2SCy Schubert # The specified interfaces should be the same as the ones specified in 397865f46b2SCy Schubert # 'interface:' followed by the tag and action. 398865f46b2SCy Schubert # Note: any 'access-control*:' setting overrides all 'interface-*:' 399865f46b2SCy Schubert # settings for targeted clients. 400865f46b2SCy Schubert # interface-tag-action: eth0@5003 tag3 refuse 401865f46b2SCy Schubert 402865f46b2SCy Schubert # Similar to 'access-control-tag-data:' but for interfaces. 403865f46b2SCy Schubert # Set redirect data for a particular tag for an interface element. 404865f46b2SCy Schubert # The specified interfaces should be the same as the ones specified in 405865f46b2SCy Schubert # 'interface:' followed by the tag and the redirect data. 406865f46b2SCy Schubert # Note: any 'access-control*:' setting overrides all 'interface-*:' 407865f46b2SCy Schubert # settings for targeted clients. 408865f46b2SCy Schubert # interface-tag-data: eth0@5003 tag2 "A 127.0.0.1" 409865f46b2SCy Schubert 410865f46b2SCy Schubert # Similar to 'access-control-view:' but for interfaces. 411865f46b2SCy Schubert # Set view for an interface element. 412865f46b2SCy Schubert # The specified interfaces should be the same as the ones specified in 413865f46b2SCy Schubert # 'interface:' followed by the view name. 414865f46b2SCy Schubert # Note: any 'access-control*:' setting overrides all 'interface-*:' 415865f46b2SCy Schubert # settings for targeted clients. 416865f46b2SCy Schubert # interface-view: eth0@5003 viewname 417865f46b2SCy Schubert 418b7579f77SDag-Erling Smørgrav # if given, a chroot(2) is done to the given directory. 419b7579f77SDag-Erling Smørgrav # i.e. you can chroot to the working directory, for example, 420b7579f77SDag-Erling Smørgrav # for extra security, but make sure all files are in that directory. 421b7579f77SDag-Erling Smørgrav # 422b7579f77SDag-Erling Smørgrav # If chroot is enabled, you should pass the configfile (from the 423b7579f77SDag-Erling Smørgrav # commandline) as a full path from the original root. After the 424b7579f77SDag-Erling Smørgrav # chroot has been performed the now defunct portion of the config 425b7579f77SDag-Erling Smørgrav # file path is removed to be able to reread the config after a reload. 426b7579f77SDag-Erling Smørgrav # 427b7579f77SDag-Erling Smørgrav # All other file paths (working dir, logfile, roothints, and 428b7579f77SDag-Erling Smørgrav # key files) can be specified in several ways: 429b7579f77SDag-Erling Smørgrav # o as an absolute path relative to the new root. 430b7579f77SDag-Erling Smørgrav # o as a relative path to the working directory. 431b7579f77SDag-Erling Smørgrav # o as an absolute path relative to the original root. 432b7579f77SDag-Erling Smørgrav # In the last case the path is adjusted to remove the unused portion. 433b7579f77SDag-Erling Smørgrav # 434b7579f77SDag-Erling Smørgrav # The pid file can be absolute and outside of the chroot, it is 435b7579f77SDag-Erling Smørgrav # written just prior to performing the chroot and dropping permissions. 436b7579f77SDag-Erling Smørgrav # 4379cf5bc93SCy Schubert # Additionally, Unbound may need to access /dev/urandom (for entropy). 438b7579f77SDag-Erling Smørgrav # How to do this is specific to your OS. 439b7579f77SDag-Erling Smørgrav # 440b7579f77SDag-Erling Smørgrav # If you give "" no chroot is performed. The path must not end in a /. 441b7579f77SDag-Erling Smørgrav # chroot: "@UNBOUND_CHROOT_DIR@" 442b7579f77SDag-Erling Smørgrav 443b7579f77SDag-Erling Smørgrav # if given, user privileges are dropped (after binding port), 444b7579f77SDag-Erling Smørgrav # and the given username is assumed. Default is user "unbound". 445b7579f77SDag-Erling Smørgrav # If you give "" no privileges are dropped. 446b7579f77SDag-Erling Smørgrav # username: "@UNBOUND_USERNAME@" 447b7579f77SDag-Erling Smørgrav 448b7579f77SDag-Erling Smørgrav # the working directory. The relative files in this config are 449b7579f77SDag-Erling Smørgrav # relative to this directory. If you give "" the working directory 450b7579f77SDag-Erling Smørgrav # is not changed. 451b5663de9SDag-Erling Smørgrav # If you give a server: directory: dir before include: file statements 452b5663de9SDag-Erling Smørgrav # then those includes can be relative to the working directory. 453b7579f77SDag-Erling Smørgrav # directory: "@UNBOUND_RUN_DIR@" 454b7579f77SDag-Erling Smørgrav 455b7579f77SDag-Erling Smørgrav # the log file, "" means log to stderr. 456b7579f77SDag-Erling Smørgrav # Use of this option sets use-syslog to "no". 457b7579f77SDag-Erling Smørgrav # logfile: "" 458b7579f77SDag-Erling Smørgrav 459b7579f77SDag-Erling Smørgrav # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to 460bc892140SDag-Erling Smørgrav # log to. If yes, it overrides the logfile. 461b7579f77SDag-Erling Smørgrav # use-syslog: yes 462b7579f77SDag-Erling Smørgrav 463bc892140SDag-Erling Smørgrav # Log identity to report. if empty, defaults to the name of argv[0] 464bc892140SDag-Erling Smørgrav # (usually "unbound"). 465bc892140SDag-Erling Smørgrav # log-identity: "" 466bc892140SDag-Erling Smørgrav 467b7579f77SDag-Erling Smørgrav # print UTC timestamp in ascii to logfile, default is epoch in seconds. 468b7579f77SDag-Erling Smørgrav # log-time-ascii: no 469b7579f77SDag-Erling Smørgrav 47046d2f618SCy Schubert # log timestamp in ISO8601 format if also log-time-ascii is enabled. 47146d2f618SCy Schubert # (y-m-dTh:m:s.msec[+-]tzhours:tzminutes) 47246d2f618SCy Schubert # log-time-iso: no 47346d2f618SCy Schubert 474b7579f77SDag-Erling Smørgrav # print one line with time, IP, name, type, class for every query. 475b7579f77SDag-Erling Smørgrav # log-queries: no 476b7579f77SDag-Erling Smørgrav 4773005e0a3SDag-Erling Smørgrav # print one line per reply, with time, IP, name, type, class, rcode, 4783005e0a3SDag-Erling Smørgrav # timetoresolve, fromcache and responsesize. 4793005e0a3SDag-Erling Smørgrav # log-replies: no 4803005e0a3SDag-Erling Smørgrav 481e86b9096SDag-Erling Smørgrav # log with tag 'query' and 'reply' instead of 'info' for 482e86b9096SDag-Erling Smørgrav # filtering log-queries and log-replies from the log. 483e86b9096SDag-Erling Smørgrav # log-tag-queryreply: no 484e86b9096SDag-Erling Smørgrav 485b7c0c8c1SCy Schubert # log with destination address, port and type for log-replies. 486b7c0c8c1SCy Schubert # log-destaddr: no 487b7c0c8c1SCy Schubert 4884c75e3aaSDag-Erling Smørgrav # log the local-zone actions, like local-zone type inform is enabled 4894c75e3aaSDag-Erling Smørgrav # also for the other local zone types. 4904c75e3aaSDag-Erling Smørgrav # log-local-actions: no 4914c75e3aaSDag-Erling Smørgrav 4924c75e3aaSDag-Erling Smørgrav # print log lines that say why queries return SERVFAIL to clients. 4934c75e3aaSDag-Erling Smørgrav # log-servfail: no 4944c75e3aaSDag-Erling Smørgrav 495b7579f77SDag-Erling Smørgrav # the pid file. Can be an absolute path outside of chroot/work dir. 496b7579f77SDag-Erling Smørgrav # pidfile: "@UNBOUND_PIDFILE@" 497b7579f77SDag-Erling Smørgrav 498b7579f77SDag-Erling Smørgrav # file to read root hints from. 49905ab2901SDag-Erling Smørgrav # get one from https://www.internic.net/domain/named.cache 500b7579f77SDag-Erling Smørgrav # root-hints: "" 501b7579f77SDag-Erling Smørgrav 502b7579f77SDag-Erling Smørgrav # enable to not answer id.server and hostname.bind queries. 503b7579f77SDag-Erling Smørgrav # hide-identity: no 504b7579f77SDag-Erling Smørgrav 505b7579f77SDag-Erling Smørgrav # enable to not answer version.server and version.bind queries. 506b7579f77SDag-Erling Smørgrav # hide-version: no 507b7579f77SDag-Erling Smørgrav 50865b390aaSDag-Erling Smørgrav # enable to not answer trustanchor.unbound queries. 50965b390aaSDag-Erling Smørgrav # hide-trustanchor: no 51065b390aaSDag-Erling Smørgrav 5115469a995SCy Schubert # enable to not set the User-Agent HTTP header. 5125469a995SCy Schubert # hide-http-user-agent: no 5135469a995SCy Schubert 514b7579f77SDag-Erling Smørgrav # the identity to report. Leave "" or default to return hostname. 515b7579f77SDag-Erling Smørgrav # identity: "" 516b7579f77SDag-Erling Smørgrav 517b7579f77SDag-Erling Smørgrav # the version to report. Leave "" or default to return package version. 518b7579f77SDag-Erling Smørgrav # version: "" 519b7579f77SDag-Erling Smørgrav 520f44e67d1SCy Schubert # NSID identity (hex string, or "ascii_somestring"). default disabled. 521f44e67d1SCy Schubert # nsid: "aabbccdd" 522f44e67d1SCy Schubert 5235469a995SCy Schubert # User-Agent HTTP header to use. Leave "" or default to use package name 5245469a995SCy Schubert # and version. 5255469a995SCy Schubert # http-user-agent: "" 5265469a995SCy Schubert 527b7579f77SDag-Erling Smørgrav # the target fetch policy. 528b7579f77SDag-Erling Smørgrav # series of integers describing the policy per dependency depth. 529b7579f77SDag-Erling Smørgrav # The number of values in the list determines the maximum dependency 530b7579f77SDag-Erling Smørgrav # depth the recursor will pursue before giving up. Each integer means: 531b7579f77SDag-Erling Smørgrav # -1 : fetch all targets opportunistically, 532b7579f77SDag-Erling Smørgrav # 0: fetch on demand, 533b7579f77SDag-Erling Smørgrav # positive value: fetch that many targets opportunistically. 534b7579f77SDag-Erling Smørgrav # Enclose the list of numbers between quotes (""). 535b7579f77SDag-Erling Smørgrav # target-fetch-policy: "3 2 1 0 0" 536b7579f77SDag-Erling Smørgrav 537b7579f77SDag-Erling Smørgrav # Harden against very small EDNS buffer sizes. 538f44e67d1SCy Schubert # harden-short-bufsize: yes 539b7579f77SDag-Erling Smørgrav 540b7579f77SDag-Erling Smørgrav # Harden against unseemly large queries. 541b7579f77SDag-Erling Smørgrav # harden-large-queries: no 542b7579f77SDag-Erling Smørgrav 543b7579f77SDag-Erling Smørgrav # Harden against out of zone rrsets, to avoid spoofing attempts. 544b7579f77SDag-Erling Smørgrav # harden-glue: yes 545b7579f77SDag-Erling Smørgrav 54646d2f618SCy Schubert # Harden against unverified (outside-zone, including sibling zone) glue rrsets 54746d2f618SCy Schubert # harden-unverified-glue: no 54846d2f618SCy Schubert 549b7579f77SDag-Erling Smørgrav # Harden against receiving dnssec-stripped data. If you turn it 550b7579f77SDag-Erling Smørgrav # off, failing to validate dnskey data for a trustanchor will 551b7579f77SDag-Erling Smørgrav # trigger insecure mode for that zone (like without a trustanchor). 552b7579f77SDag-Erling Smørgrav # Default on, which insists on dnssec data for trust-anchored zones. 553b7579f77SDag-Erling Smørgrav # harden-dnssec-stripped: yes 554b7579f77SDag-Erling Smørgrav 555b7579f77SDag-Erling Smørgrav # Harden against queries that fall under dnssec-signed nxdomain names. 5564c75e3aaSDag-Erling Smørgrav # harden-below-nxdomain: yes 557b7579f77SDag-Erling Smørgrav 558b7579f77SDag-Erling Smørgrav # Harden the referral path by performing additional queries for 559b7579f77SDag-Erling Smørgrav # infrastructure data. Validates the replies (if possible). 560b7579f77SDag-Erling Smørgrav # Default off, because the lookups burden the server. Experimental 561b7579f77SDag-Erling Smørgrav # implementation of draft-wijngaards-dnsext-resolver-side-mitigation. 562b7579f77SDag-Erling Smørgrav # harden-referral-path: no 563b7579f77SDag-Erling Smørgrav 56409a3aaf3SDag-Erling Smørgrav # Harden against algorithm downgrade when multiple algorithms are 565*be771a7bSCy Schubert # advertised in the DS record. If no, allows any algorithm 566*be771a7bSCy Schubert # to validate the zone which is the standard behavior for validators. 567*be771a7bSCy Schubert # Check the manpage for detailed information. 568b75612f8SDag-Erling Smørgrav # harden-algo-downgrade: no 56909a3aaf3SDag-Erling Smørgrav 5708f76bb7dSCy Schubert # Harden against unknown records in the authority section and the 5718f76bb7dSCy Schubert # additional section. 5728f76bb7dSCy Schubert # harden-unknown-additional: no 5738f76bb7dSCy Schubert 57405ab2901SDag-Erling Smørgrav # Sent minimum amount of information to upstream servers to enhance 57505ab2901SDag-Erling Smørgrav # privacy. Only sent minimum required labels of the QNAME and set QTYPE 57657bddd21SDag-Erling Smørgrav # to A when possible. 5773bd4df0aSDag-Erling Smørgrav # qname-minimisation: yes 57805ab2901SDag-Erling Smørgrav 579bc892140SDag-Erling Smørgrav # QNAME minimisation in strict mode. Do not fall-back to sending full 580bc892140SDag-Erling Smørgrav # QNAME to potentially broken nameservers. A lot of domains will not be 581bc892140SDag-Erling Smørgrav # resolvable when this option in enabled. 582bc892140SDag-Erling Smørgrav # This option only has effect when qname-minimisation is enabled. 583bc892140SDag-Erling Smørgrav # qname-minimisation-strict: no 584bc892140SDag-Erling Smørgrav 58557bddd21SDag-Erling Smørgrav # Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN 58657bddd21SDag-Erling Smørgrav # and other denials, using information from previous NXDOMAINs answers. 5879cf5bc93SCy Schubert # aggressive-nsec: yes 58857bddd21SDag-Erling Smørgrav 589b7579f77SDag-Erling Smørgrav # Use 0x20-encoded random bits in the query to foil spoof attempts. 590b7579f77SDag-Erling Smørgrav # This feature is an experimental implementation of draft dns-0x20. 591b7579f77SDag-Erling Smørgrav # use-caps-for-id: no 592b7579f77SDag-Erling Smørgrav 59309a3aaf3SDag-Erling Smørgrav # Domains (and domains in them) without support for dns-0x20 and 59409a3aaf3SDag-Erling Smørgrav # the fallback fails because they keep sending different answers. 595c0caa2e2SCy Schubert # caps-exempt: "licdn.com" 596c0caa2e2SCy Schubert # caps-exempt: "senderbase.org" 59709a3aaf3SDag-Erling Smørgrav 598b7579f77SDag-Erling Smørgrav # Enforce privacy of these addresses. Strips them away from answers. 599b7579f77SDag-Erling Smørgrav # It may cause DNSSEC validation to additionally mark it as bogus. 600b7579f77SDag-Erling Smørgrav # Protects against 'DNS Rebinding' (uses browser as network proxy). 601b7579f77SDag-Erling Smørgrav # Only 'private-domain' and 'local-data' names are allowed to have 602b7579f77SDag-Erling Smørgrav # these private addresses. No default. 603b7579f77SDag-Erling Smørgrav # private-address: 10.0.0.0/8 604b7579f77SDag-Erling Smørgrav # private-address: 172.16.0.0/12 605b7579f77SDag-Erling Smørgrav # private-address: 192.168.0.0/16 606b7579f77SDag-Erling Smørgrav # private-address: 169.254.0.0/16 607b7579f77SDag-Erling Smørgrav # private-address: fd00::/8 608b7579f77SDag-Erling Smørgrav # private-address: fe80::/10 60905ab2901SDag-Erling Smørgrav # private-address: ::ffff:0:0/96 610b7579f77SDag-Erling Smørgrav 611b7579f77SDag-Erling Smørgrav # Allow the domain (and its subdomains) to contain private addresses. 612b7579f77SDag-Erling Smørgrav # local-data statements are allowed to contain private addresses too. 613b7579f77SDag-Erling Smørgrav # private-domain: "example.com" 614b7579f77SDag-Erling Smørgrav 615b7579f77SDag-Erling Smørgrav # If nonzero, unwanted replies are not only reported in statistics, 616b7579f77SDag-Erling Smørgrav # but also a running total is kept per thread. If it reaches the 617b7579f77SDag-Erling Smørgrav # threshold, a warning is printed and a defensive action is taken, 618b7579f77SDag-Erling Smørgrav # the cache is cleared to flush potential poison out of it. 619b7579f77SDag-Erling Smørgrav # A suggested value is 10000000, the default is 0 (turned off). 620b7579f77SDag-Erling Smørgrav # unwanted-reply-threshold: 0 621b7579f77SDag-Erling Smørgrav 622b7579f77SDag-Erling Smørgrav # Do not query the following addresses. No DNS queries are sent there. 623b7579f77SDag-Erling Smørgrav # List one address per entry. List classless netblocks with /size, 624b7579f77SDag-Erling Smørgrav # do-not-query-address: 127.0.0.1/8 625b7579f77SDag-Erling Smørgrav # do-not-query-address: ::1 626b7579f77SDag-Erling Smørgrav 627b7579f77SDag-Erling Smørgrav # if yes, the above default do-not-query-address entries are present. 628b7579f77SDag-Erling Smørgrav # if no, localhost can be queried (for testing and debugging). 629b7579f77SDag-Erling Smørgrav # do-not-query-localhost: yes 630b7579f77SDag-Erling Smørgrav 631b7579f77SDag-Erling Smørgrav # if yes, perform prefetching of almost expired message cache entries. 632b7579f77SDag-Erling Smørgrav # prefetch: no 633b7579f77SDag-Erling Smørgrav 634b7579f77SDag-Erling Smørgrav # if yes, perform key lookups adjacent to normal lookups. 635b7579f77SDag-Erling Smørgrav # prefetch-key: no 636b7579f77SDag-Erling Smørgrav 637e86b9096SDag-Erling Smørgrav # deny queries of type ANY with an empty response. 638e86b9096SDag-Erling Smørgrav # deny-any: no 639e86b9096SDag-Erling Smørgrav 640b7579f77SDag-Erling Smørgrav # if yes, Unbound rotates RRSet order in response. 64125039b37SCy Schubert # rrset-roundrobin: yes 642b7579f77SDag-Erling Smørgrav 643b7579f77SDag-Erling Smørgrav # if yes, Unbound doesn't insert authority/additional sections 644b7579f77SDag-Erling Smørgrav # into response messages when those sections are not required. 6454c75e3aaSDag-Erling Smørgrav # minimal-responses: yes 646b7579f77SDag-Erling Smørgrav 647e2d15004SDag-Erling Smørgrav # true to disable DNSSEC lameness check in iterator. 648e2d15004SDag-Erling Smørgrav # disable-dnssec-lame-check: no 649e2d15004SDag-Erling Smørgrav 650b7579f77SDag-Erling Smørgrav # module configuration of the server. A string with identifiers 651ff825849SDag-Erling Smørgrav # separated by spaces. Syntax: "[dns64] [validator] iterator" 652e86b9096SDag-Erling Smørgrav # most modules have to be listed at the beginning of the line, 653e86b9096SDag-Erling Smørgrav # except cachedb(just before iterator), and python (at the beginning, 654e86b9096SDag-Erling Smørgrav # or, just before the iterator). 655b7579f77SDag-Erling Smørgrav # module-config: "validator iterator" 656b7579f77SDag-Erling Smørgrav 657b7579f77SDag-Erling Smørgrav # File with trusted keys, kept uptodate using RFC5011 probes, 658b7579f77SDag-Erling Smørgrav # initial file like trust-anchor-file, then it stores metadata. 659b7579f77SDag-Erling Smørgrav # Use several entries, one per domain name, to track multiple zones. 660b7579f77SDag-Erling Smørgrav # 661b7579f77SDag-Erling Smørgrav # If you want to perform DNSSEC validation, run unbound-anchor before 6629cf5bc93SCy Schubert # you start Unbound (i.e. in the system boot scripts). 6635469a995SCy Schubert # And then enable the auto-trust-anchor-file config item. 664b7579f77SDag-Erling Smørgrav # Please note usage of unbound-anchor root anchor is at your own risk 665b7579f77SDag-Erling Smørgrav # and under the terms of our LICENSE (see that file in the source). 666b7579f77SDag-Erling Smørgrav # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" 667b7579f77SDag-Erling Smørgrav 668c7f4d7adSDag-Erling Smørgrav # trust anchor signaling sends a RFC8145 key tag query after priming. 6698a384985SDag-Erling Smørgrav # trust-anchor-signaling: yes 670c7f4d7adSDag-Erling Smørgrav 6710fb34990SDag-Erling Smørgrav # Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel) 6720fb34990SDag-Erling Smørgrav # root-key-sentinel: yes 6730fb34990SDag-Erling Smørgrav 674b7579f77SDag-Erling Smørgrav # File with trusted keys for validation. Specify more than one file 675b7579f77SDag-Erling Smørgrav # with several entries, one file per entry. 676b7579f77SDag-Erling Smørgrav # Zone file format, with DS and DNSKEY entries. 677b7579f77SDag-Erling Smørgrav # Note this gets out of date, use auto-trust-anchor-file please. 678b7579f77SDag-Erling Smørgrav # trust-anchor-file: "" 679b7579f77SDag-Erling Smørgrav 680b7579f77SDag-Erling Smørgrav # Trusted key for validation. DS or DNSKEY. specify the RR on a 681b7579f77SDag-Erling Smørgrav # single line, surrounded by "". TTL is ignored. class is IN default. 682b7579f77SDag-Erling Smørgrav # Note this gets out of date, use auto-trust-anchor-file please. 683b7579f77SDag-Erling Smørgrav # (These examples are from August 2007 and may not be valid anymore). 684b7579f77SDag-Erling Smørgrav # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ==" 685b7579f77SDag-Erling Smørgrav # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A" 686b7579f77SDag-Erling Smørgrav 687b7579f77SDag-Erling Smørgrav # File with trusted keys for validation. Specify more than one file 688b7579f77SDag-Erling Smørgrav # with several entries, one file per entry. Like trust-anchor-file 689b7579f77SDag-Erling Smørgrav # but has a different file format. Format is BIND-9 style format, 690b7579f77SDag-Erling Smørgrav # the trusted-keys { name flag proto algo "key"; }; clauses are read. 691b7579f77SDag-Erling Smørgrav # you need external update procedures to track changes in keys. 692b7579f77SDag-Erling Smørgrav # trusted-keys-file: "" 693b7579f77SDag-Erling Smørgrav 694b7579f77SDag-Erling Smørgrav # Ignore chain of trust. Domain is treated as insecure. 695b7579f77SDag-Erling Smørgrav # domain-insecure: "example.com" 696b7579f77SDag-Erling Smørgrav 697b7579f77SDag-Erling Smørgrav # Override the date for validation with a specific fixed date. 698b7579f77SDag-Erling Smørgrav # Do not set this unless you are debugging signature inception 699b7579f77SDag-Erling Smørgrav # and expiration. "" or "0" turns the feature off. -1 ignores date. 700b7579f77SDag-Erling Smørgrav # val-override-date: "" 701b7579f77SDag-Erling Smørgrav 702b7579f77SDag-Erling Smørgrav # The time to live for bogus data, rrsets and messages. This avoids 703b7579f77SDag-Erling Smørgrav # some of the revalidation, until the time interval expires. in secs. 704b7579f77SDag-Erling Smørgrav # val-bogus-ttl: 60 705b7579f77SDag-Erling Smørgrav 706b7579f77SDag-Erling Smørgrav # The signature inception and expiration dates are allowed to be off 707b7579f77SDag-Erling Smørgrav # by 10% of the signature lifetime (expir-incep) from our local clock. 708b7579f77SDag-Erling Smørgrav # This leeway is capped with a minimum and a maximum. In seconds. 709b7579f77SDag-Erling Smørgrav # val-sig-skew-min: 3600 710b7579f77SDag-Erling Smørgrav # val-sig-skew-max: 86400 711b7579f77SDag-Erling Smørgrav 7125469a995SCy Schubert # The maximum number the validator should restart validation with 7135469a995SCy Schubert # another authority in case of failed validation. 7145469a995SCy Schubert # val-max-restart: 5 7155469a995SCy Schubert 716b7579f77SDag-Erling Smørgrav # Should additional section of secure message also be kept clean of 717b7579f77SDag-Erling Smørgrav # unsecure data. Useful to shield the users of this validator from 718b7579f77SDag-Erling Smørgrav # potential bogus data in the additional section. All unsigned data 719b7579f77SDag-Erling Smørgrav # in the additional section is removed from secure messages. 720b7579f77SDag-Erling Smørgrav # val-clean-additional: yes 721b7579f77SDag-Erling Smørgrav 722b7579f77SDag-Erling Smørgrav # Turn permissive mode on to permit bogus messages. Thus, messages 723b7579f77SDag-Erling Smørgrav # for which security checks failed will be returned to clients, 724b7579f77SDag-Erling Smørgrav # instead of SERVFAIL. It still performs the security checks, which 725b7579f77SDag-Erling Smørgrav # result in interesting log files and possibly the AD bit in 726b7579f77SDag-Erling Smørgrav # replies if the message is found secure. The default is off. 727b7579f77SDag-Erling Smørgrav # val-permissive-mode: no 728b7579f77SDag-Erling Smørgrav 729b7579f77SDag-Erling Smørgrav # Ignore the CD flag in incoming queries and refuse them bogus data. 7309cf5bc93SCy Schubert # Enable it if the only clients of Unbound are legacy servers (w2008) 731b7579f77SDag-Erling Smørgrav # that set CD but cannot validate themselves. 732b7579f77SDag-Erling Smørgrav # ignore-cd-flag: no 733b7579f77SDag-Erling Smørgrav 734103ba509SCy Schubert # Disable the DO flag in outgoing requests. It is helpful for upstream 735103ba509SCy Schubert # devices that cannot handle DNSSEC information. But do not enable it 736103ba509SCy Schubert # otherwise, because it would stop DNSSEC validation. 737103ba509SCy Schubert # disable-edns-do: no 738103ba509SCy Schubert 739091e9e46SCy Schubert # Serve expired responses from cache, with serve-expired-reply-ttl in 740*be771a7bSCy Schubert # the response. By default it first tries to refresh an expired answer. 741*be771a7bSCy Schubert # Can be configured with serve-expired-client-timeout. 742bc892140SDag-Erling Smørgrav # serve-expired: no 7434c75e3aaSDag-Erling Smørgrav # 7444c75e3aaSDag-Erling Smørgrav # Limit serving of expired responses to configured seconds after 7454c75e3aaSDag-Erling Smørgrav # expiration. 0 disables the limit. 746*be771a7bSCy Schubert # serve-expired-ttl: 86400 7474c75e3aaSDag-Erling Smørgrav # 7484c75e3aaSDag-Erling Smørgrav # Set the TTL of expired records to the serve-expired-ttl value after a 7494c75e3aaSDag-Erling Smørgrav # failed attempt to retrieve the record from upstream. This makes sure 7504c75e3aaSDag-Erling Smørgrav # that the expired records will be served as long as there are queries 7514c75e3aaSDag-Erling Smørgrav # for it. 7524c75e3aaSDag-Erling Smørgrav # serve-expired-ttl-reset: no 753091e9e46SCy Schubert # 754091e9e46SCy Schubert # TTL value to use when replying with expired data. 755091e9e46SCy Schubert # serve-expired-reply-ttl: 30 756091e9e46SCy Schubert # 757091e9e46SCy Schubert # Time in milliseconds before replying to the client with expired data. 758091e9e46SCy Schubert # This essentially enables the serve-stale behavior as specified in 759*be771a7bSCy Schubert # RFC 8767 that first tries to resolve before immediately responding 760*be771a7bSCy Schubert # with expired data. 0 disables this behavior. 761*be771a7bSCy Schubert # serve-expired-client-timeout: 1800 762bc892140SDag-Erling Smørgrav 763f44e67d1SCy Schubert # Return the original TTL as received from the upstream name server rather 764f44e67d1SCy Schubert # than the decrementing TTL as stored in the cache. Enabling this feature 7659cf5bc93SCy Schubert # does not impact cache expiry, it only changes the TTL Unbound embeds in 766f44e67d1SCy Schubert # responses to queries. Note that enabling this feature implicitly disables 767f44e67d1SCy Schubert # enforcement of the configured minimum and maximum TTL. 768f44e67d1SCy Schubert # serve-original-ttl: no 769f44e67d1SCy Schubert 770b7579f77SDag-Erling Smørgrav # Have the validator log failed validations for your diagnosis. 771b7579f77SDag-Erling Smørgrav # 0: off. 1: A line per failed user query. 2: With reason and bad IP. 772b7579f77SDag-Erling Smørgrav # val-log-level: 0 773b7579f77SDag-Erling Smørgrav 774b7579f77SDag-Erling Smørgrav # It is possible to configure NSEC3 maximum iteration counts per 775b7579f77SDag-Erling Smørgrav # keysize. Keep this table very short, as linear search is done. 776b7579f77SDag-Erling Smørgrav # A message with an NSEC3 with larger count is marked insecure. 777b7579f77SDag-Erling Smørgrav # List in ascending order the keysize and count values. 7785469a995SCy Schubert # val-nsec3-keysize-iterations: "1024 150 2048 150 4096 150" 7795469a995SCy Schubert 7805469a995SCy Schubert # if enabled, ZONEMD verification failures do not block the zone. 7815469a995SCy Schubert # zonemd-permissive-mode: no 782b7579f77SDag-Erling Smørgrav 783b7579f77SDag-Erling Smørgrav # instruct the auto-trust-anchor-file probing to add anchors after ttl. 784b7579f77SDag-Erling Smørgrav # add-holddown: 2592000 # 30 days 785b7579f77SDag-Erling Smørgrav 786b7579f77SDag-Erling Smørgrav # instruct the auto-trust-anchor-file probing to del anchors after ttl. 787b7579f77SDag-Erling Smørgrav # del-holddown: 2592000 # 30 days 788b7579f77SDag-Erling Smørgrav 789b7579f77SDag-Erling Smørgrav # auto-trust-anchor-file probing removes missing anchors after ttl. 790b7579f77SDag-Erling Smørgrav # If the value 0 is given, missing anchors are not removed. 791b7579f77SDag-Erling Smørgrav # keep-missing: 31622400 # 366 days 792b7579f77SDag-Erling Smørgrav 793e2d15004SDag-Erling Smørgrav # debug option that allows very small holddown times for key rollover, 794e2d15004SDag-Erling Smørgrav # otherwise the RFC mandates probe intervals must be at least 1 hour. 795b75612f8SDag-Erling Smørgrav # permit-small-holddown: no 796b75612f8SDag-Erling Smørgrav 797b7579f77SDag-Erling Smørgrav # the amount of memory to use for the key cache. 798b7579f77SDag-Erling Smørgrav # plain value in bytes or you can append k, m or G. default is "4Mb". 799b7579f77SDag-Erling Smørgrav # key-cache-size: 4m 800b7579f77SDag-Erling Smørgrav 801b7579f77SDag-Erling Smørgrav # the number of slabs to use for the key cache. 802b7579f77SDag-Erling Smørgrav # the number of slabs must be a power of 2. 803b7579f77SDag-Erling Smørgrav # more slabs reduce lock contention, but fragment memory usage. 804b7579f77SDag-Erling Smørgrav # key-cache-slabs: 4 805b7579f77SDag-Erling Smørgrav 806c0caa2e2SCy Schubert # the amount of memory to use for the negative cache. 807b7579f77SDag-Erling Smørgrav # plain value in bytes or you can append k, m or G. default is "1Mb". 808b7579f77SDag-Erling Smørgrav # neg-cache-size: 1m 809b7579f77SDag-Erling Smørgrav 81017d15b25SDag-Erling Smørgrav # By default, for a number of zones a small default 'nothing here' 81117d15b25SDag-Erling Smørgrav # reply is built-in. Query traffic is thus blocked. If you 81217d15b25SDag-Erling Smørgrav # wish to serve such zone you can unblock them by uncommenting one 81317d15b25SDag-Erling Smørgrav # of the nodefault statements below. 81417d15b25SDag-Erling Smørgrav # You may also have to use domain-insecure: zone to make DNSSEC work, 81517d15b25SDag-Erling Smørgrav # unless you have your own trust anchors for this zone. 81617d15b25SDag-Erling Smørgrav # local-zone: "localhost." nodefault 81717d15b25SDag-Erling Smørgrav # local-zone: "127.in-addr.arpa." nodefault 81817d15b25SDag-Erling Smørgrav # 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 81924e36522SCy Schubert # local-zone: "home.arpa." nodefault 820*be771a7bSCy Schubert # local-zone: "resolver.arpa." nodefault 821*be771a7bSCy Schubert # local-zone: "service.arpa." nodefault 822f61ef7f6SDag-Erling Smørgrav # local-zone: "onion." nodefault 823971980c3SDag-Erling Smørgrav # local-zone: "test." nodefault 824971980c3SDag-Erling Smørgrav # local-zone: "invalid." nodefault 82517d15b25SDag-Erling Smørgrav # local-zone: "10.in-addr.arpa." nodefault 82617d15b25SDag-Erling Smørgrav # local-zone: "16.172.in-addr.arpa." nodefault 82717d15b25SDag-Erling Smørgrav # local-zone: "17.172.in-addr.arpa." nodefault 82817d15b25SDag-Erling Smørgrav # local-zone: "18.172.in-addr.arpa." nodefault 82917d15b25SDag-Erling Smørgrav # local-zone: "19.172.in-addr.arpa." nodefault 83017d15b25SDag-Erling Smørgrav # local-zone: "20.172.in-addr.arpa." nodefault 83117d15b25SDag-Erling Smørgrav # local-zone: "21.172.in-addr.arpa." nodefault 83217d15b25SDag-Erling Smørgrav # local-zone: "22.172.in-addr.arpa." nodefault 83317d15b25SDag-Erling Smørgrav # local-zone: "23.172.in-addr.arpa." nodefault 83417d15b25SDag-Erling Smørgrav # local-zone: "24.172.in-addr.arpa." nodefault 83517d15b25SDag-Erling Smørgrav # local-zone: "25.172.in-addr.arpa." nodefault 83617d15b25SDag-Erling Smørgrav # local-zone: "26.172.in-addr.arpa." nodefault 83717d15b25SDag-Erling Smørgrav # local-zone: "27.172.in-addr.arpa." nodefault 83817d15b25SDag-Erling Smørgrav # local-zone: "28.172.in-addr.arpa." nodefault 83917d15b25SDag-Erling Smørgrav # local-zone: "29.172.in-addr.arpa." nodefault 84017d15b25SDag-Erling Smørgrav # local-zone: "30.172.in-addr.arpa." nodefault 84117d15b25SDag-Erling Smørgrav # local-zone: "31.172.in-addr.arpa." nodefault 84217d15b25SDag-Erling Smørgrav # local-zone: "168.192.in-addr.arpa." nodefault 84317d15b25SDag-Erling Smørgrav # local-zone: "0.in-addr.arpa." nodefault 84417d15b25SDag-Erling Smørgrav # local-zone: "254.169.in-addr.arpa." nodefault 84517d15b25SDag-Erling Smørgrav # local-zone: "2.0.192.in-addr.arpa." nodefault 84617d15b25SDag-Erling Smørgrav # local-zone: "100.51.198.in-addr.arpa." nodefault 84717d15b25SDag-Erling Smørgrav # local-zone: "113.0.203.in-addr.arpa." nodefault 84817d15b25SDag-Erling Smørgrav # local-zone: "255.255.255.255.in-addr.arpa." nodefault 84917d15b25SDag-Erling Smørgrav # 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 85017d15b25SDag-Erling Smørgrav # local-zone: "d.f.ip6.arpa." nodefault 85117d15b25SDag-Erling Smørgrav # local-zone: "8.e.f.ip6.arpa." nodefault 85217d15b25SDag-Erling Smørgrav # local-zone: "9.e.f.ip6.arpa." nodefault 85317d15b25SDag-Erling Smørgrav # local-zone: "a.e.f.ip6.arpa." nodefault 85417d15b25SDag-Erling Smørgrav # local-zone: "b.e.f.ip6.arpa." nodefault 85517d15b25SDag-Erling Smørgrav # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault 856ff825849SDag-Erling Smørgrav # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. 857ff825849SDag-Erling Smørgrav 8580eefd307SCy Schubert # Add example.com into ipset 8590eefd307SCy Schubert # local-zone: "example.com" ipset 8600eefd307SCy Schubert 8619cf5bc93SCy Schubert # If Unbound is running service for the local host then it is useful 862ff825849SDag-Erling Smørgrav # to perform lan-wide lookups to the upstream, and unblock the 8639cf5bc93SCy Schubert # long list of local-zones above. If this Unbound is a dns server 864ff825849SDag-Erling Smørgrav # for a network of computers, disabled is better and stops information 865ff825849SDag-Erling Smørgrav # leakage of local lan information. 866ff825849SDag-Erling Smørgrav # unblock-lan-zones: no 86717d15b25SDag-Erling Smørgrav 8680de4f1bfSDag-Erling Smørgrav # The insecure-lan-zones option disables validation for 8690de4f1bfSDag-Erling Smørgrav # these zones, as if they were all listed as domain-insecure. 8700de4f1bfSDag-Erling Smørgrav # insecure-lan-zones: no 8710de4f1bfSDag-Erling Smørgrav 872b7579f77SDag-Erling Smørgrav # a number of locally served zones can be configured. 873b7579f77SDag-Erling Smørgrav # local-zone: <zone> <type> 874b7579f77SDag-Erling Smørgrav # local-data: "<resource record string>" 875b7579f77SDag-Erling Smørgrav # o deny serves local data (if any), else, drops queries. 876b7579f77SDag-Erling Smørgrav # o refuse serves local data (if any), else, replies with error. 877b7579f77SDag-Erling Smørgrav # o static serves local data, else, nxdomain or nodata answer. 878b7579f77SDag-Erling Smørgrav # o transparent gives local data, but resolves normally for other names 879b7579f77SDag-Erling Smørgrav # o redirect serves the zone data for any subdomain in the zone. 880b7579f77SDag-Erling Smørgrav # o nodefault can be used to normally resolve AS112 zones. 881b7579f77SDag-Erling Smørgrav # o typetransparent resolves normally for other types and other names 882bc892140SDag-Erling Smørgrav # o inform acts like transparent, but logs client IP address 88309a3aaf3SDag-Erling Smørgrav # o inform_deny drops queries and logs client IP address 884e86b9096SDag-Erling Smørgrav # o inform_redirect redirects queries and logs client IP address 885f44e67d1SCy Schubert # o always_transparent, always_refuse, always_nxdomain, always_nodata, 886f44e67d1SCy Schubert # always_deny resolve in that way but ignore local data for 887f44e67d1SCy Schubert # that name 8888f76bb7dSCy Schubert # o block_a resolves all records normally but returns 8898f76bb7dSCy Schubert # NODATA for A queries and ignores local data for that name 890f44e67d1SCy Schubert # o always_null returns 0.0.0.0 or ::0 for any name in the zone. 89157bddd21SDag-Erling Smørgrav # o noview breaks out of that view towards global local-zones. 892b7579f77SDag-Erling Smørgrav # 893b7579f77SDag-Erling Smørgrav # defaults are localhost address, reverse for 127.0.0.1 and ::1 894b7579f77SDag-Erling Smørgrav # and nxdomain for AS112 zones. If you configure one of these zones 895b7579f77SDag-Erling Smørgrav # the default content is omitted, or you can omit it with 'nodefault'. 896b7579f77SDag-Erling Smørgrav # 897b7579f77SDag-Erling Smørgrav # If you configure local-data without specifying local-zone, by 898b7579f77SDag-Erling Smørgrav # default a transparent local-zone is created for the data. 899b7579f77SDag-Erling Smørgrav # 900b7579f77SDag-Erling Smørgrav # You can add locally served data with 901b7579f77SDag-Erling Smørgrav # local-zone: "local." static 902b7579f77SDag-Erling Smørgrav # local-data: "mycomputer.local. IN A 192.0.2.51" 903b7579f77SDag-Erling Smørgrav # local-data: 'mytext.local TXT "content of text record"' 904b7579f77SDag-Erling Smørgrav # 905b7579f77SDag-Erling Smørgrav # You can override certain queries with 906b7579f77SDag-Erling Smørgrav # local-data: "adserver.example.com A 127.0.0.1" 907b7579f77SDag-Erling Smørgrav # 908b7579f77SDag-Erling Smørgrav # You can redirect a domain to a fixed address with 909b7579f77SDag-Erling Smørgrav # (this makes example.com, www.example.com, etc, all go to 192.0.2.3) 910b7579f77SDag-Erling Smørgrav # local-zone: "example.com" redirect 911b7579f77SDag-Erling Smørgrav # local-data: "example.com A 192.0.2.3" 912b7579f77SDag-Erling Smørgrav # 913b7579f77SDag-Erling Smørgrav # Shorthand to make PTR records, "IPv4 name" or "IPv6 name". 914b7579f77SDag-Erling Smørgrav # You can also add PTR records using local-data directly, but then 915b7579f77SDag-Erling Smørgrav # you need to do the reverse notation yourself. 916b7579f77SDag-Erling Smørgrav # local-data-ptr: "192.0.2.3 www.example.com" 917b7579f77SDag-Erling Smørgrav 918b5663de9SDag-Erling Smørgrav # tag a localzone with a list of tag names (in "" with spaces between) 919b5663de9SDag-Erling Smørgrav # local-zone-tag: "example.com" "tag2 tag3" 920b5663de9SDag-Erling Smørgrav 921b5663de9SDag-Erling Smørgrav # add a netblock specific override to a localzone, with zone type 922b5663de9SDag-Erling Smørgrav # local-zone-override: "example.com" 192.0.2.0/24 refuse 923b5663de9SDag-Erling Smørgrav 924c0caa2e2SCy Schubert # service clients over TLS (on the TCP sockets) with plain DNS inside 925c0caa2e2SCy Schubert # the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484. 926c0caa2e2SCy Schubert # Give the certificate to use and private key. 927b7579f77SDag-Erling Smørgrav # default is "" (disabled). requires restart to take effect. 92857bddd21SDag-Erling Smørgrav # tls-service-key: "path/to/privatekeyfile.key" 92957bddd21SDag-Erling Smørgrav # tls-service-pem: "path/to/publiccertfile.pem" 93057bddd21SDag-Erling Smørgrav # tls-port: 853 931c0caa2e2SCy Schubert # https-port: 443 93246d2f618SCy Schubert # quic-port: 853 933b7579f77SDag-Erling Smørgrav 934e86b9096SDag-Erling Smørgrav # cipher setting for TLSv1.2 935e86b9096SDag-Erling Smørgrav # 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" 936e86b9096SDag-Erling Smørgrav # cipher setting for TLSv1.3 937e86b9096SDag-Erling Smørgrav # 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" 938e86b9096SDag-Erling Smørgrav 939f44e67d1SCy Schubert # Pad responses to padded queries received over TLS 940f44e67d1SCy Schubert # pad-responses: yes 941f44e67d1SCy Schubert 942f44e67d1SCy Schubert # Padded responses will be padded to the closest multiple of this size. 943f44e67d1SCy Schubert # pad-responses-block-size: 468 944f44e67d1SCy Schubert 94525039b37SCy Schubert # Use the SNI extension for TLS connections. Default is yes. 94625039b37SCy Schubert # Changing the value requires a reload. 94725039b37SCy Schubert # tls-use-sni: yes 94825039b37SCy Schubert 949e86b9096SDag-Erling Smørgrav # Add the secret file for TLS Session Ticket. 950e86b9096SDag-Erling Smørgrav # Secret file must be 80 bytes of random data. 951e86b9096SDag-Erling Smørgrav # First key use to encrypt and decrypt TLS session tickets. 952e86b9096SDag-Erling Smørgrav # Other keys use to decrypt only. 953e86b9096SDag-Erling Smørgrav # requires restart to take effect. 954e86b9096SDag-Erling Smørgrav # tls-session-ticket-keys: "path/to/secret_file1" 955e86b9096SDag-Erling Smørgrav # tls-session-ticket-keys: "path/to/secret_file2" 956e86b9096SDag-Erling Smørgrav 9570fb34990SDag-Erling Smørgrav # request upstream over TLS (with plain DNS inside the TLS stream). 958b7579f77SDag-Erling Smørgrav # Default is no. Can be turned on and off with unbound-control. 95957bddd21SDag-Erling Smørgrav # tls-upstream: no 96057bddd21SDag-Erling Smørgrav 96157bddd21SDag-Erling Smørgrav # Certificates used to authenticate connections made upstream. 96257bddd21SDag-Erling Smørgrav # tls-cert-bundle: "" 963b7579f77SDag-Erling Smørgrav 9643bd4df0aSDag-Erling Smørgrav # Add system certs to the cert bundle, from the Windows Cert Store 9653bd4df0aSDag-Erling Smørgrav # tls-win-cert: no 966a39a5a69SCy Schubert # and on other systems, the default openssl certificates 967a39a5a69SCy Schubert # tls-system-cert: no 9683bd4df0aSDag-Erling Smørgrav 969f44e67d1SCy Schubert # Pad queries over TLS upstreams 970f44e67d1SCy Schubert # pad-queries: yes 971f44e67d1SCy Schubert 972f44e67d1SCy Schubert # Padded queries will be padded to the closest multiple of this size. 973f44e67d1SCy Schubert # pad-queries-block-size: 128 974f44e67d1SCy Schubert 9750fb34990SDag-Erling Smørgrav # Also serve tls on these port numbers (eg. 443, ...), by listing 9767da0adf7SDag-Erling Smørgrav # tls-additional-port: portno for each of the port numbers. 9770fb34990SDag-Erling Smørgrav 978c0caa2e2SCy Schubert # HTTP endpoint to provide DNS-over-HTTPS service on. 979c0caa2e2SCy Schubert # http-endpoint: "/dns-query" 980c0caa2e2SCy Schubert 981c0caa2e2SCy Schubert # HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use. 982c0caa2e2SCy Schubert # http-max-streams: 100 983c0caa2e2SCy Schubert 984c0caa2e2SCy Schubert # Maximum number of bytes used for all HTTP/2 query buffers. 985c0caa2e2SCy Schubert # http-query-buffer-size: 4m 986c0caa2e2SCy Schubert 987c0caa2e2SCy Schubert # Maximum number of bytes used for all HTTP/2 response buffers. 988c0caa2e2SCy Schubert # http-response-buffer-size: 4m 989c0caa2e2SCy Schubert 990c0caa2e2SCy Schubert # Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS 991c0caa2e2SCy Schubert # service. 992c0caa2e2SCy Schubert # http-nodelay: yes 993c0caa2e2SCy Schubert 994369c6923SCy Schubert # Disable TLS for DNS-over-HTTP downstream service. 995369c6923SCy Schubert # http-notls-downstream: no 996369c6923SCy Schubert 99746d2f618SCy Schubert # Maximum number of bytes used for QUIC buffers. 99846d2f618SCy Schubert # quic-size: 8m 99946d2f618SCy Schubert 1000865f46b2SCy Schubert # The interfaces that use these listed port numbers will support and 1001865f46b2SCy Schubert # expect PROXYv2. For UDP and TCP/TLS interfaces. 1002865f46b2SCy Schubert # proxy-protocol-port: portno for each of the port numbers. 1003865f46b2SCy Schubert 1004ff825849SDag-Erling Smørgrav # DNS64 prefix. Must be specified when DNS64 is use. 1005ff825849SDag-Erling Smørgrav # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4. 1006ff825849SDag-Erling Smørgrav # dns64-prefix: 64:ff9b::0/96 1007ff825849SDag-Erling Smørgrav 10084c75e3aaSDag-Erling Smørgrav # DNS64 ignore AAAA records for these domains and use A instead. 10094c75e3aaSDag-Erling Smørgrav # dns64-ignore-aaaa: "example.com" 10104c75e3aaSDag-Erling Smørgrav 101109a3aaf3SDag-Erling Smørgrav # ratelimit for uncached, new queries, this limits recursion effort. 101209a3aaf3SDag-Erling Smørgrav # ratelimiting is experimental, and may help against randomqueryflood. 101309a3aaf3SDag-Erling Smørgrav # if 0(default) it is disabled, otherwise state qps allowed per zone. 101409a3aaf3SDag-Erling Smørgrav # ratelimit: 0 101509a3aaf3SDag-Erling Smørgrav 101609a3aaf3SDag-Erling Smørgrav # ratelimits are tracked in a cache, size in bytes of cache (or k,m). 101709a3aaf3SDag-Erling Smørgrav # ratelimit-size: 4m 101809a3aaf3SDag-Erling Smørgrav # ratelimit cache slabs, reduces lock contention if equal to cpucount. 101909a3aaf3SDag-Erling Smørgrav # ratelimit-slabs: 4 102009a3aaf3SDag-Erling Smørgrav 102109a3aaf3SDag-Erling Smørgrav # 0 blocks when ratelimited, otherwise let 1/xth traffic through 102209a3aaf3SDag-Erling Smørgrav # ratelimit-factor: 10 102309a3aaf3SDag-Erling Smørgrav 10249cf5bc93SCy Schubert # Aggressive rate limit when the limit is reached and until demand has 10259cf5bc93SCy Schubert # decreased in a 2 second rate window. 10269cf5bc93SCy Schubert # ratelimit-backoff: no 10279cf5bc93SCy Schubert 102809a3aaf3SDag-Erling Smørgrav # override the ratelimit for a specific domain name. 102909a3aaf3SDag-Erling Smørgrav # give this setting multiple times to have multiple overrides. 103009a3aaf3SDag-Erling Smørgrav # ratelimit-for-domain: example.com 1000 103109a3aaf3SDag-Erling Smørgrav # override the ratelimits for all domains below a domain name 103209a3aaf3SDag-Erling Smørgrav # can give this multiple times, the name closest to the zone is used. 1033b5663de9SDag-Erling Smørgrav # ratelimit-below-domain: com 1000 103409a3aaf3SDag-Erling Smørgrav 10353005e0a3SDag-Erling Smørgrav # global query ratelimit for all ip addresses. 10363005e0a3SDag-Erling Smørgrav # feature is experimental. 10373005e0a3SDag-Erling Smørgrav # if 0(default) it is disabled, otherwise states qps allowed per ip address 10383005e0a3SDag-Erling Smørgrav # ip-ratelimit: 0 10393005e0a3SDag-Erling Smørgrav 1040b7c0c8c1SCy Schubert # global query ratelimit for all ip addresses with a valid DNS Cookie. 1041b7c0c8c1SCy Schubert # feature is experimental. 1042b7c0c8c1SCy Schubert # if 0(default) it is disabled, otherwise states qps allowed per ip address 1043b7c0c8c1SCy Schubert # useful in combination with 'allow_cookie'. 1044b7c0c8c1SCy Schubert # If used, suggested to be higher than ip-ratelimit, tenfold. 1045b7c0c8c1SCy Schubert # ip-ratelimit-cookie: 0 1046b7c0c8c1SCy Schubert 10473005e0a3SDag-Erling Smørgrav # ip ratelimits are tracked in a cache, size in bytes of cache (or k,m). 10483005e0a3SDag-Erling Smørgrav # ip-ratelimit-size: 4m 10493005e0a3SDag-Erling Smørgrav # ip ratelimit cache slabs, reduces lock contention if equal to cpucount. 10503005e0a3SDag-Erling Smørgrav # ip-ratelimit-slabs: 4 10513005e0a3SDag-Erling Smørgrav 10523005e0a3SDag-Erling Smørgrav # 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through 10533005e0a3SDag-Erling Smørgrav # ip-ratelimit-factor: 10 10543005e0a3SDag-Erling Smørgrav 10559cf5bc93SCy Schubert # Aggressive rate limit when the limit is reached and until demand has 10569cf5bc93SCy Schubert # decreased in a 2 second rate window. 10579cf5bc93SCy Schubert # ip-ratelimit-backoff: no 10589cf5bc93SCy Schubert 10594c75e3aaSDag-Erling Smørgrav # Limit the number of connections simultaneous from a netblock 10604c75e3aaSDag-Erling Smørgrav # tcp-connection-limit: 192.0.2.0/24 12 10614c75e3aaSDag-Erling Smørgrav 1062e86b9096SDag-Erling Smørgrav # select from the fastest servers this many times out of 1000. 0 means 1063e86b9096SDag-Erling Smørgrav # the fast server select is disabled. prefetches are not sped up. 1064e86b9096SDag-Erling Smørgrav # fast-server-permil: 0 1065e86b9096SDag-Erling Smørgrav # the number of servers that will be used in the fast server selection. 1066e86b9096SDag-Erling Smørgrav # fast-server-num: 3 10670fb34990SDag-Erling Smørgrav 1068b7c0c8c1SCy Schubert # reply to requests containing DNS Cookies as specified in RFC 7873 and RFC 9018. 1069b7c0c8c1SCy Schubert # answer-cookie: no 1070b7c0c8c1SCy Schubert 1071b7c0c8c1SCy Schubert # secret for DNS Cookie generation. 1072b7c0c8c1SCy Schubert # useful for anycast deployments. 1073b7c0c8c1SCy Schubert # example value "000102030405060708090a0b0c0d0e0f". 1074b7c0c8c1SCy Schubert # cookie-secret: <128 bit random hex string> 1075b7c0c8c1SCy Schubert 107656850988SCy Schubert # File with cookie secrets, the 'cookie-secret:' option is ignored 107756850988SCy Schubert # and the file can be managed to have staging and active secrets 107856850988SCy Schubert # with remote control commands. Disabled with "". Default is "". 107956850988SCy Schubert # cookie-secret-file: "/usr/local/etc/unbound_cookiesecrets.txt" 108056850988SCy Schubert 1081a39a5a69SCy Schubert # Enable to attach Extended DNS Error codes (RFC8914) to responses. 1082a39a5a69SCy Schubert # ede: no 1083a39a5a69SCy Schubert 1084a39a5a69SCy Schubert # Enable to attach an Extended DNS Error (RFC8914) Code 3 - Stale 1085a39a5a69SCy Schubert # Answer as EDNS0 option to expired responses. 1086a39a5a69SCy Schubert # Note that the ede option above needs to be enabled for this to work. 1087a39a5a69SCy Schubert # ede-serve-expired: no 1088a39a5a69SCy Schubert 1089*be771a7bSCy Schubert # Enable DNS Error Reporting (RFC9567). 1090*be771a7bSCy Schubert # qname-minimisation is advised to be turned on as well to increase 1091*be771a7bSCy Schubert # privacy on the outgoing reports. 1092*be771a7bSCy Schubert # dns-error-reporting: no 1093*be771a7bSCy Schubert 10949cf5bc93SCy Schubert # Specific options for ipsecmod. Unbound needs to be configured with 1095c7f4d7adSDag-Erling Smørgrav # --enable-ipsecmod for these to take effect. 1096c7f4d7adSDag-Erling Smørgrav # 1097c7f4d7adSDag-Erling Smørgrav # Enable or disable ipsecmod (it still needs to be defined in 1098c7f4d7adSDag-Erling Smørgrav # module-config above). Can be used when ipsecmod needs to be 1099c7f4d7adSDag-Erling Smørgrav # enabled/disabled via remote-control(below). 1100c7f4d7adSDag-Erling Smørgrav # ipsecmod-enabled: yes 1101c7f4d7adSDag-Erling Smørgrav # 1102c7f4d7adSDag-Erling Smørgrav # Path to executable external hook. It must be defined when ipsecmod is 1103c7f4d7adSDag-Erling Smørgrav # listed in module-config (above). 1104c7f4d7adSDag-Erling Smørgrav # ipsecmod-hook: "./my_executable" 1105c7f4d7adSDag-Erling Smørgrav # 11069cf5bc93SCy Schubert # When enabled Unbound will reply with SERVFAIL if the return value of 1107c7f4d7adSDag-Erling Smørgrav # the ipsecmod-hook is not 0. 1108c7f4d7adSDag-Erling Smørgrav # ipsecmod-strict: no 1109c7f4d7adSDag-Erling Smørgrav # 1110c7f4d7adSDag-Erling Smørgrav # Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY. 1111c7f4d7adSDag-Erling Smørgrav # ipsecmod-max-ttl: 3600 1112c7f4d7adSDag-Erling Smørgrav # 1113c7f4d7adSDag-Erling Smørgrav # Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for 1114c7f4d7adSDag-Erling Smørgrav # testing. 1115c7f4d7adSDag-Erling Smørgrav # ipsecmod-ignore-bogus: no 1116c7f4d7adSDag-Erling Smørgrav # 1117c7f4d7adSDag-Erling Smørgrav # Domains for which ipsecmod will be triggered. If not defined (default) 1118c0caa2e2SCy Schubert # all domains are treated as being allowed. 1119c0caa2e2SCy Schubert # ipsecmod-allow: "example.com" 1120c0caa2e2SCy Schubert # ipsecmod-allow: "nlnetlabs.nl" 1121c7f4d7adSDag-Erling Smørgrav 11225469a995SCy Schubert # Timeout for REUSE entries in milliseconds. 11235469a995SCy Schubert # tcp-reuse-timeout: 60000 11245469a995SCy Schubert # Max number of queries on a reuse connection. 11255469a995SCy Schubert # max-reuse-tcp-queries: 200 11265469a995SCy Schubert # Timeout in milliseconds for TCP queries to auth servers. 11275469a995SCy Schubert # tcp-auth-query-timeout: 3000 11285469a995SCy Schubert 11293005e0a3SDag-Erling Smørgrav 1130b7579f77SDag-Erling Smørgrav# Python config section. To enable: 1131b7579f77SDag-Erling Smørgrav# o use --with-pythonmodule to configure before compiling. 1132b7579f77SDag-Erling Smørgrav# o list python in the module-config string (above) to enable. 1133e86b9096SDag-Erling Smørgrav# It can be at the start, it gets validated results, or just before 1134e86b9096SDag-Erling Smørgrav# the iterator and process before DNSSEC validation. 1135b7579f77SDag-Erling Smørgrav# o and give a python-script to run. 1136b7579f77SDag-Erling Smørgravpython: 1137b7579f77SDag-Erling Smørgrav # Script file to load 1138b7579f77SDag-Erling Smørgrav # python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py" 1139b7579f77SDag-Erling Smørgrav 114025039b37SCy Schubert# Dynamic library config section. To enable: 114125039b37SCy Schubert# o use --with-dynlibmodule to configure before compiling. 114225039b37SCy Schubert# o list dynlib in the module-config string (above) to enable. 114325039b37SCy Schubert# It can be placed anywhere, the dynlib module is only a very thin wrapper 114425039b37SCy Schubert# to load modules dynamically. 114525039b37SCy Schubert# o and give a dynlib-file to run. If more than one dynlib entry is listed in 114625039b37SCy Schubert# the module-config then you need one dynlib-file per instance. 114725039b37SCy Schubertdynlib: 114825039b37SCy Schubert # Script file to load 114925039b37SCy Schubert # dynlib-file: "@UNBOUND_SHARE_DIR@/dynlib.so" 115025039b37SCy Schubert 1151b7579f77SDag-Erling Smørgrav# Remote control config section. 1152b7579f77SDag-Erling Smørgravremote-control: 1153b7579f77SDag-Erling Smørgrav # Enable remote control with unbound-control(8) here. 1154b7579f77SDag-Erling Smørgrav # set up the keys and certificates with unbound-control-setup. 1155b7579f77SDag-Erling Smørgrav # control-enable: no 1156b7579f77SDag-Erling Smørgrav 1157b7579f77SDag-Erling Smørgrav # what interfaces are listened to for remote control. 1158b7579f77SDag-Erling Smørgrav # give 0.0.0.0 and ::0 to listen to all interfaces. 11597da0adf7SDag-Erling Smørgrav # set to an absolute path to use a unix local name pipe, certificates 11607da0adf7SDag-Erling Smørgrav # are not used for that, so key and cert files need not be present. 1161b7579f77SDag-Erling Smørgrav # control-interface: 127.0.0.1 1162b7579f77SDag-Erling Smørgrav # control-interface: ::1 1163b7579f77SDag-Erling Smørgrav 1164b7579f77SDag-Erling Smørgrav # port number for remote control operations. 1165b7579f77SDag-Erling Smørgrav # control-port: 8953 1166b7579f77SDag-Erling Smørgrav 11677da0adf7SDag-Erling Smørgrav # for localhost, you can disable use of TLS by setting this to "no" 11687da0adf7SDag-Erling Smørgrav # For local sockets this option is ignored, and TLS is not used. 11697da0adf7SDag-Erling Smørgrav # control-use-cert: "yes" 11707da0adf7SDag-Erling Smørgrav 11719cf5bc93SCy Schubert # Unbound server key file. 1172b7579f77SDag-Erling Smørgrav # server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key" 1173b7579f77SDag-Erling Smørgrav 11749cf5bc93SCy Schubert # Unbound server certificate file. 1175b7579f77SDag-Erling Smørgrav # server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem" 1176b7579f77SDag-Erling Smørgrav 1177b7579f77SDag-Erling Smørgrav # unbound-control key file. 1178b7579f77SDag-Erling Smørgrav # control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key" 1179b7579f77SDag-Erling Smørgrav 1180b7579f77SDag-Erling Smørgrav # unbound-control certificate file. 1181b7579f77SDag-Erling Smørgrav # control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem" 1182b7579f77SDag-Erling Smørgrav 1183b7579f77SDag-Erling Smørgrav# Stub zones. 1184b7579f77SDag-Erling Smørgrav# Create entries like below, to make all queries for 'example.com' and 1185b7579f77SDag-Erling Smørgrav# 'example.org' go to the given list of nameservers. list zero or more 1186b7579f77SDag-Erling Smørgrav# nameservers by hostname or by ipaddress. If you set stub-prime to yes, 1187b7579f77SDag-Erling Smørgrav# the list is treated as priming hints (default is no). 1188b7579f77SDag-Erling Smørgrav# With stub-first yes, it attempts without the stub if it fails. 1189b75612f8SDag-Erling Smørgrav# Consider adding domain-insecure: name and local-zone: name nodefault 1190b75612f8SDag-Erling Smørgrav# to the server: section if the stub is a locally served zone. 1191b7579f77SDag-Erling Smørgrav# stub-zone: 1192b7579f77SDag-Erling Smørgrav# name: "example.com" 1193b7579f77SDag-Erling Smørgrav# stub-addr: 192.0.2.68 1194b7579f77SDag-Erling Smørgrav# stub-prime: no 1195b7579f77SDag-Erling Smørgrav# stub-first: no 119624e36522SCy Schubert# stub-tcp-upstream: no 119757bddd21SDag-Erling Smørgrav# stub-tls-upstream: no 11984c75e3aaSDag-Erling Smørgrav# stub-no-cache: no 1199b7579f77SDag-Erling Smørgrav# stub-zone: 1200b7579f77SDag-Erling Smørgrav# name: "example.org" 1201b7579f77SDag-Erling Smørgrav# stub-host: ns.example.com. 1202b7579f77SDag-Erling Smørgrav 1203b7579f77SDag-Erling Smørgrav# Forward zones 1204b7579f77SDag-Erling Smørgrav# Create entries like below, to make all queries for 'example.com' and 1205b7579f77SDag-Erling Smørgrav# 'example.org' go to the given list of servers. These servers have to handle 1206b7579f77SDag-Erling Smørgrav# recursion to other nameservers. List zero or more nameservers by hostname 1207b7579f77SDag-Erling Smørgrav# or by ipaddress. Use an entry with name "." to forward all queries. 1208b7579f77SDag-Erling Smørgrav# If you enable forward-first, it attempts without the forward if it fails. 1209b7579f77SDag-Erling Smørgrav# forward-zone: 1210b7579f77SDag-Erling Smørgrav# name: "example.com" 1211b7579f77SDag-Erling Smørgrav# forward-addr: 192.0.2.68 1212b7579f77SDag-Erling Smørgrav# forward-addr: 192.0.2.73@5355 # forward to port 5355. 1213b7579f77SDag-Erling Smørgrav# forward-first: no 121424e36522SCy Schubert# forward-tcp-upstream: no 121557bddd21SDag-Erling Smørgrav# forward-tls-upstream: no 12164c75e3aaSDag-Erling Smørgrav# forward-no-cache: no 1217b7579f77SDag-Erling Smørgrav# forward-zone: 1218b7579f77SDag-Erling Smørgrav# name: "example.org" 1219b7579f77SDag-Erling Smørgrav# forward-host: fwd.example.com 1220bc892140SDag-Erling Smørgrav 122157bddd21SDag-Erling Smørgrav# Authority zones 122257bddd21SDag-Erling Smørgrav# The data for these zones is kept locally, from a file or downloaded. 122357bddd21SDag-Erling Smørgrav# The data can be served to downstream clients, or used instead of the 122457bddd21SDag-Erling Smørgrav# upstream (which saves a lookup to the upstream). The first example 122557bddd21SDag-Erling Smørgrav# has a copy of the root for local usage. The second serves example.org 122657bddd21SDag-Erling Smørgrav# authoritatively. zonefile: reads from file (and writes to it if you also 1227c0caa2e2SCy Schubert# download it), primary: fetches with AXFR and IXFR, or url to zonefile. 12280a92a9fcSCy Schubert# With allow-notify: you can give additional (apart from primaries and urls) 12290a92a9fcSCy Schubert# sources of notifies. 123057bddd21SDag-Erling Smørgrav# auth-zone: 123157bddd21SDag-Erling Smørgrav# name: "." 1232b7c0c8c1SCy Schubert# primary: 170.247.170.2 # b.root-servers.net 1233c0caa2e2SCy Schubert# primary: 192.33.4.12 # c.root-servers.net 1234c0caa2e2SCy Schubert# primary: 199.7.91.13 # d.root-servers.net 1235c0caa2e2SCy Schubert# primary: 192.5.5.241 # f.root-servers.net 1236c0caa2e2SCy Schubert# primary: 192.112.36.4 # g.root-servers.net 1237c0caa2e2SCy Schubert# primary: 193.0.14.129 # k.root-servers.net 1238c0caa2e2SCy Schubert# primary: 192.0.47.132 # xfr.cjr.dns.icann.org 1239c0caa2e2SCy Schubert# primary: 192.0.32.132 # xfr.lax.dns.icann.org 1240b7c0c8c1SCy Schubert# primary: 2801:1b8:10::b # b.root-servers.net 1241c0caa2e2SCy Schubert# primary: 2001:500:2::c # c.root-servers.net 1242c0caa2e2SCy Schubert# primary: 2001:500:2d::d # d.root-servers.net 1243c0caa2e2SCy Schubert# primary: 2001:500:2f::f # f.root-servers.net 1244c0caa2e2SCy Schubert# primary: 2001:500:12::d0d # g.root-servers.net 1245c0caa2e2SCy Schubert# primary: 2001:7fd::1 # k.root-servers.net 1246c0caa2e2SCy Schubert# primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org 1247c0caa2e2SCy Schubert# primary: 2620:0:2d0:202::132 # xfr.lax.dns.icann.org 1248e86b9096SDag-Erling Smørgrav# fallback-enabled: yes 124957bddd21SDag-Erling Smørgrav# for-downstream: no 125057bddd21SDag-Erling Smørgrav# for-upstream: yes 125157bddd21SDag-Erling Smørgrav# auth-zone: 125257bddd21SDag-Erling Smørgrav# name: "example.org" 125357bddd21SDag-Erling Smørgrav# for-downstream: yes 125457bddd21SDag-Erling Smørgrav# for-upstream: yes 12555469a995SCy Schubert# zonemd-check: no 12565469a995SCy Schubert# zonemd-reject-absence: no 125757bddd21SDag-Erling Smørgrav# zonefile: "example.org.zone" 125857bddd21SDag-Erling Smørgrav 1259bc892140SDag-Erling Smørgrav# Views 1260bc892140SDag-Erling Smørgrav# Create named views. Name must be unique. Map views to requests using 1261bc892140SDag-Erling Smørgrav# the access-control-view option. Views can contain zero or more local-zone 1262bc892140SDag-Erling Smørgrav# and local-data options. Options from matching views will override global 1263bc892140SDag-Erling Smørgrav# options. Global options will be used if no matching view is found. 1264bc892140SDag-Erling Smørgrav# With view-first yes, it will try to answer using the global local-zone and 1265bc892140SDag-Erling Smørgrav# local-data elements if there is no view specific match. 1266bc892140SDag-Erling Smørgrav# view: 1267bc892140SDag-Erling Smørgrav# name: "viewname" 1268bc892140SDag-Erling Smørgrav# local-zone: "example.com" redirect 1269bc892140SDag-Erling Smørgrav# local-data: "example.com A 192.0.2.3" 127065b390aaSDag-Erling Smørgrav# local-data-ptr: "192.0.2.3 www.example.com" 1271bc892140SDag-Erling Smørgrav# view-first: no 1272bc892140SDag-Erling Smørgrav# view: 1273bc892140SDag-Erling Smørgrav# name: "anotherview" 1274bc892140SDag-Erling Smørgrav# local-zone: "example.com" refuse 127565b390aaSDag-Erling Smørgrav 127665b390aaSDag-Erling Smørgrav# DNSCrypt 12779cf5bc93SCy Schubert# To enable, use --enable-dnscrypt to configure before compiling. 127865b390aaSDag-Erling Smørgrav# Caveats: 12799cf5bc93SCy Schubert# 1. the keys/certs cannot be produced by Unbound. You can use dnscrypt-wrapper 128065b390aaSDag-Erling Smørgrav# for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage 128165b390aaSDag-Erling Smørgrav# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to 128265b390aaSDag-Erling Smørgrav# listen on `dnscrypt-port` with the follo0wing snippet: 128365b390aaSDag-Erling Smørgrav# server: 128465b390aaSDag-Erling Smørgrav# interface: 0.0.0.0@443 128565b390aaSDag-Erling Smørgrav# interface: ::0@443 128665b390aaSDag-Erling Smørgrav# 128765b390aaSDag-Erling Smørgrav# Finally, `dnscrypt` config has its own section. 128865b390aaSDag-Erling Smørgrav# dnscrypt: 128965b390aaSDag-Erling Smørgrav# dnscrypt-enable: yes 129065b390aaSDag-Erling Smørgrav# dnscrypt-port: 443 129165b390aaSDag-Erling Smørgrav# dnscrypt-provider: 2.dnscrypt-cert.example.com. 129265b390aaSDag-Erling Smørgrav# dnscrypt-secret-key: /path/unbound-conf/keys1/1.key 129365b390aaSDag-Erling Smørgrav# dnscrypt-secret-key: /path/unbound-conf/keys2/1.key 129465b390aaSDag-Erling Smørgrav# dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert 129565b390aaSDag-Erling Smørgrav# dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert 1296971980c3SDag-Erling Smørgrav 1297971980c3SDag-Erling Smørgrav# CacheDB 12989cf5bc93SCy Schubert# External backend DB as auxiliary cache. 12999cf5bc93SCy Schubert# To enable, use --enable-cachedb to configure before compiling. 13009cf5bc93SCy Schubert# Specify the backend name 1301971980c3SDag-Erling Smørgrav# (default is "testframe", which has no use other than for debugging and 1302971980c3SDag-Erling Smørgrav# testing) and backend-specific options. The 'cachedb' module must be 1303e86b9096SDag-Erling Smørgrav# included in module-config, just before the iterator module. 1304971980c3SDag-Erling Smørgrav# cachedb: 1305971980c3SDag-Erling Smørgrav# backend: "testframe" 1306971980c3SDag-Erling Smørgrav# # secret seed string to calculate hashed keys 1307971980c3SDag-Erling Smørgrav# secret-seed: "default" 1308103ba509SCy Schubert# # if the backend should be read from, but not written to. 1309103ba509SCy Schubert# cachedb-no-store: no 1310335c7cdaSCy Schubert# # if the cachedb should be checked before a serve-expired response is 1311335c7cdaSCy Schubert# # given, when serve-expired is enabled. 1312335c7cdaSCy Schubert# cachedb-check-when-serve-expired: yes 13130fb34990SDag-Erling Smørgrav# 13140fb34990SDag-Erling Smørgrav# # For "redis" backend: 13159cf5bc93SCy Schubert# # (to enable, use --with-libhiredis to configure before compiling) 13160fb34990SDag-Erling Smørgrav# # redis server's IP address or host name 13170fb34990SDag-Erling Smørgrav# redis-server-host: 127.0.0.1 13180fb34990SDag-Erling Smørgrav# # redis server's TCP port 13190fb34990SDag-Erling Smørgrav# redis-server-port: 6379 13208f76bb7dSCy Schubert# # if the server uses a unix socket, set its path, or "" when not used. 1321*be771a7bSCy Schubert# redis-server-path: "/var/lib/redis/redis-server.sock" 13228f76bb7dSCy Schubert# # if the server uses an AUTH password, specify here, or "" when not used. 1323*be771a7bSCy Schubert# redis-server-password: "" 13240fb34990SDag-Erling Smørgrav# # timeout (in ms) for communication with the redis server 13250fb34990SDag-Erling Smørgrav# redis-timeout: 100 132646d2f618SCy Schubert# # timeout (in ms) for commands, if 0, uses redis-timeout. 132746d2f618SCy Schubert# redis-command-timeout: 0 132846d2f618SCy Schubert# # timeout (in ms) for connection set up, if 0, uses redis-timeout. 132946d2f618SCy Schubert# redis-connect-timeout: 0 133025039b37SCy Schubert# # set timeout on redis records based on DNS response TTL 133125039b37SCy Schubert# redis-expire-records: no 1332103ba509SCy Schubert# # redis logical database to use, 0 is the default database. 1333103ba509SCy Schubert# redis-logical-db: 0 1334*be771a7bSCy Schubert# # redis replica server's IP address or host name 1335*be771a7bSCy Schubert# redis-replica-server-host: 127.0.0.1 1336*be771a7bSCy Schubert# # redis replica server's TCP port 1337*be771a7bSCy Schubert# redis-replica-server-port: 6379 1338*be771a7bSCy Schubert# # if the replica server uses a unix socket, set its path, or "" when not used. 1339*be771a7bSCy Schubert# redis-replica-server-path: "/var/lib/redis/redis-server.sock" 1340*be771a7bSCy Schubert# # if the replica server uses an AUTH password, specify here, or "" when not used. 1341*be771a7bSCy Schubert# redis-replica-server-password: "" 1342*be771a7bSCy Schubert# # timeout (in ms) for communication with the redis replica server 1343*be771a7bSCy Schubert# redis-replica-timeout: 100 1344*be771a7bSCy Schubert# # timeout (in ms) for redis replica commands, if 0, uses redis-replica-timeout. 1345*be771a7bSCy Schubert# redis-replica-command-timeout: 0 1346*be771a7bSCy Schubert# # timeout (in ms) for redis replica connection set up, if 0, uses redis-replica-timeout. 1347*be771a7bSCy Schubert# redis-replica-connect-timeout: 0 1348*be771a7bSCy Schubert# # redis logical database to use for the replica server, 0 is the default database. 1349*be771a7bSCy Schubert# redis-replica-logical-db: 0 13500eefd307SCy Schubert 13510eefd307SCy Schubert# IPSet 13520eefd307SCy Schubert# Add specify domain into set via ipset. 13539cf5bc93SCy Schubert# To enable: 13549cf5bc93SCy Schubert# o use --enable-ipset to configure before compiling; 13559cf5bc93SCy Schubert# o Unbound then needs to run as root user. 13560eefd307SCy Schubert# ipset: 13570eefd307SCy Schubert# # set name for ip v4 addresses 13580eefd307SCy Schubert# name-v4: "list-v4" 13590eefd307SCy Schubert# # set name for ip v6 addresses 13600eefd307SCy Schubert# name-v6: "list-v6" 13610eefd307SCy Schubert# 13620eefd307SCy Schubert 13639cf5bc93SCy Schubert# Dnstap logging support, if compiled in by using --enable-dnstap to configure. 13649cf5bc93SCy Schubert# To enable, set the dnstap-enable to yes and also some of 13659cf5bc93SCy Schubert# dnstap-log-..-messages to yes. And select an upstream log destination, by 13669cf5bc93SCy Schubert# socket path, TCP or TLS destination. 136725039b37SCy Schubert# dnstap: 136825039b37SCy Schubert# dnstap-enable: no 136925039b37SCy Schubert# # if set to yes frame streams will be used in bidirectional mode 137025039b37SCy Schubert# dnstap-bidirectional: yes 137125039b37SCy Schubert# dnstap-socket-path: "@DNSTAP_SOCKET_PATH@" 137225039b37SCy Schubert# # if "" use the unix socket in dnstap-socket-path, otherwise, 137325039b37SCy Schubert# # set it to "IPaddress[@port]" of the destination. 137425039b37SCy Schubert# dnstap-ip: "" 137525039b37SCy Schubert# # if set to yes if you want to use TLS to dnstap-ip, no for TCP. 137625039b37SCy Schubert# dnstap-tls: yes 137725039b37SCy Schubert# # name for authenticating the upstream server. or "" disabled. 137825039b37SCy Schubert# dnstap-tls-server-name: "" 13799cf5bc93SCy Schubert# # if "", it uses the cert bundle from the main Unbound config. 138025039b37SCy Schubert# dnstap-tls-cert-bundle: "" 138125039b37SCy Schubert# # key file for client authentication, or "" disabled. 138225039b37SCy Schubert# dnstap-tls-client-key-file: "" 138325039b37SCy Schubert# # cert file for client authentication, or "" disabled. 138425039b37SCy Schubert# dnstap-tls-client-cert-file: "" 138525039b37SCy Schubert# dnstap-send-identity: no 138625039b37SCy Schubert# dnstap-send-version: no 138725039b37SCy Schubert# # if "" it uses the hostname. 138825039b37SCy Schubert# dnstap-identity: "" 138925039b37SCy Schubert# # if "" it uses the package version. 139025039b37SCy Schubert# dnstap-version: "" 139156850988SCy Schubert# # log only 1/N messages, if 0 it is disabled. default 0. 139256850988SCy Schubert# dnstap-sample-rate: 0 139325039b37SCy Schubert# dnstap-log-resolver-query-messages: no 139425039b37SCy Schubert# dnstap-log-resolver-response-messages: no 139525039b37SCy Schubert# dnstap-log-client-query-messages: no 139625039b37SCy Schubert# dnstap-log-client-response-messages: no 139725039b37SCy Schubert# dnstap-log-forwarder-query-messages: no 139825039b37SCy Schubert# dnstap-log-forwarder-response-messages: no 139925039b37SCy Schubert 1400091e9e46SCy Schubert# Response Policy Zones 140156850988SCy Schubert# RPZ policies. Applied in order of configuration. Any match from an earlier 140256850988SCy Schubert# RPZ zone will terminate the RPZ lookup. QNAME, Response IP 140324e36522SCy Schubert# Address, nsdname, nsip and clientip triggers are supported. Supported 140424e36522SCy Schubert# actions are: NXDOMAIN, NODATA, PASSTHRU, DROP, Local Data, tcp-only 140524e36522SCy Schubert# and drop. Policies can be loaded from a file, or using zone 140624e36522SCy Schubert# transfer, or using HTTP. The respip module needs to be added 1407091e9e46SCy Schubert# to the module-config, e.g.: module-config: "respip validator iterator". 1408091e9e46SCy Schubert# rpz: 1409091e9e46SCy Schubert# name: "rpz.example.com" 1410091e9e46SCy Schubert# zonefile: "rpz.example.com" 1411c0caa2e2SCy Schubert# primary: 192.0.2.0 1412091e9e46SCy Schubert# allow-notify: 192.0.2.0/32 1413091e9e46SCy Schubert# url: http://www.example.com/rpz.example.org.zone 1414091e9e46SCy Schubert# rpz-action-override: cname 1415091e9e46SCy Schubert# rpz-cname-override: www.example.org 1416091e9e46SCy Schubert# rpz-log: yes 1417091e9e46SCy Schubert# rpz-log-name: "example policy" 14189cf5bc93SCy Schubert# rpz-signal-nxdomain-ra: no 14199cf5bc93SCy Schubert# for-downstream: no 1420091e9e46SCy Schubert# tags: "example" 1421