1933707f3Ssthen# 2933707f3Ssthen# Example configuration file. 3933707f3Ssthen# 4*bdcafcd9Ssthen# See unbound.conf(5) man page, version 1.21.1. 5933707f3Ssthen# 6933707f3Ssthen# this is a comment. 7933707f3Ssthen 8a3167c07Ssthen# Use this anywhere in the file to include other text into this file. 9933707f3Ssthen#include: "otherfile.conf" 10933707f3Ssthen 11a3167c07Ssthen# Use this anywhere in the file to include other text, that explicitly starts a 12a3167c07Ssthen# clause, into this file. Text after this directive needs to start a clause. 13a3167c07Ssthen#include-toplevel: "otherfile.conf" 14a3167c07Ssthen 15933707f3Ssthen# The server clause sets the main parameters. 16933707f3Ssthenserver: 17933707f3Ssthen # whitespace is not necessary, but looks cleaner. 18933707f3Ssthen 19933707f3Ssthen # verbosity number, 0 is least verbose. 1 is default. 2045872187Ssthen # verbosity: 1 21933707f3Ssthen 22933707f3Ssthen # print statistics to the log (for every thread) every N seconds. 23933707f3Ssthen # Set to "" or 0 to disable. Default is disabled. 24933707f3Ssthen # statistics-interval: 0 25933707f3Ssthen 262be9e038Ssthen # enable shm for stats, default no. if you enable also enable 272be9e038Ssthen # statistics-interval, every time it also writes stats to the 282be9e038Ssthen # shared memory segment keyed with shm-key. 292be9e038Ssthen # shm-enable: no 302be9e038Ssthen 312be9e038Ssthen # shm for stats uses this key, and key+1 for the shared mem segment. 322be9e038Ssthen # shm-key: 11777 332be9e038Ssthen 34933707f3Ssthen # enable cumulative statistics, without clearing them after printing. 35933707f3Ssthen # statistics-cumulative: no 36933707f3Ssthen 37933707f3Ssthen # enable extended statistics (query types, answer codes, status) 388b7325afSsthen # printed from unbound-control. Default off, because of speed. 39933707f3Ssthen # extended-statistics: no 40933707f3Ssthen 418b7325afSsthen # Inhibits selected extended statistics (qtype, qclass, qopcode, rcode, 428b7325afSsthen # rpz-actions) from printing if their value is 0. 438b7325afSsthen # Default on. 448b7325afSsthen # statistics-inhibit-zero: yes 458b7325afSsthen 46933707f3Ssthen # number of threads to create. 1 disables threading. 47933707f3Ssthen # num-threads: 1 48933707f3Ssthen 49933707f3Ssthen # specify the interfaces to answer queries from by ip-address. 50933707f3Ssthen # The default is to listen to localhost (127.0.0.1 and ::1). 51933707f3Ssthen # specify 0.0.0.0 and ::0 to bind to all available interfaces. 52933707f3Ssthen # specify every interface[@port] on a new 'interface:' labelled line. 53933707f3Ssthen # The listen interfaces are not changed on reload, only on restart. 54933707f3Ssthen # interface: 192.0.2.153 55933707f3Ssthen # interface: 192.0.2.154 56933707f3Ssthen # interface: 192.0.2.154@5003 57933707f3Ssthen # interface: 2001:DB8::5 5845872187Ssthen # interface: eth0@5003 59933707f3Ssthen 60933707f3Ssthen # enable this feature to copy the source address of queries to reply. 61933707f3Ssthen # Socket options are not supported on all platforms. experimental. 62933707f3Ssthen # interface-automatic: no 63933707f3Ssthen 640bdb4f62Ssthen # instead of the default port, open additional ports separated by 650bdb4f62Ssthen # spaces when interface-automatic is enabled, by listing them here. 660bdb4f62Ssthen # interface-automatic-ports: "" 670bdb4f62Ssthen 68933707f3Ssthen # port to answer queries from 69933707f3Ssthen # port: 53 70933707f3Ssthen 71933707f3Ssthen # specify the interfaces to send outgoing queries to authoritative 72933707f3Ssthen # server from by ip-address. If none, the default (all) interface 73933707f3Ssthen # is used. Specify every interface on a 'outgoing-interface:' line. 74933707f3Ssthen # outgoing-interface: 192.0.2.153 75933707f3Ssthen # outgoing-interface: 2001:DB8::5 76933707f3Ssthen # outgoing-interface: 2001:DB8::6 77933707f3Ssthen 7877079be7Ssthen # Specify a netblock to use remainder 64 bits as random bits for 7977079be7Ssthen # upstream queries. Uses freebind option (Linux). 8077079be7Ssthen # outgoing-interface: 2001:DB8::/64 8177079be7Ssthen # Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo 8277079be7Ssthen # And: ip -6 route add local 2001:db8::/64 dev lo 8377079be7Ssthen # And set prefer-ip6: yes to use the ip6 randomness from a netblock. 8477079be7Ssthen # Set this to yes to prefer ipv6 upstream servers over ipv4. 8577079be7Ssthen # prefer-ip6: no 8677079be7Ssthen 87a3167c07Ssthen # Prefer ipv4 upstream servers, even if ipv6 is available. 88a3167c07Ssthen # prefer-ip4: no 89a3167c07Ssthen 90933707f3Ssthen # number of ports to allocate per thread, determines the size of the 91933707f3Ssthen # port range that can be open simultaneously. About double the 92933707f3Ssthen # num-queries-per-thread, or, use as many as the OS will allow you. 93933707f3Ssthen # outgoing-range: 4096 94933707f3Ssthen 95e21c60efSsthen # permit Unbound to use this port number or port range for 96933707f3Ssthen # making outgoing queries, using an outgoing interface. 97933707f3Ssthen # outgoing-port-permit: 32768 98933707f3Ssthen 99e21c60efSsthen # deny Unbound the use this of port number or port range for 100933707f3Ssthen # making outgoing queries, using an outgoing interface. 101e21c60efSsthen # Use this to make sure Unbound does not grab a UDP port that some 102933707f3Ssthen # other server on this computer needs. The default is to avoid 103933707f3Ssthen # IANA-assigned port numbers. 104229e174cSsthen # If multiple outgoing-port-permit and outgoing-port-avoid options 105229e174cSsthen # are present, they are processed in order. 106933707f3Ssthen # outgoing-port-avoid: "3200-3208" 107933707f3Ssthen 108933707f3Ssthen # number of outgoing simultaneous tcp buffers to hold per thread. 109933707f3Ssthen # outgoing-num-tcp: 10 110933707f3Ssthen 111933707f3Ssthen # number of incoming simultaneous tcp buffers to hold per thread. 112933707f3Ssthen # incoming-num-tcp: 10 113933707f3Ssthen 114933707f3Ssthen # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). 115933707f3Ssthen # 0 is system default. Use 4m to catch query spikes for busy servers. 116933707f3Ssthen # so-rcvbuf: 0 117933707f3Ssthen 118933707f3Ssthen # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option). 119933707f3Ssthen # 0 is system default. Use 4m to handle spikes on very busy servers. 120933707f3Ssthen # so-sndbuf: 0 121933707f3Ssthen 12298f3ca02Sbrad # use SO_REUSEPORT to distribute queries over threads. 123550cf4a9Ssthen # at extreme load it could be better to turn it off to distribute even. 1242308e98cSsthen # so-reuseport: yes 1255d76a658Ssthen 126a58bff56Ssthen # use IP_TRANSPARENT so the interface: addresses can be non-local 127a58bff56Ssthen # and you can config non-existing IPs that are going to work later on 12832e31f52Ssthen # (uses IP_BINDANY on FreeBSD). 129a58bff56Ssthen # ip-transparent: no 130a58bff56Ssthen 1312ee382b6Ssthen # use IP_FREEBIND so the interface: addresses can be non-local 1322ee382b6Ssthen # and you can bind to nonexisting IPs and interfaces that are down. 1332ee382b6Ssthen # Linux only. On Linux you also have ip-transparent that is similar. 1342ee382b6Ssthen # ip-freebind: no 1352ee382b6Ssthen 136a3167c07Ssthen # the value of the Differentiated Services Codepoint (DSCP) 137a3167c07Ssthen # in the differentiated services field (DS) of the outgoing 138a3167c07Ssthen # IP packets 139a3167c07Ssthen # ip-dscp: 0 140a3167c07Ssthen 141933707f3Ssthen # EDNS reassembly buffer to advertise to UDP peers (the actual buffer 1422c144df0Ssthen # is set with msg-buffer-size). 1432c144df0Ssthen # edns-buffer-size: 1232 144933707f3Ssthen 145229e174cSsthen # Maximum UDP response size (not applied to TCP response). 1468b7325afSsthen # Suggested values are 512 to 4096. Default is 1232. 65536 disables it. 1478b7325afSsthen # max-udp-size: 1232 148229e174cSsthen 149f6b99bafSsthen # max memory to use for stream(tcp and tls) waiting result buffers. 150f6b99bafSsthen # stream-wait-size: 4m 151f6b99bafSsthen 152933707f3Ssthen # buffer size for handling DNS data. No messages larger than this 153933707f3Ssthen # size can be sent or received, by UDP or TCP. In bytes. 154933707f3Ssthen # msg-buffer-size: 65552 155933707f3Ssthen 156933707f3Ssthen # the amount of memory to use for the message cache. 157933707f3Ssthen # plain value in bytes or you can append k, m or G. default is "4Mb". 158933707f3Ssthen # msg-cache-size: 4m 159933707f3Ssthen 160933707f3Ssthen # the number of slabs to use for the message cache. 161933707f3Ssthen # the number of slabs must be a power of 2. 162933707f3Ssthen # more slabs reduce lock contention, but fragment memory usage. 163933707f3Ssthen # msg-cache-slabs: 4 164933707f3Ssthen 165933707f3Ssthen # the number of queries that a thread gets to service. 166933707f3Ssthen # num-queries-per-thread: 1024 167933707f3Ssthen 168933707f3Ssthen # if very busy, 50% queries run to completion, 50% get timeout in msec 169933707f3Ssthen # jostle-timeout: 200 170933707f3Ssthen 1715d76a658Ssthen # msec to wait before close of port on timeout UDP. 0 disables. 1725d76a658Ssthen # delay-close: 0 1735d76a658Ssthen 174eba819a2Ssthen # perform connect for UDP sockets to mitigate ICMP side channel. 175eba819a2Ssthen # udp-connect: yes 176eba819a2Ssthen 177d1e2768aSsthen # The number of retries, per upstream nameserver in a delegation, when 178d1e2768aSsthen # a throwaway response (also timeouts) is received. 179e21c60efSsthen # outbound-msg-retry: 5 180e21c60efSsthen 1818b7325afSsthen # Hard limit on the number of outgoing queries Unbound will make while 1828b7325afSsthen # resolving a name, making sure large NS sets do not loop. 1838b7325afSsthen # It resets on query restarts (e.g., CNAME) and referrals. 1848b7325afSsthen # max-sent-count: 32 1858b7325afSsthen 1868b7325afSsthen # Hard limit on the number of times Unbound is allowed to restart a 1878b7325afSsthen # query upon encountering a CNAME record. 1888b7325afSsthen # max-query-restarts: 11 1898b7325afSsthen 1903150e5f6Ssthen # msec for waiting for an unknown server to reply. Increase if you 1913150e5f6Ssthen # are behind a slow satellite link, to eg. 1128. 1923150e5f6Ssthen # unknown-server-time-limit: 376 1933150e5f6Ssthen 1942bdc0ed1Ssthen # msec before recursion replies are dropped. The work item continues. 1952bdc0ed1Ssthen # discard-timeout: 1900 1962bdc0ed1Ssthen 1972bdc0ed1Ssthen # Max number of replies waiting for recursion per IP address. 1982bdc0ed1Ssthen # wait-limit: 1000 1992bdc0ed1Ssthen 2002bdc0ed1Ssthen # Max replies waiting for recursion for IP address with cookie. 2012bdc0ed1Ssthen # wait-limit-cookie: 10000 2022bdc0ed1Ssthen 2032bdc0ed1Ssthen # Apart from the default, the wait limit can be set for a netblock. 2042bdc0ed1Ssthen # wait-limit-netblock: 192.0.2.0/24 50000 2052bdc0ed1Ssthen 2062bdc0ed1Ssthen # Apart from the default, the wait limit with cookie can be adjusted. 2072bdc0ed1Ssthen # wait-limit-cookie-netblock: 192.0.2.0/24 50000 2082bdc0ed1Ssthen 209933707f3Ssthen # the amount of memory to use for the RRset cache. 210933707f3Ssthen # plain value in bytes or you can append k, m or G. default is "4Mb". 211933707f3Ssthen # rrset-cache-size: 4m 212933707f3Ssthen 213933707f3Ssthen # the number of slabs to use for the RRset cache. 214933707f3Ssthen # the number of slabs must be a power of 2. 215933707f3Ssthen # more slabs reduce lock contention, but fragment memory usage. 216933707f3Ssthen # rrset-cache-slabs: 4 217933707f3Ssthen 218933707f3Ssthen # the time to live (TTL) value lower bound, in seconds. Default 0. 219933707f3Ssthen # If more than an hour could easily give trouble due to stale data. 220933707f3Ssthen # cache-min-ttl: 0 221933707f3Ssthen 222933707f3Ssthen # the time to live (TTL) value cap for RRsets and messages in the 223933707f3Ssthen # cache. Items are not cached for longer. In seconds. 224933707f3Ssthen # cache-max-ttl: 86400 225933707f3Ssthen 226a58bff56Ssthen # the time to live (TTL) value cap for negative responses in the cache 227a58bff56Ssthen # cache-max-negative-ttl: 3600 228a58bff56Ssthen 2292bdc0ed1Ssthen # the time to live (TTL) value lower bound, in seconds. Default 0. 2302bdc0ed1Ssthen # For negative responses in the cache. If disabled, default, 23198bc733bSsthen # cache-min-ttl applies if configured. 2322bdc0ed1Ssthen # cache-min-negative-ttl: 0 2332bdc0ed1Ssthen 234933707f3Ssthen # the time to live (TTL) value for cached roundtrip times, lameness and 235933707f3Ssthen # EDNS version information for hosts. In seconds. 236933707f3Ssthen # infra-host-ttl: 900 237933707f3Ssthen 238b2cdf21fSsthen # minimum wait time for responses, increase if uplink is long. In msec. 239b2cdf21fSsthen # infra-cache-min-rtt: 50 240b2cdf21fSsthen 241d1e2768aSsthen # maximum wait time for responses. In msec. 242d1e2768aSsthen # infra-cache-max-rtt: 120000 243d1e2768aSsthen 244eba819a2Ssthen # enable to make server probe down hosts more frequently. 245eba819a2Ssthen # infra-keep-probing: no 246eba819a2Ssthen 247933707f3Ssthen # the number of slabs to use for the Infrastructure cache. 248933707f3Ssthen # the number of slabs must be a power of 2. 249933707f3Ssthen # more slabs reduce lock contention, but fragment memory usage. 250933707f3Ssthen # infra-cache-slabs: 4 251933707f3Ssthen 252933707f3Ssthen # the maximum number of hosts that are cached (roundtrip, EDNS, lame). 253933707f3Ssthen # infra-cache-numhosts: 10000 254933707f3Ssthen 25545872187Ssthen # define a number of tags here, use with local-zone, access-control, 25645872187Ssthen # interface-*. 25777079be7Ssthen # repeat the define-tag statement to add additional tags. 25877079be7Ssthen # define-tag: "tag1 tag2 tag3" 25977079be7Ssthen 260933707f3Ssthen # Enable IPv4, "yes" or "no". 261933707f3Ssthen # do-ip4: yes 262933707f3Ssthen 263933707f3Ssthen # Enable IPv6, "yes" or "no". 264933707f3Ssthen # do-ip6: yes 265933707f3Ssthen 2668b7325afSsthen # If running unbound on an IPv6-only host, domains that only have 2678b7325afSsthen # IPv4 servers would become unresolveable. If NAT64 is available in 2688b7325afSsthen # the network, unbound can use NAT64 to reach these servers with 2698b7325afSsthen # the following option. This is NOT needed for enabling DNS64 on a 2708b7325afSsthen # system that has IPv4 connectivity. 2718b7325afSsthen # Consider also enabling prefer-ip6 to prefer native IPv6 connections 2728b7325afSsthen # to nameservers. 2738b7325afSsthen # do-nat64: no 2748b7325afSsthen 2758b7325afSsthen # NAT64 prefix. Defaults to using dns64-prefix value. 2768b7325afSsthen # nat64-prefix: 64:ff9b::0/96 2778b7325afSsthen 278933707f3Ssthen # Enable UDP, "yes" or "no". 279933707f3Ssthen # do-udp: yes 280933707f3Ssthen 281933707f3Ssthen # Enable TCP, "yes" or "no". 282933707f3Ssthen # do-tcp: yes 283933707f3Ssthen 284933707f3Ssthen # upstream connections use TCP only (and no UDP), "yes" or "no" 285933707f3Ssthen # useful for tunneling scenarios, default no. 286933707f3Ssthen # tcp-upstream: no 287933707f3Ssthen 288bdfc4d55Sflorian # upstream connections also use UDP (even if do-udp is no). 289bdfc4d55Sflorian # useful if if you want UDP upstream, but don't provide UDP downstream. 290bdfc4d55Sflorian # udp-upstream-without-downstream: no 291bdfc4d55Sflorian 29232e31f52Ssthen # Maximum segment size (MSS) of TCP socket on which the server 29332e31f52Ssthen # responds to queries. Default is 0, system default MSS. 29432e31f52Ssthen # tcp-mss: 0 29532e31f52Ssthen 29632e31f52Ssthen # Maximum segment size (MSS) of TCP socket for outgoing queries. 29732e31f52Ssthen # Default is 0, system default MSS. 29832e31f52Ssthen # outgoing-tcp-mss: 0 29932e31f52Ssthen 3002308e98cSsthen # Idle TCP timeout, connection closed in milliseconds 3012308e98cSsthen # tcp-idle-timeout: 30000 3022308e98cSsthen 3032308e98cSsthen # Enable EDNS TCP keepalive option. 3042308e98cSsthen # edns-tcp-keepalive: no 3052308e98cSsthen 3062bdc0ed1Ssthen # Timeout for EDNS TCP keepalive, in msec. Overrides tcp-idle-timeout 3072bdc0ed1Ssthen # if edns-tcp-keepalive is set. 3082308e98cSsthen # edns-tcp-keepalive-timeout: 120000 3092308e98cSsthen 3108b7325afSsthen # UDP queries that have waited in the socket buffer for a long time 3118b7325afSsthen # can be dropped. Default is 0, disabled. In seconds, such as 3. 3128b7325afSsthen # sock-queue-timeout: 0 3138b7325afSsthen 31477079be7Ssthen # Use systemd socket activation for UDP, TCP, and control sockets. 31577079be7Ssthen # use-systemd: no 31677079be7Ssthen 317933707f3Ssthen # Detach from the terminal, run in background, "yes" or "no". 318e21c60efSsthen # Set the value to "no" when Unbound runs as systemd service. 319933707f3Ssthen # do-daemonize: yes 320933707f3Ssthen 321933707f3Ssthen # control which clients are allowed to make (recursive) queries 322933707f3Ssthen # to this server. Specify classless netblocks with /size and action. 323933707f3Ssthen # By default everything is refused, except for localhost. 324933707f3Ssthen # Choose deny (drop message), refuse (polite error reply), 32520237c55Ssthen # allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on), 32620237c55Ssthen # allow_snoop (recursive and nonrecursive ok) 327f46c52bfSsthen # allow_cookie (allow UDP with valid cookie or stateful transport) 3285d76a658Ssthen # deny_non_local (drop queries unless can be answered from local-data) 3295d76a658Ssthen # refuse_non_local (like deny_non_local but polite error reply). 330933707f3Ssthen # access-control: 127.0.0.0/8 allow 331933707f3Ssthen # access-control: ::1 allow 332933707f3Ssthen # access-control: ::ffff:127.0.0.1 allow 333933707f3Ssthen 33477079be7Ssthen # tag access-control with list of tags (in "" with spaces between) 33577079be7Ssthen # Clients using this access control element use localzones that 33677079be7Ssthen # are tagged with one of these tags. 33777079be7Ssthen # access-control-tag: 192.0.2.0/24 "tag2 tag3" 33877079be7Ssthen 33945872187Ssthen # set action for particular tag for given access control element. 34077079be7Ssthen # if you have multiple tag values, the tag used to lookup the action 34177079be7Ssthen # is the first tag match between access-control-tag and local-zone-tag 34277079be7Ssthen # where "first" comes from the order of the define-tag values. 34377079be7Ssthen # access-control-tag-action: 192.0.2.0/24 tag3 refuse 34477079be7Ssthen 34577079be7Ssthen # set redirect data for particular tag for access control element 34677079be7Ssthen # access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1" 34777079be7Ssthen 34877079be7Ssthen # Set view for access control element 34977079be7Ssthen # access-control-view: 192.0.2.0/24 viewname 35077079be7Ssthen 35145872187Ssthen # Similar to 'access-control:' but for interfaces. 35245872187Ssthen # Control which listening interfaces are allowed to accept (recursive) 35345872187Ssthen # queries for this server. 35445872187Ssthen # The specified interfaces should be the same as the ones specified in 35545872187Ssthen # 'interface:' followed by the action. 35645872187Ssthen # The actions are the same as 'access-control:' above. 35745872187Ssthen # By default all the interfaces configured are refused. 35845872187Ssthen # Note: any 'access-control*:' setting overrides all 'interface-*:' 35945872187Ssthen # settings for targeted clients. 36045872187Ssthen # interface-action: 192.0.2.153 allow 36145872187Ssthen # interface-action: 192.0.2.154 allow 36245872187Ssthen # interface-action: 192.0.2.154@5003 allow 36345872187Ssthen # interface-action: 2001:DB8::5 allow 36445872187Ssthen # interface-action: eth0@5003 allow 36545872187Ssthen 36645872187Ssthen # Similar to 'access-control-tag:' but for interfaces. 36745872187Ssthen # Tag interfaces with a list of tags (in "" with spaces between). 36845872187Ssthen # Interfaces using these tags use localzones that are tagged with one 36945872187Ssthen # of these tags. 37045872187Ssthen # The specified interfaces should be the same as the ones specified in 37145872187Ssthen # 'interface:' followed by the list of tags. 37245872187Ssthen # Note: any 'access-control*:' setting overrides all 'interface-*:' 37345872187Ssthen # settings for targeted clients. 37445872187Ssthen # interface-tag: eth0@5003 "tag2 tag3" 37545872187Ssthen 37645872187Ssthen # Similar to 'access-control-tag-action:' but for interfaces. 37745872187Ssthen # Set action for particular tag for a given interface element. 37845872187Ssthen # If you have multiple tag values, the tag used to lookup the action 37945872187Ssthen # is the first tag match between interface-tag and local-zone-tag 38045872187Ssthen # where "first" comes from the order of the define-tag values. 38145872187Ssthen # The specified interfaces should be the same as the ones specified in 38245872187Ssthen # 'interface:' followed by the tag and action. 38345872187Ssthen # Note: any 'access-control*:' setting overrides all 'interface-*:' 38445872187Ssthen # settings for targeted clients. 38545872187Ssthen # interface-tag-action: eth0@5003 tag3 refuse 38645872187Ssthen 38745872187Ssthen # Similar to 'access-control-tag-data:' but for interfaces. 38845872187Ssthen # Set redirect data for a particular tag for an interface element. 38945872187Ssthen # The specified interfaces should be the same as the ones specified in 39045872187Ssthen # 'interface:' followed by the tag and the redirect data. 39145872187Ssthen # Note: any 'access-control*:' setting overrides all 'interface-*:' 39245872187Ssthen # settings for targeted clients. 39345872187Ssthen # interface-tag-data: eth0@5003 tag2 "A 127.0.0.1" 39445872187Ssthen 39545872187Ssthen # Similar to 'access-control-view:' but for interfaces. 39645872187Ssthen # Set view for an interface element. 39745872187Ssthen # The specified interfaces should be the same as the ones specified in 39845872187Ssthen # 'interface:' followed by the view name. 39945872187Ssthen # Note: any 'access-control*:' setting overrides all 'interface-*:' 40045872187Ssthen # settings for targeted clients. 40145872187Ssthen # interface-view: eth0@5003 viewname 40245872187Ssthen 403933707f3Ssthen # if given, a chroot(2) is done to the given directory. 404933707f3Ssthen # i.e. you can chroot to the working directory, for example, 405933707f3Ssthen # for extra security, but make sure all files are in that directory. 406933707f3Ssthen # 407933707f3Ssthen # If chroot is enabled, you should pass the configfile (from the 408933707f3Ssthen # commandline) as a full path from the original root. After the 409933707f3Ssthen # chroot has been performed the now defunct portion of the config 410933707f3Ssthen # file path is removed to be able to reread the config after a reload. 411933707f3Ssthen # 412933707f3Ssthen # All other file paths (working dir, logfile, roothints, and 413933707f3Ssthen # key files) can be specified in several ways: 414933707f3Ssthen # o as an absolute path relative to the new root. 415933707f3Ssthen # o as a relative path to the working directory. 416933707f3Ssthen # o as an absolute path relative to the original root. 417933707f3Ssthen # In the last case the path is adjusted to remove the unused portion. 418933707f3Ssthen # 419933707f3Ssthen # The pid file can be absolute and outside of the chroot, it is 420933707f3Ssthen # written just prior to performing the chroot and dropping permissions. 421933707f3Ssthen # 422e21c60efSsthen # Additionally, Unbound may need to access /dev/urandom (for entropy). 423933707f3Ssthen # How to do this is specific to your OS. 424933707f3Ssthen # 425933707f3Ssthen # If you give "" no chroot is performed. The path must not end in a /. 426933707f3Ssthen # chroot: "@UNBOUND_CHROOT_DIR@" 427933707f3Ssthen 428933707f3Ssthen # if given, user privileges are dropped (after binding port), 429933707f3Ssthen # and the given username is assumed. Default is user "unbound". 430933707f3Ssthen # If you give "" no privileges are dropped. 431933707f3Ssthen # username: "@UNBOUND_USERNAME@" 432933707f3Ssthen 433933707f3Ssthen # the working directory. The relative files in this config are 434933707f3Ssthen # relative to this directory. If you give "" the working directory 435933707f3Ssthen # is not changed. 43677079be7Ssthen # If you give a server: directory: dir before include: file statements 43777079be7Ssthen # then those includes can be relative to the working directory. 438933707f3Ssthen # directory: "@UNBOUND_RUN_DIR@" 439933707f3Ssthen 440933707f3Ssthen # the log file, "" means log to stderr. 441933707f3Ssthen # Use of this option sets use-syslog to "no". 442933707f3Ssthen # logfile: "" 443933707f3Ssthen 444933707f3Ssthen # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to 44577079be7Ssthen # log to. If yes, it overrides the logfile. 446933707f3Ssthen # use-syslog: yes 447933707f3Ssthen 44877079be7Ssthen # Log identity to report. if empty, defaults to the name of argv[0] 44977079be7Ssthen # (usually "unbound"). 45077079be7Ssthen # log-identity: "" 45177079be7Ssthen 452933707f3Ssthen # print UTC timestamp in ascii to logfile, default is epoch in seconds. 453933707f3Ssthen # log-time-ascii: no 454933707f3Ssthen 455933707f3Ssthen # print one line with time, IP, name, type, class for every query. 456933707f3Ssthen # log-queries: no 457933707f3Ssthen 45877079be7Ssthen # print one line per reply, with time, IP, name, type, class, rcode, 45977079be7Ssthen # timetoresolve, fromcache and responsesize. 46077079be7Ssthen # log-replies: no 46177079be7Ssthen 462f6b99bafSsthen # log with tag 'query' and 'reply' instead of 'info' for 463f6b99bafSsthen # filtering log-queries and log-replies from the log. 464f6b99bafSsthen # log-tag-queryreply: no 465f6b99bafSsthen 466f46c52bfSsthen # log with destination address, port and type for log-replies. 467f46c52bfSsthen # log-destaddr: no 468f46c52bfSsthen 4692308e98cSsthen # log the local-zone actions, like local-zone type inform is enabled 4702308e98cSsthen # also for the other local zone types. 4712308e98cSsthen # log-local-actions: no 4722308e98cSsthen 4732308e98cSsthen # print log lines that say why queries return SERVFAIL to clients. 4742308e98cSsthen # log-servfail: no 4752308e98cSsthen 476933707f3Ssthen # the pid file. Can be an absolute path outside of chroot/work dir. 477933707f3Ssthen # pidfile: "@UNBOUND_PIDFILE@" 478933707f3Ssthen 479933707f3Ssthen # file to read root hints from. 480aeb5b486Ssthen # get one from https://www.internic.net/domain/named.cache 481933707f3Ssthen # root-hints: "" 482933707f3Ssthen 483933707f3Ssthen # enable to not answer id.server and hostname.bind queries. 484933707f3Ssthen # hide-identity: no 485933707f3Ssthen 486933707f3Ssthen # enable to not answer version.server and version.bind queries. 487933707f3Ssthen # hide-version: no 488933707f3Ssthen 4892be9e038Ssthen # enable to not answer trustanchor.unbound queries. 4902be9e038Ssthen # hide-trustanchor: no 4912be9e038Ssthen 492191f22c6Ssthen # enable to not set the User-Agent HTTP header. 493191f22c6Ssthen # hide-http-user-agent: no 494191f22c6Ssthen 495933707f3Ssthen # the identity to report. Leave "" or default to return hostname. 496933707f3Ssthen # identity: "" 497933707f3Ssthen 498933707f3Ssthen # the version to report. Leave "" or default to return package version. 499933707f3Ssthen # version: "" 500933707f3Ssthen 5019982a05dSsthen # NSID identity (hex string, or "ascii_somestring"). default disabled. 5029982a05dSsthen # nsid: "aabbccdd" 5039982a05dSsthen 504191f22c6Ssthen # User-Agent HTTP header to use. Leave "" or default to use package name 505191f22c6Ssthen # and version. 506191f22c6Ssthen # http-user-agent: "" 507191f22c6Ssthen 508933707f3Ssthen # the target fetch policy. 509933707f3Ssthen # series of integers describing the policy per dependency depth. 510933707f3Ssthen # The number of values in the list determines the maximum dependency 511933707f3Ssthen # depth the recursor will pursue before giving up. Each integer means: 512933707f3Ssthen # -1 : fetch all targets opportunistically, 513933707f3Ssthen # 0: fetch on demand, 514933707f3Ssthen # positive value: fetch that many targets opportunistically. 515933707f3Ssthen # Enclose the list of numbers between quotes (""). 516933707f3Ssthen # target-fetch-policy: "3 2 1 0 0" 517933707f3Ssthen 518933707f3Ssthen # Harden against very small EDNS buffer sizes. 5199982a05dSsthen # harden-short-bufsize: yes 520933707f3Ssthen 521933707f3Ssthen # Harden against unseemly large queries. 522933707f3Ssthen # harden-large-queries: no 523933707f3Ssthen 524933707f3Ssthen # Harden against out of zone rrsets, to avoid spoofing attempts. 525933707f3Ssthen # harden-glue: yes 526933707f3Ssthen 527933707f3Ssthen # Harden against receiving dnssec-stripped data. If you turn it 528933707f3Ssthen # off, failing to validate dnskey data for a trustanchor will 529933707f3Ssthen # trigger insecure mode for that zone (like without a trustanchor). 530933707f3Ssthen # Default on, which insists on dnssec data for trust-anchored zones. 531933707f3Ssthen # harden-dnssec-stripped: yes 532933707f3Ssthen 533933707f3Ssthen # Harden against queries that fall under dnssec-signed nxdomain names. 5342308e98cSsthen # harden-below-nxdomain: yes 535933707f3Ssthen 536933707f3Ssthen # Harden the referral path by performing additional queries for 537933707f3Ssthen # infrastructure data. Validates the replies (if possible). 538933707f3Ssthen # Default off, because the lookups burden the server. Experimental 539933707f3Ssthen # implementation of draft-wijngaards-dnsext-resolver-side-mitigation. 540933707f3Ssthen # harden-referral-path: no 541933707f3Ssthen 542a58bff56Ssthen # Harden against algorithm downgrade when multiple algorithms are 543a58bff56Ssthen # advertised in the DS record. If no, allows the weakest algorithm 544a58bff56Ssthen # to validate the zone. 545a961b961Ssthen # harden-algo-downgrade: no 546a58bff56Ssthen 5478b7325afSsthen # Harden against unknown records in the authority section and the 5488b7325afSsthen # additional section. 5498b7325afSsthen # harden-unknown-additional: no 5508b7325afSsthen 55124893edcSsthen # Sent minimum amount of information to upstream servers to enhance 55224893edcSsthen # privacy. Only sent minimum required labels of the QNAME and set QTYPE 553bdfc4d55Sflorian # to A when possible. 55420237c55Ssthen # qname-minimisation: yes 55524893edcSsthen 55677079be7Ssthen # QNAME minimisation in strict mode. Do not fall-back to sending full 55777079be7Ssthen # QNAME to potentially broken nameservers. A lot of domains will not be 55877079be7Ssthen # resolvable when this option in enabled. 55977079be7Ssthen # This option only has effect when qname-minimisation is enabled. 56077079be7Ssthen # qname-minimisation-strict: no 56177079be7Ssthen 562938a3a5eSflorian # Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN 563938a3a5eSflorian # and other denials, using information from previous NXDOMAINs answers. 564e21c60efSsthen # aggressive-nsec: yes 565938a3a5eSflorian 566933707f3Ssthen # Use 0x20-encoded random bits in the query to foil spoof attempts. 567933707f3Ssthen # This feature is an experimental implementation of draft dns-0x20. 568933707f3Ssthen # use-caps-for-id: no 569933707f3Ssthen 570a58bff56Ssthen # Domains (and domains in them) without support for dns-0x20 and 571a58bff56Ssthen # the fallback fails because they keep sending different answers. 5722c144df0Ssthen # caps-exempt: "licdn.com" 5732c144df0Ssthen # caps-exempt: "senderbase.org" 574a58bff56Ssthen 575933707f3Ssthen # Enforce privacy of these addresses. Strips them away from answers. 576933707f3Ssthen # It may cause DNSSEC validation to additionally mark it as bogus. 577933707f3Ssthen # Protects against 'DNS Rebinding' (uses browser as network proxy). 578933707f3Ssthen # Only 'private-domain' and 'local-data' names are allowed to have 579933707f3Ssthen # these private addresses. No default. 580933707f3Ssthen # private-address: 10.0.0.0/8 581933707f3Ssthen # private-address: 172.16.0.0/12 582933707f3Ssthen # private-address: 192.168.0.0/16 583933707f3Ssthen # private-address: 169.254.0.0/16 584933707f3Ssthen # private-address: fd00::/8 585933707f3Ssthen # private-address: fe80::/10 586aeb5b486Ssthen # private-address: ::ffff:0:0/96 587933707f3Ssthen 588933707f3Ssthen # Allow the domain (and its subdomains) to contain private addresses. 589933707f3Ssthen # local-data statements are allowed to contain private addresses too. 590933707f3Ssthen # private-domain: "example.com" 591933707f3Ssthen 592933707f3Ssthen # If nonzero, unwanted replies are not only reported in statistics, 593933707f3Ssthen # but also a running total is kept per thread. If it reaches the 594933707f3Ssthen # threshold, a warning is printed and a defensive action is taken, 595933707f3Ssthen # the cache is cleared to flush potential poison out of it. 596933707f3Ssthen # A suggested value is 10000000, the default is 0 (turned off). 597933707f3Ssthen # unwanted-reply-threshold: 0 598933707f3Ssthen 599933707f3Ssthen # Do not query the following addresses. No DNS queries are sent there. 600933707f3Ssthen # List one address per entry. List classless netblocks with /size, 601933707f3Ssthen # do-not-query-address: 127.0.0.1/8 602933707f3Ssthen # do-not-query-address: ::1 603933707f3Ssthen 604933707f3Ssthen # if yes, the above default do-not-query-address entries are present. 605933707f3Ssthen # if no, localhost can be queried (for testing and debugging). 606933707f3Ssthen # do-not-query-localhost: yes 607933707f3Ssthen 608933707f3Ssthen # if yes, perform prefetching of almost expired message cache entries. 609933707f3Ssthen # prefetch: no 610933707f3Ssthen 611933707f3Ssthen # if yes, perform key lookups adjacent to normal lookups. 612933707f3Ssthen # prefetch-key: no 613933707f3Ssthen 6143150e5f6Ssthen # deny queries of type ANY with an empty response. 6153150e5f6Ssthen # deny-any: no 6163150e5f6Ssthen 617d8d14d0cSsthen # if yes, Unbound rotates RRSet order in response. 618a3167c07Ssthen # rrset-roundrobin: yes 619d8d14d0cSsthen 620d8d14d0cSsthen # if yes, Unbound doesn't insert authority/additional sections 621d8d14d0cSsthen # into response messages when those sections are not required. 6222308e98cSsthen # minimal-responses: yes 623d8d14d0cSsthen 6242ee382b6Ssthen # true to disable DNSSEC lameness check in iterator. 6252ee382b6Ssthen # disable-dnssec-lame-check: no 6262ee382b6Ssthen 627933707f3Ssthen # module configuration of the server. A string with identifiers 62898f3ca02Sbrad # separated by spaces. Syntax: "[dns64] [validator] iterator" 629c3b38330Ssthen # most modules have to be listed at the beginning of the line, 630c3b38330Ssthen # except cachedb(just before iterator), and python (at the beginning, 631c3b38330Ssthen # or, just before the iterator). 632933707f3Ssthen # module-config: "validator iterator" 633933707f3Ssthen 634933707f3Ssthen # File with trusted keys, kept uptodate using RFC5011 probes, 635933707f3Ssthen # initial file like trust-anchor-file, then it stores metadata. 636933707f3Ssthen # Use several entries, one per domain name, to track multiple zones. 637933707f3Ssthen # 638933707f3Ssthen # If you want to perform DNSSEC validation, run unbound-anchor before 639e21c60efSsthen # you start Unbound (i.e. in the system boot scripts). 640191f22c6Ssthen # And then enable the auto-trust-anchor-file config item. 641933707f3Ssthen # Please note usage of unbound-anchor root anchor is at your own risk 642933707f3Ssthen # and under the terms of our LICENSE (see that file in the source). 643933707f3Ssthen # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" 644933707f3Ssthen 6452be9e038Ssthen # trust anchor signaling sends a RFC8145 key tag query after priming. 6462be9e038Ssthen # trust-anchor-signaling: no 6472be9e038Ssthen 64820237c55Ssthen # Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel) 64920237c55Ssthen # root-key-sentinel: yes 65020237c55Ssthen 651933707f3Ssthen # File with trusted keys for validation. Specify more than one file 652933707f3Ssthen # with several entries, one file per entry. 653933707f3Ssthen # Zone file format, with DS and DNSKEY entries. 654933707f3Ssthen # Note this gets out of date, use auto-trust-anchor-file please. 655933707f3Ssthen # trust-anchor-file: "" 656933707f3Ssthen 657933707f3Ssthen # Trusted key for validation. DS or DNSKEY. specify the RR on a 658933707f3Ssthen # single line, surrounded by "". TTL is ignored. class is IN default. 659933707f3Ssthen # Note this gets out of date, use auto-trust-anchor-file please. 660933707f3Ssthen # (These examples are from August 2007 and may not be valid anymore). 661933707f3Ssthen # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ==" 662933707f3Ssthen # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A" 663933707f3Ssthen 664933707f3Ssthen # File with trusted keys for validation. Specify more than one file 665933707f3Ssthen # with several entries, one file per entry. Like trust-anchor-file 666933707f3Ssthen # but has a different file format. Format is BIND-9 style format, 667933707f3Ssthen # the trusted-keys { name flag proto algo "key"; }; clauses are read. 668933707f3Ssthen # you need external update procedures to track changes in keys. 669933707f3Ssthen # trusted-keys-file: "" 670933707f3Ssthen 671933707f3Ssthen # Ignore chain of trust. Domain is treated as insecure. 672933707f3Ssthen # domain-insecure: "example.com" 673933707f3Ssthen 674933707f3Ssthen # Override the date for validation with a specific fixed date. 675933707f3Ssthen # Do not set this unless you are debugging signature inception 676933707f3Ssthen # and expiration. "" or "0" turns the feature off. -1 ignores date. 677933707f3Ssthen # val-override-date: "" 678933707f3Ssthen 679933707f3Ssthen # The time to live for bogus data, rrsets and messages. This avoids 680933707f3Ssthen # some of the revalidation, until the time interval expires. in secs. 681933707f3Ssthen # val-bogus-ttl: 60 682933707f3Ssthen 683933707f3Ssthen # The signature inception and expiration dates are allowed to be off 684933707f3Ssthen # by 10% of the signature lifetime (expir-incep) from our local clock. 685933707f3Ssthen # This leeway is capped with a minimum and a maximum. In seconds. 686933707f3Ssthen # val-sig-skew-min: 3600 687933707f3Ssthen # val-sig-skew-max: 86400 688933707f3Ssthen 689191f22c6Ssthen # The maximum number the validator should restart validation with 690191f22c6Ssthen # another authority in case of failed validation. 691191f22c6Ssthen # val-max-restart: 5 692191f22c6Ssthen 693933707f3Ssthen # Should additional section of secure message also be kept clean of 694933707f3Ssthen # unsecure data. Useful to shield the users of this validator from 695933707f3Ssthen # potential bogus data in the additional section. All unsigned data 696933707f3Ssthen # in the additional section is removed from secure messages. 697933707f3Ssthen # val-clean-additional: yes 698933707f3Ssthen 699933707f3Ssthen # Turn permissive mode on to permit bogus messages. Thus, messages 700933707f3Ssthen # for which security checks failed will be returned to clients, 701933707f3Ssthen # instead of SERVFAIL. It still performs the security checks, which 702933707f3Ssthen # result in interesting log files and possibly the AD bit in 703933707f3Ssthen # replies if the message is found secure. The default is off. 704933707f3Ssthen # val-permissive-mode: no 705933707f3Ssthen 706933707f3Ssthen # Ignore the CD flag in incoming queries and refuse them bogus data. 707e21c60efSsthen # Enable it if the only clients of Unbound are legacy servers (w2008) 708933707f3Ssthen # that set CD but cannot validate themselves. 709933707f3Ssthen # ignore-cd-flag: no 710933707f3Ssthen 711d896b962Ssthen # Disable the DO flag in outgoing requests. It is helpful for upstream 712d896b962Ssthen # devices that cannot handle DNSSEC information. But do not enable it 713d896b962Ssthen # otherwise, because it would stop DNSSEC validation. 714d896b962Ssthen # disable-edns-do: no 715d896b962Ssthen 716eaf2578eSsthen # Serve expired responses from cache, with serve-expired-reply-ttl in 717eaf2578eSsthen # the response, and then attempt to fetch the data afresh. 71877079be7Ssthen # serve-expired: no 7192308e98cSsthen # 7202308e98cSsthen # Limit serving of expired responses to configured seconds after 7212308e98cSsthen # expiration. 0 disables the limit. 7222308e98cSsthen # serve-expired-ttl: 0 7232308e98cSsthen # 7242308e98cSsthen # Set the TTL of expired records to the serve-expired-ttl value after a 7252308e98cSsthen # failed attempt to retrieve the record from upstream. This makes sure 7262308e98cSsthen # that the expired records will be served as long as there are queries 7272308e98cSsthen # for it. 7282308e98cSsthen # serve-expired-ttl-reset: no 729eaf2578eSsthen # 730eaf2578eSsthen # TTL value to use when replying with expired data. 731eaf2578eSsthen # serve-expired-reply-ttl: 30 732eaf2578eSsthen # 733eaf2578eSsthen # Time in milliseconds before replying to the client with expired data. 734eaf2578eSsthen # This essentially enables the serve-stale behavior as specified in 7352c144df0Ssthen # RFC 8767 that first tries to resolve before 736eaf2578eSsthen # immediately responding with expired data. 0 disables this behavior. 737eaf2578eSsthen # A recommended value is 1800. 738eaf2578eSsthen # serve-expired-client-timeout: 0 73977079be7Ssthen 7409982a05dSsthen # Return the original TTL as received from the upstream name server rather 7419982a05dSsthen # than the decrementing TTL as stored in the cache. Enabling this feature 742e21c60efSsthen # does not impact cache expiry, it only changes the TTL Unbound embeds in 7439982a05dSsthen # responses to queries. Note that enabling this feature implicitly disables 7449982a05dSsthen # enforcement of the configured minimum and maximum TTL. 7459982a05dSsthen # serve-original-ttl: no 7469982a05dSsthen 747933707f3Ssthen # Have the validator log failed validations for your diagnosis. 748933707f3Ssthen # 0: off. 1: A line per failed user query. 2: With reason and bad IP. 749933707f3Ssthen # val-log-level: 0 750933707f3Ssthen 751933707f3Ssthen # It is possible to configure NSEC3 maximum iteration counts per 752933707f3Ssthen # keysize. Keep this table very short, as linear search is done. 753933707f3Ssthen # A message with an NSEC3 with larger count is marked insecure. 754933707f3Ssthen # List in ascending order the keysize and count values. 755191f22c6Ssthen # val-nsec3-keysize-iterations: "1024 150 2048 150 4096 150" 756191f22c6Ssthen 757191f22c6Ssthen # if enabled, ZONEMD verification failures do not block the zone. 758191f22c6Ssthen # zonemd-permissive-mode: no 759933707f3Ssthen 760933707f3Ssthen # instruct the auto-trust-anchor-file probing to add anchors after ttl. 761933707f3Ssthen # add-holddown: 2592000 # 30 days 762933707f3Ssthen 763933707f3Ssthen # instruct the auto-trust-anchor-file probing to del anchors after ttl. 764933707f3Ssthen # del-holddown: 2592000 # 30 days 765933707f3Ssthen 766933707f3Ssthen # auto-trust-anchor-file probing removes missing anchors after ttl. 767933707f3Ssthen # If the value 0 is given, missing anchors are not removed. 768933707f3Ssthen # keep-missing: 31622400 # 366 days 769933707f3Ssthen 7702ee382b6Ssthen # debug option that allows very small holddown times for key rollover, 7712ee382b6Ssthen # otherwise the RFC mandates probe intervals must be at least 1 hour. 772a961b961Ssthen # permit-small-holddown: no 773a961b961Ssthen 774933707f3Ssthen # the amount of memory to use for the key cache. 775933707f3Ssthen # plain value in bytes or you can append k, m or G. default is "4Mb". 776933707f3Ssthen # key-cache-size: 4m 777933707f3Ssthen 778933707f3Ssthen # the number of slabs to use for the key cache. 779933707f3Ssthen # the number of slabs must be a power of 2. 780933707f3Ssthen # more slabs reduce lock contention, but fragment memory usage. 781933707f3Ssthen # key-cache-slabs: 4 782933707f3Ssthen 7832c144df0Ssthen # the amount of memory to use for the negative cache. 784933707f3Ssthen # plain value in bytes or you can append k, m or G. default is "1Mb". 785933707f3Ssthen # neg-cache-size: 1m 786933707f3Ssthen 787229e174cSsthen # By default, for a number of zones a small default 'nothing here' 788229e174cSsthen # reply is built-in. Query traffic is thus blocked. If you 789229e174cSsthen # wish to serve such zone you can unblock them by uncommenting one 790229e174cSsthen # of the nodefault statements below. 791229e174cSsthen # You may also have to use domain-insecure: zone to make DNSSEC work, 792229e174cSsthen # unless you have your own trust anchors for this zone. 793229e174cSsthen # local-zone: "localhost." nodefault 794229e174cSsthen # local-zone: "127.in-addr.arpa." nodefault 795229e174cSsthen # 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 796e21c60efSsthen # local-zone: "home.arpa." nodefault 79732e31f52Ssthen # local-zone: "onion." nodefault 7987191de28Ssthen # local-zone: "test." nodefault 7997191de28Ssthen # local-zone: "invalid." nodefault 800229e174cSsthen # local-zone: "10.in-addr.arpa." nodefault 801229e174cSsthen # local-zone: "16.172.in-addr.arpa." nodefault 802229e174cSsthen # local-zone: "17.172.in-addr.arpa." nodefault 803229e174cSsthen # local-zone: "18.172.in-addr.arpa." nodefault 804229e174cSsthen # local-zone: "19.172.in-addr.arpa." nodefault 805229e174cSsthen # local-zone: "20.172.in-addr.arpa." nodefault 806229e174cSsthen # local-zone: "21.172.in-addr.arpa." nodefault 807229e174cSsthen # local-zone: "22.172.in-addr.arpa." nodefault 808229e174cSsthen # local-zone: "23.172.in-addr.arpa." nodefault 809229e174cSsthen # local-zone: "24.172.in-addr.arpa." nodefault 810229e174cSsthen # local-zone: "25.172.in-addr.arpa." nodefault 811229e174cSsthen # local-zone: "26.172.in-addr.arpa." nodefault 812229e174cSsthen # local-zone: "27.172.in-addr.arpa." nodefault 813229e174cSsthen # local-zone: "28.172.in-addr.arpa." nodefault 814229e174cSsthen # local-zone: "29.172.in-addr.arpa." nodefault 815229e174cSsthen # local-zone: "30.172.in-addr.arpa." nodefault 816229e174cSsthen # local-zone: "31.172.in-addr.arpa." nodefault 817229e174cSsthen # local-zone: "168.192.in-addr.arpa." nodefault 818229e174cSsthen # local-zone: "0.in-addr.arpa." nodefault 819229e174cSsthen # local-zone: "254.169.in-addr.arpa." nodefault 820229e174cSsthen # local-zone: "2.0.192.in-addr.arpa." nodefault 821229e174cSsthen # local-zone: "100.51.198.in-addr.arpa." nodefault 822229e174cSsthen # local-zone: "113.0.203.in-addr.arpa." nodefault 823229e174cSsthen # local-zone: "255.255.255.255.in-addr.arpa." nodefault 824229e174cSsthen # 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 825229e174cSsthen # local-zone: "d.f.ip6.arpa." nodefault 826229e174cSsthen # local-zone: "8.e.f.ip6.arpa." nodefault 827229e174cSsthen # local-zone: "9.e.f.ip6.arpa." nodefault 828229e174cSsthen # local-zone: "a.e.f.ip6.arpa." nodefault 829229e174cSsthen # local-zone: "b.e.f.ip6.arpa." nodefault 830229e174cSsthen # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault 83198f3ca02Sbrad # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa. 83298f3ca02Sbrad 8338240c1b9Ssthen # Add example.com into ipset 8348240c1b9Ssthen # local-zone: "example.com" ipset 8358240c1b9Ssthen 836e21c60efSsthen # If Unbound is running service for the local host then it is useful 83798f3ca02Sbrad # to perform lan-wide lookups to the upstream, and unblock the 838e21c60efSsthen # long list of local-zones above. If this Unbound is a dns server 83998f3ca02Sbrad # for a network of computers, disabled is better and stops information 84098f3ca02Sbrad # leakage of local lan information. 84198f3ca02Sbrad # unblock-lan-zones: no 842229e174cSsthen 84332e31f52Ssthen # The insecure-lan-zones option disables validation for 84432e31f52Ssthen # these zones, as if they were all listed as domain-insecure. 84532e31f52Ssthen # insecure-lan-zones: no 84632e31f52Ssthen 847933707f3Ssthen # a number of locally served zones can be configured. 848933707f3Ssthen # local-zone: <zone> <type> 849933707f3Ssthen # local-data: "<resource record string>" 850933707f3Ssthen # o deny serves local data (if any), else, drops queries. 851933707f3Ssthen # o refuse serves local data (if any), else, replies with error. 852933707f3Ssthen # o static serves local data, else, nxdomain or nodata answer. 853933707f3Ssthen # o transparent gives local data, but resolves normally for other names 854933707f3Ssthen # o redirect serves the zone data for any subdomain in the zone. 855933707f3Ssthen # o nodefault can be used to normally resolve AS112 zones. 856933707f3Ssthen # o typetransparent resolves normally for other types and other names 85777079be7Ssthen # o inform acts like transparent, but logs client IP address 858a58bff56Ssthen # o inform_deny drops queries and logs client IP address 859c3b38330Ssthen # o inform_redirect redirects queries and logs client IP address 8609982a05dSsthen # o always_transparent, always_refuse, always_nxdomain, always_nodata, 8619982a05dSsthen # always_deny resolve in that way but ignore local data for 8629982a05dSsthen # that name 8638b7325afSsthen # o block_a resolves all records normally but returns 8648b7325afSsthen # NODATA for A queries and ignores local data for that name 8659982a05dSsthen # o always_null returns 0.0.0.0 or ::0 for any name in the zone. 866938a3a5eSflorian # o noview breaks out of that view towards global local-zones. 867933707f3Ssthen # 868933707f3Ssthen # defaults are localhost address, reverse for 127.0.0.1 and ::1 869933707f3Ssthen # and nxdomain for AS112 zones. If you configure one of these zones 870933707f3Ssthen # the default content is omitted, or you can omit it with 'nodefault'. 871933707f3Ssthen # 872933707f3Ssthen # If you configure local-data without specifying local-zone, by 873933707f3Ssthen # default a transparent local-zone is created for the data. 874933707f3Ssthen # 875933707f3Ssthen # You can add locally served data with 876933707f3Ssthen # local-zone: "local." static 877933707f3Ssthen # local-data: "mycomputer.local. IN A 192.0.2.51" 878933707f3Ssthen # local-data: 'mytext.local TXT "content of text record"' 879933707f3Ssthen # 880933707f3Ssthen # You can override certain queries with 881933707f3Ssthen # local-data: "adserver.example.com A 127.0.0.1" 882933707f3Ssthen # 883933707f3Ssthen # You can redirect a domain to a fixed address with 884933707f3Ssthen # (this makes example.com, www.example.com, etc, all go to 192.0.2.3) 885933707f3Ssthen # local-zone: "example.com" redirect 886933707f3Ssthen # local-data: "example.com A 192.0.2.3" 887933707f3Ssthen # 888933707f3Ssthen # Shorthand to make PTR records, "IPv4 name" or "IPv6 name". 889933707f3Ssthen # You can also add PTR records using local-data directly, but then 890933707f3Ssthen # you need to do the reverse notation yourself. 891933707f3Ssthen # local-data-ptr: "192.0.2.3 www.example.com" 892933707f3Ssthen 89377079be7Ssthen # tag a localzone with a list of tag names (in "" with spaces between) 89477079be7Ssthen # local-zone-tag: "example.com" "tag2 tag3" 89577079be7Ssthen 89677079be7Ssthen # add a netblock specific override to a localzone, with zone type 89777079be7Ssthen # local-zone-override: "example.com" 192.0.2.0/24 refuse 89877079be7Ssthen 8992c144df0Ssthen # service clients over TLS (on the TCP sockets) with plain DNS inside 9002c144df0Ssthen # the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484. 9012c144df0Ssthen # Give the certificate to use and private key. 902933707f3Ssthen # default is "" (disabled). requires restart to take effect. 903938a3a5eSflorian # tls-service-key: "path/to/privatekeyfile.key" 904938a3a5eSflorian # tls-service-pem: "path/to/publiccertfile.pem" 905938a3a5eSflorian # tls-port: 853 9062c144df0Ssthen # https-port: 443 907933707f3Ssthen 908f6b99bafSsthen # cipher setting for TLSv1.2 909f6b99bafSsthen # 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" 910f6b99bafSsthen # cipher setting for TLSv1.3 911f6b99bafSsthen # 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" 912f6b99bafSsthen 9139982a05dSsthen # Pad responses to padded queries received over TLS 9149982a05dSsthen # pad-responses: yes 9159982a05dSsthen 9169982a05dSsthen # Padded responses will be padded to the closest multiple of this size. 9179982a05dSsthen # pad-responses-block-size: 468 9189982a05dSsthen 919a3167c07Ssthen # Use the SNI extension for TLS connections. Default is yes. 920a3167c07Ssthen # Changing the value requires a reload. 921a3167c07Ssthen # tls-use-sni: yes 922a3167c07Ssthen 923f6b99bafSsthen # Add the secret file for TLS Session Ticket. 924f6b99bafSsthen # Secret file must be 80 bytes of random data. 925f6b99bafSsthen # First key use to encrypt and decrypt TLS session tickets. 926f6b99bafSsthen # Other keys use to decrypt only. 927f6b99bafSsthen # requires restart to take effect. 928f6b99bafSsthen # tls-session-ticket-keys: "path/to/secret_file1" 929f6b99bafSsthen # tls-session-ticket-keys: "path/to/secret_file2" 930f6b99bafSsthen 93120237c55Ssthen # request upstream over TLS (with plain DNS inside the TLS stream). 932933707f3Ssthen # Default is no. Can be turned on and off with unbound-control. 933938a3a5eSflorian # tls-upstream: no 934938a3a5eSflorian 935938a3a5eSflorian # Certificates used to authenticate connections made upstream. 936938a3a5eSflorian # tls-cert-bundle: "" 937933707f3Ssthen 93820237c55Ssthen # Add system certs to the cert bundle, from the Windows Cert Store 93920237c55Ssthen # tls-win-cert: no 9400bdb4f62Ssthen # and on other systems, the default openssl certificates 9410bdb4f62Ssthen # tls-system-cert: no 94220237c55Ssthen 9439982a05dSsthen # Pad queries over TLS upstreams 9449982a05dSsthen # pad-queries: yes 9459982a05dSsthen 9469982a05dSsthen # Padded queries will be padded to the closest multiple of this size. 9479982a05dSsthen # pad-queries-block-size: 128 9489982a05dSsthen 94920237c55Ssthen # Also serve tls on these port numbers (eg. 443, ...), by listing 95020237c55Ssthen # tls-additional-port: portno for each of the port numbers. 95120237c55Ssthen 9522c144df0Ssthen # HTTP endpoint to provide DNS-over-HTTPS service on. 9532c144df0Ssthen # http-endpoint: "/dns-query" 9542c144df0Ssthen 9552c144df0Ssthen # HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use. 9562c144df0Ssthen # http-max-streams: 100 9572c144df0Ssthen 9582c144df0Ssthen # Maximum number of bytes used for all HTTP/2 query buffers. 9592c144df0Ssthen # http-query-buffer-size: 4m 9602c144df0Ssthen 9612c144df0Ssthen # Maximum number of bytes used for all HTTP/2 response buffers. 9622c144df0Ssthen # http-response-buffer-size: 4m 9632c144df0Ssthen 9642c144df0Ssthen # Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS 9652c144df0Ssthen # service. 9662c144df0Ssthen # http-nodelay: yes 9672c144df0Ssthen 968eba819a2Ssthen # Disable TLS for DNS-over-HTTP downstream service. 969eba819a2Ssthen # http-notls-downstream: no 970eba819a2Ssthen 97145872187Ssthen # The interfaces that use these listed port numbers will support and 97245872187Ssthen # expect PROXYv2. For UDP and TCP/TLS interfaces. 97345872187Ssthen # proxy-protocol-port: portno for each of the port numbers. 97445872187Ssthen 97598f3ca02Sbrad # DNS64 prefix. Must be specified when DNS64 is use. 97698f3ca02Sbrad # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4. 97798f3ca02Sbrad # dns64-prefix: 64:ff9b::0/96 97898f3ca02Sbrad 9792308e98cSsthen # DNS64 ignore AAAA records for these domains and use A instead. 9802308e98cSsthen # dns64-ignore-aaaa: "example.com" 9812308e98cSsthen 982a58bff56Ssthen # ratelimit for uncached, new queries, this limits recursion effort. 983a58bff56Ssthen # ratelimiting is experimental, and may help against randomqueryflood. 984a58bff56Ssthen # if 0(default) it is disabled, otherwise state qps allowed per zone. 985a58bff56Ssthen # ratelimit: 0 986a58bff56Ssthen 987a58bff56Ssthen # ratelimits are tracked in a cache, size in bytes of cache (or k,m). 988a58bff56Ssthen # ratelimit-size: 4m 989a58bff56Ssthen # ratelimit cache slabs, reduces lock contention if equal to cpucount. 990a58bff56Ssthen # ratelimit-slabs: 4 991a58bff56Ssthen 992a58bff56Ssthen # 0 blocks when ratelimited, otherwise let 1/xth traffic through 993a58bff56Ssthen # ratelimit-factor: 10 994a58bff56Ssthen 995e21c60efSsthen # Aggressive rate limit when the limit is reached and until demand has 996e21c60efSsthen # decreased in a 2 second rate window. 997e21c60efSsthen # ratelimit-backoff: no 998e21c60efSsthen 999a58bff56Ssthen # override the ratelimit for a specific domain name. 1000a58bff56Ssthen # give this setting multiple times to have multiple overrides. 1001a58bff56Ssthen # ratelimit-for-domain: example.com 1000 1002a58bff56Ssthen # override the ratelimits for all domains below a domain name 1003a58bff56Ssthen # can give this multiple times, the name closest to the zone is used. 100477079be7Ssthen # ratelimit-below-domain: com 1000 100577079be7Ssthen 100677079be7Ssthen # global query ratelimit for all ip addresses. 100777079be7Ssthen # feature is experimental. 100877079be7Ssthen # if 0(default) it is disabled, otherwise states qps allowed per ip address 100977079be7Ssthen # ip-ratelimit: 0 101077079be7Ssthen 1011f46c52bfSsthen # global query ratelimit for all ip addresses with a valid DNS Cookie. 1012f46c52bfSsthen # feature is experimental. 1013f46c52bfSsthen # if 0(default) it is disabled, otherwise states qps allowed per ip address 1014f46c52bfSsthen # useful in combination with 'allow_cookie'. 1015f46c52bfSsthen # If used, suggested to be higher than ip-ratelimit, tenfold. 1016f46c52bfSsthen # ip-ratelimit-cookie: 0 1017f46c52bfSsthen 101877079be7Ssthen # ip ratelimits are tracked in a cache, size in bytes of cache (or k,m). 101977079be7Ssthen # ip-ratelimit-size: 4m 102077079be7Ssthen # ip ratelimit cache slabs, reduces lock contention if equal to cpucount. 102177079be7Ssthen # ip-ratelimit-slabs: 4 102277079be7Ssthen 102377079be7Ssthen # 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through 102477079be7Ssthen # ip-ratelimit-factor: 10 102577079be7Ssthen 1026e21c60efSsthen # Aggressive rate limit when the limit is reached and until demand has 1027e21c60efSsthen # decreased in a 2 second rate window. 1028e21c60efSsthen # ip-ratelimit-backoff: no 1029e21c60efSsthen 10302308e98cSsthen # Limit the number of connections simultaneous from a netblock 10312308e98cSsthen # tcp-connection-limit: 192.0.2.0/24 12 10322308e98cSsthen 10333150e5f6Ssthen # select from the fastest servers this many times out of 1000. 0 means 10343150e5f6Ssthen # the fast server select is disabled. prefetches are not sped up. 10353150e5f6Ssthen # fast-server-permil: 0 10363150e5f6Ssthen # the number of servers that will be used in the fast server selection. 10373150e5f6Ssthen # fast-server-num: 3 103820237c55Ssthen 1039f46c52bfSsthen # reply to requests containing DNS Cookies as specified in RFC 7873 and RFC 9018. 1040f46c52bfSsthen # answer-cookie: no 1041f46c52bfSsthen 1042f46c52bfSsthen # secret for DNS Cookie generation. 1043f46c52bfSsthen # useful for anycast deployments. 1044f46c52bfSsthen # example value "000102030405060708090a0b0c0d0e0f". 1045f46c52bfSsthen # cookie-secret: <128 bit random hex string> 1046f46c52bfSsthen 104798bc733bSsthen # File with cookie secrets, the 'cookie-secret:' option is ignored 104898bc733bSsthen # and the file can be managed to have staging and active secrets 104998bc733bSsthen # with remote control commands. Disabled with "". Default is "". 105098bc733bSsthen # cookie-secret-file: "/usr/local/etc/unbound_cookiesecrets.txt" 105198bc733bSsthen 10520bdb4f62Ssthen # Enable to attach Extended DNS Error codes (RFC8914) to responses. 10530bdb4f62Ssthen # ede: no 10540bdb4f62Ssthen 10550bdb4f62Ssthen # Enable to attach an Extended DNS Error (RFC8914) Code 3 - Stale 10560bdb4f62Ssthen # Answer as EDNS0 option to expired responses. 10570bdb4f62Ssthen # Note that the ede option above needs to be enabled for this to work. 10580bdb4f62Ssthen # ede-serve-expired: no 10590bdb4f62Ssthen 1060e21c60efSsthen # Specific options for ipsecmod. Unbound needs to be configured with 10612be9e038Ssthen # --enable-ipsecmod for these to take effect. 10622be9e038Ssthen # 10632be9e038Ssthen # Enable or disable ipsecmod (it still needs to be defined in 10642be9e038Ssthen # module-config above). Can be used when ipsecmod needs to be 10652be9e038Ssthen # enabled/disabled via remote-control(below). 10662be9e038Ssthen # ipsecmod-enabled: yes 10672be9e038Ssthen # 10682be9e038Ssthen # Path to executable external hook. It must be defined when ipsecmod is 10692be9e038Ssthen # listed in module-config (above). 10702be9e038Ssthen # ipsecmod-hook: "./my_executable" 10712be9e038Ssthen # 1072e21c60efSsthen # When enabled Unbound will reply with SERVFAIL if the return value of 10732be9e038Ssthen # the ipsecmod-hook is not 0. 10742be9e038Ssthen # ipsecmod-strict: no 10752be9e038Ssthen # 10762be9e038Ssthen # Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY. 10772be9e038Ssthen # ipsecmod-max-ttl: 3600 10782be9e038Ssthen # 10792be9e038Ssthen # Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for 10802be9e038Ssthen # testing. 10812be9e038Ssthen # ipsecmod-ignore-bogus: no 10822be9e038Ssthen # 10832be9e038Ssthen # Domains for which ipsecmod will be triggered. If not defined (default) 10842c144df0Ssthen # all domains are treated as being allowed. 10852c144df0Ssthen # ipsecmod-allow: "example.com" 10862c144df0Ssthen # ipsecmod-allow: "nlnetlabs.nl" 10872be9e038Ssthen 1088191f22c6Ssthen # Timeout for REUSE entries in milliseconds. 1089191f22c6Ssthen # tcp-reuse-timeout: 60000 1090191f22c6Ssthen # Max number of queries on a reuse connection. 1091191f22c6Ssthen # max-reuse-tcp-queries: 200 1092191f22c6Ssthen # Timeout in milliseconds for TCP queries to auth servers. 1093191f22c6Ssthen # tcp-auth-query-timeout: 3000 1094191f22c6Ssthen 1095a58bff56Ssthen 1096933707f3Ssthen# Python config section. To enable: 1097933707f3Ssthen# o use --with-pythonmodule to configure before compiling. 1098933707f3Ssthen# o list python in the module-config string (above) to enable. 1099c3b38330Ssthen# It can be at the start, it gets validated results, or just before 1100c3b38330Ssthen# the iterator and process before DNSSEC validation. 1101933707f3Ssthen# o and give a python-script to run. 1102933707f3Ssthenpython: 1103933707f3Ssthen # Script file to load 1104933707f3Ssthen # python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py" 1105933707f3Ssthen 1106a3167c07Ssthen# Dynamic library config section. To enable: 1107a3167c07Ssthen# o use --with-dynlibmodule to configure before compiling. 1108a3167c07Ssthen# o list dynlib in the module-config string (above) to enable. 1109a3167c07Ssthen# It can be placed anywhere, the dynlib module is only a very thin wrapper 1110a3167c07Ssthen# to load modules dynamically. 1111a3167c07Ssthen# o and give a dynlib-file to run. If more than one dynlib entry is listed in 1112a3167c07Ssthen# the module-config then you need one dynlib-file per instance. 1113a3167c07Ssthendynlib: 1114a3167c07Ssthen # Script file to load 1115a3167c07Ssthen # dynlib-file: "@UNBOUND_SHARE_DIR@/dynlib.so" 1116a3167c07Ssthen 1117933707f3Ssthen# Remote control config section. 1118933707f3Ssthenremote-control: 1119933707f3Ssthen # Enable remote control with unbound-control(8) here. 1120933707f3Ssthen # set up the keys and certificates with unbound-control-setup. 1121933707f3Ssthen # control-enable: no 1122933707f3Ssthen 1123933707f3Ssthen # what interfaces are listened to for remote control. 1124933707f3Ssthen # give 0.0.0.0 and ::0 to listen to all interfaces. 112520237c55Ssthen # set to an absolute path to use a unix local name pipe, certificates 112620237c55Ssthen # are not used for that, so key and cert files need not be present. 1127933707f3Ssthen # control-interface: 127.0.0.1 1128933707f3Ssthen # control-interface: ::1 1129933707f3Ssthen 1130933707f3Ssthen # port number for remote control operations. 1131933707f3Ssthen # control-port: 8953 1132933707f3Ssthen 113320237c55Ssthen # for localhost, you can disable use of TLS by setting this to "no" 113420237c55Ssthen # For local sockets this option is ignored, and TLS is not used. 113520237c55Ssthen # control-use-cert: "yes" 113620237c55Ssthen 1137e21c60efSsthen # Unbound server key file. 1138933707f3Ssthen # server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key" 1139933707f3Ssthen 1140e21c60efSsthen # Unbound server certificate file. 1141933707f3Ssthen # server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem" 1142933707f3Ssthen 1143933707f3Ssthen # unbound-control key file. 1144933707f3Ssthen # control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key" 1145933707f3Ssthen 1146933707f3Ssthen # unbound-control certificate file. 1147933707f3Ssthen # control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem" 1148933707f3Ssthen 1149933707f3Ssthen# Stub zones. 1150933707f3Ssthen# Create entries like below, to make all queries for 'example.com' and 1151933707f3Ssthen# 'example.org' go to the given list of nameservers. list zero or more 1152933707f3Ssthen# nameservers by hostname or by ipaddress. If you set stub-prime to yes, 1153933707f3Ssthen# the list is treated as priming hints (default is no). 1154d8d14d0cSsthen# With stub-first yes, it attempts without the stub if it fails. 1155a961b961Ssthen# Consider adding domain-insecure: name and local-zone: name nodefault 1156a961b961Ssthen# to the server: section if the stub is a locally served zone. 1157933707f3Ssthen# stub-zone: 1158933707f3Ssthen# name: "example.com" 1159933707f3Ssthen# stub-addr: 192.0.2.68 1160933707f3Ssthen# stub-prime: no 1161d8d14d0cSsthen# stub-first: no 1162e21c60efSsthen# stub-tcp-upstream: no 1163938a3a5eSflorian# stub-tls-upstream: no 11642308e98cSsthen# stub-no-cache: no 1165933707f3Ssthen# stub-zone: 1166933707f3Ssthen# name: "example.org" 1167933707f3Ssthen# stub-host: ns.example.com. 1168933707f3Ssthen 1169933707f3Ssthen# Forward zones 1170933707f3Ssthen# Create entries like below, to make all queries for 'example.com' and 1171933707f3Ssthen# 'example.org' go to the given list of servers. These servers have to handle 1172933707f3Ssthen# recursion to other nameservers. List zero or more nameservers by hostname 1173933707f3Ssthen# or by ipaddress. Use an entry with name "." to forward all queries. 1174d8d14d0cSsthen# If you enable forward-first, it attempts without the forward if it fails. 1175933707f3Ssthen# forward-zone: 1176933707f3Ssthen# name: "example.com" 1177933707f3Ssthen# forward-addr: 192.0.2.68 1178933707f3Ssthen# forward-addr: 192.0.2.73@5355 # forward to port 5355. 1179d8d14d0cSsthen# forward-first: no 1180e21c60efSsthen# forward-tcp-upstream: no 1181938a3a5eSflorian# forward-tls-upstream: no 11822308e98cSsthen# forward-no-cache: no 1183933707f3Ssthen# forward-zone: 1184933707f3Ssthen# name: "example.org" 1185933707f3Ssthen# forward-host: fwd.example.com 118677079be7Ssthen 1187bdfc4d55Sflorian# Authority zones 1188bdfc4d55Sflorian# The data for these zones is kept locally, from a file or downloaded. 1189bdfc4d55Sflorian# The data can be served to downstream clients, or used instead of the 1190bdfc4d55Sflorian# upstream (which saves a lookup to the upstream). The first example 1191bdfc4d55Sflorian# has a copy of the root for local usage. The second serves example.org 1192bdfc4d55Sflorian# authoritatively. zonefile: reads from file (and writes to it if you also 11932c144df0Ssthen# download it), primary: fetches with AXFR and IXFR, or url to zonefile. 1194d1e2768aSsthen# With allow-notify: you can give additional (apart from primaries and urls) 1195d1e2768aSsthen# sources of notifies. 1196bdfc4d55Sflorian# auth-zone: 1197bdfc4d55Sflorian# name: "." 1198f46c52bfSsthen# primary: 170.247.170.2 # b.root-servers.net 11992c144df0Ssthen# primary: 192.33.4.12 # c.root-servers.net 12002c144df0Ssthen# primary: 199.7.91.13 # d.root-servers.net 12012c144df0Ssthen# primary: 192.5.5.241 # f.root-servers.net 12022c144df0Ssthen# primary: 192.112.36.4 # g.root-servers.net 12032c144df0Ssthen# primary: 193.0.14.129 # k.root-servers.net 12042c144df0Ssthen# primary: 192.0.47.132 # xfr.cjr.dns.icann.org 12052c144df0Ssthen# primary: 192.0.32.132 # xfr.lax.dns.icann.org 1206f46c52bfSsthen# primary: 2801:1b8:10::b # b.root-servers.net 12072c144df0Ssthen# primary: 2001:500:2::c # c.root-servers.net 12082c144df0Ssthen# primary: 2001:500:2d::d # d.root-servers.net 12092c144df0Ssthen# primary: 2001:500:2f::f # f.root-servers.net 12102c144df0Ssthen# primary: 2001:500:12::d0d # g.root-servers.net 12112c144df0Ssthen# primary: 2001:7fd::1 # k.root-servers.net 12122c144df0Ssthen# primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org 12132c144df0Ssthen# primary: 2620:0:2d0:202::132 # xfr.lax.dns.icann.org 1214f6b99bafSsthen# fallback-enabled: yes 1215bdfc4d55Sflorian# for-downstream: no 1216bdfc4d55Sflorian# for-upstream: yes 1217bdfc4d55Sflorian# auth-zone: 1218bdfc4d55Sflorian# name: "example.org" 1219bdfc4d55Sflorian# for-downstream: yes 1220bdfc4d55Sflorian# for-upstream: yes 1221191f22c6Ssthen# zonemd-check: no 1222191f22c6Ssthen# zonemd-reject-absence: no 1223bdfc4d55Sflorian# zonefile: "example.org.zone" 1224bdfc4d55Sflorian 122577079be7Ssthen# Views 122677079be7Ssthen# Create named views. Name must be unique. Map views to requests using 122777079be7Ssthen# the access-control-view option. Views can contain zero or more local-zone 122877079be7Ssthen# and local-data options. Options from matching views will override global 122977079be7Ssthen# options. Global options will be used if no matching view is found. 123077079be7Ssthen# With view-first yes, it will try to answer using the global local-zone and 123177079be7Ssthen# local-data elements if there is no view specific match. 123277079be7Ssthen# view: 123377079be7Ssthen# name: "viewname" 123477079be7Ssthen# local-zone: "example.com" redirect 123577079be7Ssthen# local-data: "example.com A 192.0.2.3" 12362be9e038Ssthen# local-data-ptr: "192.0.2.3 www.example.com" 123777079be7Ssthen# view-first: no 123877079be7Ssthen# view: 123977079be7Ssthen# name: "anotherview" 124077079be7Ssthen# local-zone: "example.com" refuse 12412be9e038Ssthen 12422be9e038Ssthen# DNSCrypt 1243e21c60efSsthen# To enable, use --enable-dnscrypt to configure before compiling. 12442be9e038Ssthen# Caveats: 1245e21c60efSsthen# 1. the keys/certs cannot be produced by Unbound. You can use dnscrypt-wrapper 12462be9e038Ssthen# for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage 12472be9e038Ssthen# 2. dnscrypt channel attaches to an interface. you MUST set interfaces to 12482be9e038Ssthen# listen on `dnscrypt-port` with the follo0wing snippet: 12492be9e038Ssthen# server: 12502be9e038Ssthen# interface: 0.0.0.0@443 12512be9e038Ssthen# interface: ::0@443 12522be9e038Ssthen# 12532be9e038Ssthen# Finally, `dnscrypt` config has its own section. 12542be9e038Ssthen# dnscrypt: 12552be9e038Ssthen# dnscrypt-enable: yes 12562be9e038Ssthen# dnscrypt-port: 443 12572be9e038Ssthen# dnscrypt-provider: 2.dnscrypt-cert.example.com. 12582be9e038Ssthen# dnscrypt-secret-key: /path/unbound-conf/keys1/1.key 12592be9e038Ssthen# dnscrypt-secret-key: /path/unbound-conf/keys2/1.key 12602be9e038Ssthen# dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert 12612be9e038Ssthen# dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert 12627191de28Ssthen 12637191de28Ssthen# CacheDB 1264e21c60efSsthen# External backend DB as auxiliary cache. 1265e21c60efSsthen# To enable, use --enable-cachedb to configure before compiling. 1266e21c60efSsthen# Specify the backend name 12677191de28Ssthen# (default is "testframe", which has no use other than for debugging and 12687191de28Ssthen# testing) and backend-specific options. The 'cachedb' module must be 1269c3b38330Ssthen# included in module-config, just before the iterator module. 12707191de28Ssthen# cachedb: 12717191de28Ssthen# backend: "testframe" 12727191de28Ssthen# # secret seed string to calculate hashed keys 12737191de28Ssthen# secret-seed: "default" 1274d896b962Ssthen# # if the backend should be read from, but not written to. 1275d896b962Ssthen# cachedb-no-store: no 12762bdc0ed1Ssthen# # if the cachedb should be checked before a serve-expired response is 12772bdc0ed1Ssthen# # given, when serve-expired is enabled. 12782bdc0ed1Ssthen# cachedb-check-when-serve-expired: yes 127920237c55Ssthen# 128020237c55Ssthen# # For "redis" backend: 1281e21c60efSsthen# # (to enable, use --with-libhiredis to configure before compiling) 128220237c55Ssthen# # redis server's IP address or host name 128320237c55Ssthen# redis-server-host: 127.0.0.1 128420237c55Ssthen# # redis server's TCP port 128520237c55Ssthen# redis-server-port: 6379 12868b7325afSsthen# # if the server uses a unix socket, set its path, or "" when not used. 12878b7325afSsthen# # redis-server-path: "/var/lib/redis/redis-server.sock" 12888b7325afSsthen# # if the server uses an AUTH password, specify here, or "" when not used. 12898b7325afSsthen# # redis-server-password: "" 129020237c55Ssthen# # timeout (in ms) for communication with the redis server 129120237c55Ssthen# redis-timeout: 100 1292a3167c07Ssthen# # set timeout on redis records based on DNS response TTL 1293a3167c07Ssthen# redis-expire-records: no 1294d896b962Ssthen# # redis logical database to use, 0 is the default database. 1295d896b962Ssthen# redis-logical-db: 0 12968240c1b9Ssthen 12978240c1b9Ssthen# IPSet 12988240c1b9Ssthen# Add specify domain into set via ipset. 1299e21c60efSsthen# To enable: 1300e21c60efSsthen# o use --enable-ipset to configure before compiling; 1301e21c60efSsthen# o Unbound then needs to run as root user. 13028240c1b9Ssthen# ipset: 13038240c1b9Ssthen# # set name for ip v4 addresses 13048240c1b9Ssthen# name-v4: "list-v4" 13058240c1b9Ssthen# # set name for ip v6 addresses 13068240c1b9Ssthen# name-v6: "list-v6" 13078240c1b9Ssthen# 13088240c1b9Ssthen 1309e21c60efSsthen# Dnstap logging support, if compiled in by using --enable-dnstap to configure. 1310e21c60efSsthen# To enable, set the dnstap-enable to yes and also some of 1311e21c60efSsthen# dnstap-log-..-messages to yes. And select an upstream log destination, by 1312e21c60efSsthen# socket path, TCP or TLS destination. 1313a3167c07Ssthen# dnstap: 1314a3167c07Ssthen# dnstap-enable: no 1315a3167c07Ssthen# # if set to yes frame streams will be used in bidirectional mode 1316a3167c07Ssthen# dnstap-bidirectional: yes 1317a3167c07Ssthen# dnstap-socket-path: "@DNSTAP_SOCKET_PATH@" 1318a3167c07Ssthen# # if "" use the unix socket in dnstap-socket-path, otherwise, 1319a3167c07Ssthen# # set it to "IPaddress[@port]" of the destination. 1320a3167c07Ssthen# dnstap-ip: "" 1321a3167c07Ssthen# # if set to yes if you want to use TLS to dnstap-ip, no for TCP. 1322a3167c07Ssthen# dnstap-tls: yes 1323a3167c07Ssthen# # name for authenticating the upstream server. or "" disabled. 1324a3167c07Ssthen# dnstap-tls-server-name: "" 1325e21c60efSsthen# # if "", it uses the cert bundle from the main Unbound config. 1326a3167c07Ssthen# dnstap-tls-cert-bundle: "" 1327a3167c07Ssthen# # key file for client authentication, or "" disabled. 1328a3167c07Ssthen# dnstap-tls-client-key-file: "" 1329a3167c07Ssthen# # cert file for client authentication, or "" disabled. 1330a3167c07Ssthen# dnstap-tls-client-cert-file: "" 1331a3167c07Ssthen# dnstap-send-identity: no 1332a3167c07Ssthen# dnstap-send-version: no 1333a3167c07Ssthen# # if "" it uses the hostname. 1334a3167c07Ssthen# dnstap-identity: "" 1335a3167c07Ssthen# # if "" it uses the package version. 1336a3167c07Ssthen# dnstap-version: "" 133798bc733bSsthen# # log only 1/N messages, if 0 it is disabled. default 0. 133898bc733bSsthen# dnstap-sample-rate: 0 1339a3167c07Ssthen# dnstap-log-resolver-query-messages: no 1340a3167c07Ssthen# dnstap-log-resolver-response-messages: no 1341a3167c07Ssthen# dnstap-log-client-query-messages: no 1342a3167c07Ssthen# dnstap-log-client-response-messages: no 1343a3167c07Ssthen# dnstap-log-forwarder-query-messages: no 1344a3167c07Ssthen# dnstap-log-forwarder-response-messages: no 1345a3167c07Ssthen 1346eaf2578eSsthen# Response Policy Zones 134798bc733bSsthen# RPZ policies. Applied in order of configuration. Any match from an earlier 134898bc733bSsthen# RPZ zone will terminate the RPZ lookup. QNAME, Response IP 1349e21c60efSsthen# Address, nsdname, nsip and clientip triggers are supported. Supported 1350e21c60efSsthen# actions are: NXDOMAIN, NODATA, PASSTHRU, DROP, Local Data, tcp-only 1351e21c60efSsthen# and drop. Policies can be loaded from a file, or using zone 1352e21c60efSsthen# transfer, or using HTTP. The respip module needs to be added 1353eaf2578eSsthen# to the module-config, e.g.: module-config: "respip validator iterator". 1354eaf2578eSsthen# rpz: 1355eaf2578eSsthen# name: "rpz.example.com" 1356eaf2578eSsthen# zonefile: "rpz.example.com" 13572c144df0Ssthen# primary: 192.0.2.0 1358eaf2578eSsthen# allow-notify: 192.0.2.0/32 1359eaf2578eSsthen# url: http://www.example.com/rpz.example.org.zone 1360eaf2578eSsthen# rpz-action-override: cname 1361eaf2578eSsthen# rpz-cname-override: www.example.org 1362eaf2578eSsthen# rpz-log: yes 1363eaf2578eSsthen# rpz-log-name: "example policy" 1364e21c60efSsthen# rpz-signal-nxdomain-ra: no 1365e21c60efSsthen# for-downstream: no 1366eaf2578eSsthen# tags: "example" 1367