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