unbound.conf.j2 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. #
  2. # Example configuration file.
  3. #
  4. # See unbound.conf(5) man page
  5. #
  6. # this is a comment.
  7. #Use this to include other text into the file.
  8. #include: "otherfile.conf"
  9. # The server clause sets the main parameters.
  10. server:
  11. # whitespace is not necessary, but looks cleaner.
  12. # verbosity number, 0 is least verbose. 1 is default.
  13. verbosity: 1
  14. # print statistics to the log (for every thread) every N seconds.
  15. # Set to "" or 0 to disable. Default is disabled.
  16. # Needs to be disabled for munin plugin
  17. statistics-interval: 0
  18. # enable shm for stats, default no. if you enable also enable
  19. # statistics-interval, every time it also writes stats to the
  20. # shared memory segment keyed with shm-key.
  21. # shm-enable: no
  22. # shm for stats uses this key, and key+1 for the shared mem segment.
  23. # shm-key: 11777
  24. # enable cumulative statistics, without clearing them after printing.
  25. # Needs to be disabled for munin plugin
  26. statistics-cumulative: no
  27. # enable extended statistics (query types, answer codes, status)
  28. # printed from unbound-control. default off, because of speed.
  29. # Needs to be enabled for munin plugin
  30. extended-statistics: yes
  31. # number of threads to create. 1 disables threading.
  32. num-threads: 4
  33. # specify the interfaces to answer queries from by ip-address.
  34. # The default is to listen to localhost (127.0.0.1 and ::1).
  35. # specify 0.0.0.0 and ::0 to bind to all available interfaces.
  36. # specify every interface[@port] on a new 'interface:' labelled line.
  37. # The listen interfaces are not changed on reload, only on restart.
  38. interface: 0.0.0.0
  39. # interface: ::0
  40. # interface: 192.0.2.153
  41. # interface: 192.0.2.154
  42. # interface: 192.0.2.154@5003
  43. # interface: 2001:DB8::5
  44. #
  45. # for dns over tls and raw dns over port 80
  46. # interface: 0.0.0.0@443
  47. # interface: ::0@443
  48. # interface: 0.0.0.0@80
  49. # interface: ::0@80
  50. # enable this feature to copy the source address of queries to reply.
  51. # Socket options are not supported on all platforms. experimental.
  52. # interface-automatic: yes
  53. #
  54. # NOTE: Enable this option when specifying interface 0.0.0.0 or ::0
  55. # NOTE: Disabled per Fedora policy not to listen to * on default install
  56. # NOTE: If deploying on non-default port, eg 80/443, this needs to be disabled
  57. interface-automatic: no
  58. # port to answer queries from
  59. port: 53
  60. # specify the interfaces to send outgoing queries to authoritative
  61. # server from by ip-address. If none, the default (all) interface
  62. # is used. Specify every interface on a 'outgoing-interface:' line.
  63. # outgoing-interface: 192.0.2.153
  64. # outgoing-interface: 2001:DB8::5
  65. # outgoing-interface: 2001:DB8::6
  66. # Specify a netblock to use remainder 64 bits as random bits for
  67. # upstream queries. Uses freebind option (Linux).
  68. # outgoing-interface: 2001:DB8::/64
  69. # Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo
  70. # And: ip -6 route add local 2001:db8::/64 dev lo
  71. # And set prefer-ip6: yes to use the ip6 randomness from a netblock.
  72. # Set this to yes to prefer ipv6 upstream servers over ipv4.
  73. # prefer-ip6: no
  74. # number of ports to allocate per thread, determines the size of the
  75. # port range that can be open simultaneously. About double the
  76. # num-queries-per-thread, or, use as many as the OS will allow you.
  77. # outgoing-range: 4096
  78. # permit unbound to use this port number or port range for
  79. # making outgoing queries, using an outgoing interface.
  80. # Only ephemeral ports are allowed by SElinux
  81. outgoing-port-permit: 32768-60999
  82. # deny unbound the use this of port number or port range for
  83. # making outgoing queries, using an outgoing interface.
  84. # Use this to make sure unbound does not grab a UDP port that some
  85. # other server on this computer needs. The default is to avoid
  86. # IANA-assigned port numbers.
  87. # If multiple outgoing-port-permit and outgoing-port-avoid options
  88. # are present, they are processed in order.
  89. # Our SElinux policy does not allow non-ephemeral ports to be used
  90. outgoing-port-avoid: 0-32767
  91. # number of outgoing simultaneous tcp buffers to hold per thread.
  92. # outgoing-num-tcp: 10
  93. # number of incoming simultaneous tcp buffers to hold per thread.
  94. # incoming-num-tcp: 10
  95. # buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
  96. # 0 is system default. Use 4m to catch query spikes for busy servers.
  97. # so-rcvbuf: 0
  98. # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
  99. # 0 is system default. Use 4m to handle spikes on very busy servers.
  100. # so-sndbuf: 0
  101. # use SO_REUSEPORT to distribute queries over threads.
  102. so-reuseport: yes
  103. # use IP_TRANSPARENT so the interface: addresses can be non-local
  104. # and you can config non-existing IPs that are going to work later on
  105. # (uses IP_BINDANY on FreeBSD).
  106. ip-transparent: yes
  107. # use IP_FREEBIND so the interface: addresses can be non-local
  108. # and you can bind to nonexisting IPs and interfaces that are down.
  109. # Linux only. On Linux you also have ip-transparent that is similar.
  110. # ip-freebind: no
  111. # EDNS reassembly buffer to advertise to UDP peers (the actual buffer
  112. # is set with msg-buffer-size). 1472 can solve fragmentation (timeouts).
  113. # edns-buffer-size: 4096
  114. # Maximum UDP response size (not applied to TCP response).
  115. # Suggested values are 512 to 4096. Default is 4096. 65536 disables it.
  116. # 3072 causes +dnssec any isc.org queries to need TC=1.
  117. # Helps mitigating DDOS
  118. max-udp-size: 3072
  119. # buffer size for handling DNS data. No messages larger than this
  120. # size can be sent or received, by UDP or TCP. In bytes.
  121. # msg-buffer-size: 65552
  122. # the amount of memory to use for the message cache.
  123. # plain value in bytes or you can append k, m or G. default is "4Mb".
  124. # msg-cache-size: 4m
  125. # the number of slabs to use for the message cache.
  126. # the number of slabs must be a power of 2.
  127. # more slabs reduce lock contention, but fragment memory usage.
  128. # msg-cache-slabs: 4
  129. # the number of queries that a thread gets to service.
  130. # num-queries-per-thread: 1024
  131. # if very busy, 50% queries run to completion, 50% get timeout in msec
  132. # jostle-timeout: 200
  133. # msec to wait before close of port on timeout UDP. 0 disables.
  134. # delay-close: 0
  135. # the amount of memory to use for the RRset cache.
  136. # plain value in bytes or you can append k, m or G. default is "4Mb".
  137. # rrset-cache-size: 4m
  138. # the number of slabs to use for the RRset cache.
  139. # the number of slabs must be a power of 2.
  140. # more slabs reduce lock contention, but fragment memory usage.
  141. # rrset-cache-slabs: 4
  142. # the time to live (TTL) value lower bound, in seconds. Default 0.
  143. # If more than an hour could easily give trouble due to stale data.
  144. # cache-min-ttl: 0
  145. # the time to live (TTL) value cap for RRsets and messages in the
  146. # cache. Items are not cached for longer. In seconds.
  147. # cache-max-ttl: 86400
  148. # the time to live (TTL) value cap for negative responses in the cache
  149. # cache-max-negative-ttl: 3600
  150. # the time to live (TTL) value for cached roundtrip times, lameness and
  151. # EDNS version information for hosts. In seconds.
  152. # infra-host-ttl: 900
  153. # minimum wait time for responses, increase if uplink is long. In msec.
  154. # infra-cache-min-rtt: 50
  155. # the number of slabs to use for the Infrastructure cache.
  156. # the number of slabs must be a power of 2.
  157. # more slabs reduce lock contention, but fragment memory usage.
  158. # infra-cache-slabs: 4
  159. # the maximum number of hosts that are cached (roundtrip, EDNS, lame).
  160. # infra-cache-numhosts: 10000
  161. # define a number of tags here, use with local-zone, access-control.
  162. # repeat the define-tag statement to add additional tags.
  163. # define-tag: "tag1 tag2 tag3"
  164. # Enable IPv4, "yes" or "no".
  165. do-ip4: yes
  166. # Enable IPv6, "yes" or "no".
  167. do-ip6: no
  168. # Enable UDP, "yes" or "no".
  169. # NOTE: if setting up an unbound on tls443 for public use, you might want to
  170. # disable UDP to avoid being used in DNS amplification attacks.
  171. do-udp: yes
  172. # Enable TCP, "yes" or "no".
  173. do-tcp: yes
  174. # upstream connections use TCP only (and no UDP), "yes" or "no"
  175. # useful for tunneling scenarios, default no.
  176. # tcp-upstream: no
  177. # upstream connections also use UDP (even if do-udp is no).
  178. # useful if if you want UDP upstream, but don't provide UDP downstream.
  179. # udp-upstream-without-downstream: no
  180. # Maximum segment size (MSS) of TCP socket on which the server
  181. # responds to queries. Default is 0, system default MSS.
  182. # tcp-mss: 0
  183. # Maximum segment size (MSS) of TCP socket for outgoing queries.
  184. # Default is 0, system default MSS.
  185. # outgoing-tcp-mss: 0
  186. # Fedora note: do not activate this - can cause a crash
  187. # Use systemd socket activation for UDP, TCP, and control sockets.
  188. # use-systemd: no
  189. # Detach from the terminal, run in background, "yes" or "no".
  190. # Set the value to "no" when unbound runs as systemd service.
  191. # do-daemonize: yes
  192. # control which clients are allowed to make (recursive) queries
  193. # to this server. Specify classless netblocks with /size and action.
  194. # By default everything is refused, except for localhost.
  195. # Choose deny (drop message), refuse (polite error reply),
  196. # allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on),
  197. # allow_snoop (recursive and nonrecursive ok)
  198. # deny_non_local (drop queries unless can be answered from local-data)
  199. # refuse_non_local (like deny_non_local but polite error reply).
  200. access-control: 0.0.0.0/0 refuse
  201. access-control: 127.0.0.0/8 allow
  202. access-control: 172.25.0.0/16 allow
  203. access-control: 192.168.0.0/16 allow
  204. # access-control: ::0/0 refuse
  205. # access-control: ::1 allow
  206. # access-control: ::ffff:127.0.0.1 allow
  207. # tag access-control with list of tags (in "" with spaces between)
  208. # Clients using this access control element use localzones that
  209. # are tagged with one of these tags.
  210. # access-control-tag: 192.0.2.0/24 "tag2 tag3"
  211. # set action for particular tag for given access control element
  212. # if you have multiple tag values, the tag used to lookup the action
  213. # is the first tag match between access-control-tag and local-zone-tag
  214. # where "first" comes from the order of the define-tag values.
  215. # access-control-tag-action: 192.0.2.0/24 tag3 refuse
  216. # set redirect data for particular tag for access control element
  217. # access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1"
  218. # Set view for access control element
  219. # access-control-view: 192.0.2.0/24 viewname
  220. # if given, a chroot(2) is done to the given directory.
  221. # i.e. you can chroot to the working directory, for example,
  222. # for extra security, but make sure all files are in that directory.
  223. #
  224. # If chroot is enabled, you should pass the configfile (from the
  225. # commandline) as a full path from the original root. After the
  226. # chroot has been performed the now defunct portion of the config
  227. # file path is removed to be able to reread the config after a reload.
  228. #
  229. # All other file paths (working dir, logfile, roothints, and
  230. # key files) can be specified in several ways:
  231. # o as an absolute path relative to the new root.
  232. # o as a relative path to the working directory.
  233. # o as an absolute path relative to the original root.
  234. # In the last case the path is adjusted to remove the unused portion.
  235. #
  236. # The pid file can be absolute and outside of the chroot, it is
  237. # written just prior to performing the chroot and dropping permissions.
  238. #
  239. # Additionally, unbound may need to access /dev/random (for entropy).
  240. # How to do this is specific to your OS.
  241. #
  242. # If you give "" no chroot is performed. The path must not end in a /.
  243. # chroot: "/var/lib/unbound"
  244. chroot: ""
  245. # if given, user privileges are dropped (after binding port),
  246. # and the given username is assumed. Default is user "unbound".
  247. # If you give "" no privileges are dropped.
  248. username: "unbound"
  249. # the working directory. The relative files in this config are
  250. # relative to this directory. If you give "" the working directory
  251. # is not changed.
  252. # If you give a server: directory: dir before include: file statements
  253. # then those includes can be relative to the working directory.
  254. directory: "/etc/unbound"
  255. # the log file, "" means log to stderr.
  256. # Use of this option sets use-syslog to "no".
  257. # logfile: ""
  258. # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
  259. # log to. If yes, it overrides the logfile.
  260. # use-syslog: yes
  261. # Log identity to report. if empty, defaults to the name of argv[0]
  262. # (usually "unbound").
  263. # log-identity: ""
  264. # print UTC timestamp in ascii to logfile, default is epoch in seconds.
  265. log-time-ascii: yes
  266. # print one line with time, IP, name, type, class for every query.
  267. # log-queries: no
  268. # print one line per reply, with time, IP, name, type, class, rcode,
  269. # timetoresolve, fromcache and responsesize.
  270. # log-replies: no
  271. # the pid file. Can be an absolute path outside of chroot/work dir.
  272. pidfile: "/var/run/unbound/unbound.pid"
  273. # file to read root hints from.
  274. # get one from https://www.internic.net/domain/named.cache
  275. # root-hints: ""
  276. # enable to not answer id.server and hostname.bind queries.
  277. # hide-identity: no
  278. # enable to not answer version.server and version.bind queries.
  279. # hide-version: no
  280. # enable to not answer trustanchor.unbound queries.
  281. # hide-trustanchor: no
  282. # the identity to report. Leave "" or default to return hostname.
  283. # identity: ""
  284. # the version to report. Leave "" or default to return package version.
  285. # version: ""
  286. # the target fetch policy.
  287. # series of integers describing the policy per dependency depth.
  288. # The number of values in the list determines the maximum dependency
  289. # depth the recursor will pursue before giving up. Each integer means:
  290. # -1 : fetch all targets opportunistically,
  291. # 0: fetch on demand,
  292. # positive value: fetch that many targets opportunistically.
  293. # Enclose the list of numbers between quotes ("").
  294. # target-fetch-policy: "3 2 1 0 0"
  295. # Harden against very small EDNS buffer sizes.
  296. # harden-short-bufsize: no
  297. # Harden against unseemly large queries.
  298. # harden-large-queries: no
  299. # Harden against out of zone rrsets, to avoid spoofing attempts.
  300. harden-glue: yes
  301. # Harden against receiving dnssec-stripped data. If you turn it
  302. # off, failing to validate dnskey data for a trustanchor will
  303. # trigger insecure mode for that zone (like without a trustanchor).
  304. # Default on, which insists on dnssec data for trust-anchored zones.
  305. harden-dnssec-stripped: yes
  306. # Harden against queries that fall under dnssec-signed nxdomain names.
  307. harden-below-nxdomain: yes
  308. # Harden the referral path by performing additional queries for
  309. # infrastructure data. Validates the replies (if possible).
  310. # Default off, because the lookups burden the server. Experimental
  311. # implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
  312. harden-referral-path: yes
  313. # Harden against algorithm downgrade when multiple algorithms are
  314. # advertised in the DS record. If no, allows the weakest algorithm
  315. # to validate the zone.
  316. # harden-algo-downgrade: no
  317. # Sent minimum amount of information to upstream servers to enhance
  318. # privacy. Only sent minimum required labels of the QNAME and set QTYPE
  319. # to NS when possible.
  320. qname-minimisation: yes
  321. # QNAME minimisation in strict mode. Do not fall-back to sending full
  322. # QNAME to potentially broken nameservers. A lot of domains will not be
  323. # resolvable when this option in enabled.
  324. # This option only has effect when qname-minimisation is enabled.
  325. # qname-minimisation-strict: no
  326. # Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN
  327. # and other denials, using information from previous NXDOMAINs answers.
  328. aggressive-nsec: yes
  329. # Use 0x20-encoded random bits in the query to foil spoof attempts.
  330. # This feature is an experimental implementation of draft dns-0x20.
  331. # use-caps-for-id: no
  332. # Domains (and domains in them) without support for dns-0x20 and
  333. # the fallback fails because they keep sending different answers.
  334. # caps-whitelist: "licdn.com"
  335. # caps-whitelist: "senderbase.org"
  336. # Enforce privacy of these addresses. Strips them away from answers.
  337. # It may cause DNSSEC validation to additionally mark it as bogus.
  338. # Protects against 'DNS Rebinding' (uses browser as network proxy).
  339. # Only 'private-domain' and 'local-data' names are allowed to have
  340. # these private addresses. No default.
  341. # private-address: 10.0.0.0/8
  342. # private-address: 172.16.0.0/12
  343. # private-address: 192.168.0.0/16
  344. # private-address: 169.254.0.0/16
  345. # private-address: fd00::/8
  346. # private-address: fe80::/10
  347. # private-address: ::ffff:0:0/96
  348. # Allow the domain (and its subdomains) to contain private addresses.
  349. # local-data statements are allowed to contain private addresses too.
  350. # private-domain: "example.com"
  351. # If nonzero, unwanted replies are not only reported in statistics,
  352. # but also a running total is kept per thread. If it reaches the
  353. # threshold, a warning is printed and a defensive action is taken,
  354. # the cache is cleared to flush potential poison out of it.
  355. # A suggested value is 10000000, the default is 0 (turned off).
  356. unwanted-reply-threshold: 10000000
  357. # Do not query the following addresses. No DNS queries are sent there.
  358. # List one address per entry. List classless netblocks with /size,
  359. # do-not-query-address: 127.0.0.1/8
  360. # do-not-query-address: ::1
  361. # if yes, the above default do-not-query-address entries are present.
  362. # if no, localhost can be queried (for testing and debugging).
  363. # do-not-query-localhost: yes
  364. # if yes, perform prefetching of almost expired message cache entries.
  365. prefetch: yes
  366. # if yes, perform key lookups adjacent to normal lookups.
  367. prefetch-key: yes
  368. # if yes, Unbound rotates RRSet order in response.
  369. rrset-roundrobin: yes
  370. # if yes, Unbound doesn't insert authority/additional sections
  371. # into response messages when those sections are not required.
  372. minimal-responses: yes
  373. # true to disable DNSSEC lameness check in iterator.
  374. # disable-dnssec-lame-check: no
  375. # module configuration of the server. A string with identifiers
  376. # separated by spaces. Syntax: "[dns64] [validator] iterator"
  377. module-config: "ipsecmod validator iterator"
  378. # File with trusted keys, kept uptodate using RFC5011 probes,
  379. # initial file like trust-anchor-file, then it stores metadata.
  380. # Use several entries, one per domain name, to track multiple zones.
  381. #
  382. # If you want to perform DNSSEC validation, run unbound-anchor before
  383. # you start unbound (i.e. in the system boot scripts). And enable:
  384. # Please note usage of unbound-anchor root anchor is at your own risk
  385. # and under the terms of our LICENSE (see that file in the source).
  386. # auto-trust-anchor-file: "/var/lib/unbound/root.key"
  387. # trust anchor signaling sends a RFC8145 key tag query after priming.
  388. trust-anchor-signaling: yes
  389. # Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel)
  390. root-key-sentinel: yes
  391. # File with DLV trusted keys. Same format as trust-anchor-file.
  392. # There can be only one DLV configured, it is trusted from root down.
  393. # DLV is going to be decommissioned. Please do not use it any more.
  394. # dlv-anchor-file: "dlv.isc.org.key"
  395. # File with trusted keys for validation. Specify more than one file
  396. # with several entries, one file per entry.
  397. # Zone file format, with DS and DNSKEY entries.
  398. # Note this gets out of date, use auto-trust-anchor-file please.
  399. # trust-anchor-file: ""
  400. # Trusted key for validation. DS or DNSKEY. specify the RR on a
  401. # single line, surrounded by "". TTL is ignored. class is IN default.
  402. # Note this gets out of date, use auto-trust-anchor-file please.
  403. # (These examples are from August 2007 and may not be valid anymore).
  404. # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
  405. # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
  406. # File with trusted keys for validation. Specify more than one file
  407. # with several entries, one file per entry. Like trust-anchor-file
  408. # but has a different file format. Format is BIND-9 style format,
  409. # the trusted-keys { name flag proto algo "key"; }; clauses are read.
  410. # you need external update procedures to track changes in keys.
  411. # trusted-keys-file: ""
  412. #
  413. # trusted-keys-file: /etc/unbound/keys.d/*.key
  414. # auto-trust-anchor-file: "/var/lib/unbound/root.key"
  415. # Ignore chain of trust. Domain is treated as insecure.
  416. domain-insecure: "int.example.com"
  417. # Override the date for validation with a specific fixed date.
  418. # Do not set this unless you are debugging signature inception
  419. # and expiration. "" or "0" turns the feature off. -1 ignores date.
  420. # val-override-date: ""
  421. # The time to live for bogus data, rrsets and messages. This avoids
  422. # some of the revalidation, until the time interval expires. in secs.
  423. # val-bogus-ttl: 60
  424. # The signature inception and expiration dates are allowed to be off
  425. # by 10% of the signature lifetime (expir-incep) from our local clock.
  426. # This leeway is capped with a minimum and a maximum. In seconds.
  427. # val-sig-skew-min: 3600
  428. # val-sig-skew-max: 86400
  429. # Should additional section of secure message also be kept clean of
  430. # unsecure data. Useful to shield the users of this validator from
  431. # potential bogus data in the additional section. All unsigned data
  432. # in the additional section is removed from secure messages.
  433. val-clean-additional: yes
  434. # Turn permissive mode on to permit bogus messages. Thus, messages
  435. # for which security checks failed will be returned to clients,
  436. # instead of SERVFAIL. It still performs the security checks, which
  437. # result in interesting log files and possibly the AD bit in
  438. # replies if the message is found secure. The default is off.
  439. # NOTE: TURNING THIS ON DISABLES ALL DNSSEC SECURITY
  440. val-permissive-mode: no
  441. # Ignore the CD flag in incoming queries and refuse them bogus data.
  442. # Enable it if the only clients of unbound are legacy servers (w2008)
  443. # that set CD but cannot validate themselves.
  444. # ignore-cd-flag: no
  445. # Serve expired responses from cache, with TTL 0 in the response,
  446. # and then attempt to fetch the data afresh.
  447. serve-expired: yes
  448. # Have the validator log failed validations for your diagnosis.
  449. # 0: off. 1: A line per failed user query. 2: With reason and bad IP.
  450. val-log-level: 1
  451. # It is possible to configure NSEC3 maximum iteration counts per
  452. # keysize. Keep this table very short, as linear search is done.
  453. # A message with an NSEC3 with larger count is marked insecure.
  454. # List in ascending order the keysize and count values.
  455. # val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
  456. # instruct the auto-trust-anchor-file probing to add anchors after ttl.
  457. # add-holddown: 2592000 # 30 days
  458. # instruct the auto-trust-anchor-file probing to del anchors after ttl.
  459. # del-holddown: 2592000 # 30 days
  460. # auto-trust-anchor-file probing removes missing anchors after ttl.
  461. # If the value 0 is given, missing anchors are not removed.
  462. # keep-missing: 31622400 # 366 days
  463. # debug option that allows very small holddown times for key rollover,
  464. # otherwise the RFC mandates probe intervals must be at least 1 hour.
  465. # permit-small-holddown: no
  466. # the amount of memory to use for the key cache.
  467. # plain value in bytes or you can append k, m or G. default is "4Mb".
  468. # key-cache-size: 4m
  469. # the number of slabs to use for the key cache.
  470. # the number of slabs must be a power of 2.
  471. # more slabs reduce lock contention, but fragment memory usage.
  472. # key-cache-slabs: 4
  473. # the amount of memory to use for the negative cache (used for DLV).
  474. # plain value in bytes or you can append k, m or G. default is "1Mb".
  475. # neg-cache-size: 1m
  476. # By default, for a number of zones a small default 'nothing here'
  477. # reply is built-in. Query traffic is thus blocked. If you
  478. # wish to serve such zone you can unblock them by uncommenting one
  479. # of the nodefault statements below.
  480. # You may also have to use domain-insecure: zone to make DNSSEC work,
  481. # unless you have your own trust anchors for this zone.
  482. # local-zone: "localhost." nodefault
  483. # local-zone: "127.in-addr.arpa." nodefault
  484. # 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
  485. # local-zone: "onion." nodefault
  486. # local-zone: "test." nodefault
  487. # local-zone: "invalid." nodefault
  488. # local-zone: "10.in-addr.arpa." nodefault
  489. # local-zone: "16.172.in-addr.arpa." nodefault
  490. # local-zone: "17.172.in-addr.arpa." nodefault
  491. # local-zone: "18.172.in-addr.arpa." nodefault
  492. # local-zone: "19.172.in-addr.arpa." nodefault
  493. # local-zone: "20.172.in-addr.arpa." nodefault
  494. # local-zone: "21.172.in-addr.arpa." nodefault
  495. # local-zone: "22.172.in-addr.arpa." nodefault
  496. # local-zone: "23.172.in-addr.arpa." nodefault
  497. # local-zone: "24.172.in-addr.arpa." nodefault
  498. # local-zone: "25.172.in-addr.arpa." nodefault
  499. # local-zone: "26.172.in-addr.arpa." nodefault
  500. # local-zone: "27.172.in-addr.arpa." nodefault
  501. # local-zone: "28.172.in-addr.arpa." nodefault
  502. # local-zone: "29.172.in-addr.arpa." nodefault
  503. # local-zone: "30.172.in-addr.arpa." nodefault
  504. # local-zone: "31.172.in-addr.arpa." nodefault
  505. # local-zone: "168.192.in-addr.arpa." nodefault
  506. # local-zone: "0.in-addr.arpa." nodefault
  507. # local-zone: "254.169.in-addr.arpa." nodefault
  508. # local-zone: "2.0.192.in-addr.arpa." nodefault
  509. # local-zone: "100.51.198.in-addr.arpa." nodefault
  510. # local-zone: "113.0.203.in-addr.arpa." nodefault
  511. # local-zone: "255.255.255.255.in-addr.arpa." nodefault
  512. # 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
  513. # local-zone: "d.f.ip6.arpa." nodefault
  514. # local-zone: "8.e.f.ip6.arpa." nodefault
  515. # local-zone: "9.e.f.ip6.arpa." nodefault
  516. # local-zone: "a.e.f.ip6.arpa." nodefault
  517. # local-zone: "b.e.f.ip6.arpa." nodefault
  518. # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
  519. # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
  520. # If unbound is running service for the local host then it is useful
  521. # to perform lan-wide lookups to the upstream, and unblock the
  522. # long list of local-zones above. If this unbound is a dns server
  523. # for a network of computers, disabled is better and stops information
  524. # leakage of local lan information.
  525. # unblock-lan-zones: no
  526. # The insecure-lan-zones option disables validation for
  527. # these zones, as if they were all listed as domain-insecure.
  528. # insecure-lan-zones: no
  529. # a number of locally served zones can be configured.
  530. # local-zone: <zone> <type>
  531. # local-data: "<resource record string>"
  532. # o deny serves local data (if any), else, drops queries.
  533. # o refuse serves local data (if any), else, replies with error.
  534. # o static serves local data, else, nxdomain or nodata answer.
  535. # o transparent gives local data, but resolves normally for other names
  536. # o redirect serves the zone data for any subdomain in the zone.
  537. # o nodefault can be used to normally resolve AS112 zones.
  538. # o typetransparent resolves normally for other types and other names
  539. # o inform acts like transparent, but logs client IP address
  540. # o inform_deny drops queries and logs client IP address
  541. # o always_transparent, always_refuse, always_nxdomain, resolve in
  542. # that way but ignore local data for that name
  543. # o noview breaks out of that view towards global local-zones.
  544. #
  545. # defaults are localhost address, reverse for 127.0.0.1 and ::1
  546. # and nxdomain for AS112 zones. If you configure one of these zones
  547. # the default content is omitted, or you can omit it with 'nodefault'.
  548. #
  549. # If you configure local-data without specifying local-zone, by
  550. # default a transparent local-zone is created for the data.
  551. #
  552. # You can add locally served data with
  553. # local-zone: "local." static
  554. # local-data: "mycomputer.local. IN A 192.0.2.51"
  555. # local-data: 'mytext.local TXT "content of text record"'
  556. #
  557. # You can override certain queries with
  558. # local-data: "adserver.example.com A 127.0.0.1"
  559. #
  560. # You can redirect a domain to a fixed address with
  561. # (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
  562. # local-zone: "example.com" redirect
  563. # local-data: "example.com A 192.0.2.3"
  564. #
  565. # Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
  566. # You can also add PTR records using local-data directly, but then
  567. # you need to do the reverse notation yourself.
  568. # local-data-ptr: "192.0.2.3 www.example.com"
  569. include: /etc/unbound/local.d/*.conf
  570. # tag a localzone with a list of tag names (in "" with spaces between)
  571. # local-zone-tag: "example.com" "tag2 tag3"
  572. # add a netblock specific override to a localzone, with zone type
  573. # local-zone-override: "example.com" 192.0.2.0/24 refuse
  574. # service clients over SSL (on the TCP sockets), with plain DNS inside
  575. # the SSL stream. Give the certificate to use and private key.
  576. # default is "" (disabled). requires restart to take effect.
  577. # tls-service-key: "/etc/unbound/unbound_server.key"
  578. # tls-service-pem: "/etc/unbound/unbound_server.pem"
  579. # tls-port: 853
  580. #
  581. # request upstream over SSL (with plain DNS inside the SSL stream).
  582. # Default is no. Can be turned on and off with unbound-control.
  583. # tls-upstream: no
  584. # Certificates used to authenticate connections made upstream.
  585. # tls-cert-bundle: ""
  586. # Add system certs to the cert bundle, from the Windows Cert Store
  587. # tls-win-cert: no
  588. # Also serve tls on these port numbers (eg. 443, ...), by listing
  589. # tls-additional-ports: portno for each of the port numbers.
  590. # DNS64 prefix. Must be specified when DNS64 is use.
  591. # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4.
  592. # dns64-prefix: 64:ff9b::0/96
  593. # ratelimit for uncached, new queries, this limits recursion effort.
  594. # ratelimiting is experimental, and may help against randomqueryflood.
  595. # if 0(default) it is disabled, otherwise state qps allowed per zone.
  596. # ratelimit: 0
  597. # ratelimits are tracked in a cache, size in bytes of cache (or k,m).
  598. # ratelimit-size: 4m
  599. # ratelimit cache slabs, reduces lock contention if equal to cpucount.
  600. # ratelimit-slabs: 4
  601. # 0 blocks when ratelimited, otherwise let 1/xth traffic through
  602. # ratelimit-factor: 10
  603. # what is considered a low rtt (ping time for upstream server), in msec
  604. # low-rtt: 45
  605. # select low rtt this many times out of 1000. 0 means the fast server
  606. # select is disabled. prefetches are not sped up.
  607. # low-rtt-permil: 0
  608. # override the ratelimit for a specific domain name.
  609. # give this setting multiple times to have multiple overrides.
  610. # ratelimit-for-domain: example.com 1000
  611. # override the ratelimits for all domains below a domain name
  612. # can give this multiple times, the name closest to the zone is used.
  613. # ratelimit-below-domain: com 1000
  614. # global query ratelimit for all ip addresses.
  615. # feature is experimental.
  616. # if 0(default) it is disabled, otherwise states qps allowed per ip address
  617. # ip-ratelimit: 0
  618. # ip ratelimits are tracked in a cache, size in bytes of cache (or k,m).
  619. # ip-ratelimit-size: 4m
  620. # ip ratelimit cache slabs, reduces lock contention if equal to cpucount.
  621. # ip-ratelimit-slabs: 4
  622. # 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through
  623. # ip-ratelimit-factor: 10
  624. # Specific options for ipsecmod. unbound needs to be configured with
  625. # --enable-ipsecmod for these to take effect.
  626. #
  627. # Enable or disable ipsecmod (it still needs to be defined in
  628. # module-config above). Can be used when ipsecmod needs to be
  629. # enabled/disabled via remote-control(below).
  630. # Fedora: module will be enabled on-demand by libreswan
  631. ipsecmod-enabled: no
  632. # Path to executable external hook. It must be defined when ipsecmod is
  633. # listed in module-config (above).
  634. # ipsecmod-hook: "./my_executable"
  635. ipsecmod-hook:/usr/libexec/ipsec/_unbound-hook
  636. # When enabled unbound will reply with SERVFAIL if the return value of
  637. # the ipsecmod-hook is not 0.
  638. # ipsecmod-strict: no
  639. #
  640. # Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY.
  641. # ipsecmod-max-ttl: 3600
  642. #
  643. # Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for
  644. # testing.
  645. # ipsecmod-ignore-bogus: no
  646. #
  647. # Domains for which ipsecmod will be triggered. If not defined (default)
  648. # all domains are treated as being whitelisted.
  649. # ipsecmod-whitelist: "libreswan.org"
  650. # ipsecmod-whitelist: "nlnetlabs.nl"
  651. # Python config section. To enable:
  652. # o use --with-pythonmodule to configure before compiling.
  653. # o list python in the module-config string (above) to enable.
  654. # o and give a python-script to run.
  655. python:
  656. # Script file to load
  657. # python-script: "/etc/unbound/ubmodule-tst.py"
  658. # Remote control config section.
  659. remote-control:
  660. # Enable remote control with unbound-control(8) here.
  661. # set up the keys and certificates with unbound-control-setup.
  662. # Note: required for unbound-munin package
  663. control-enable: yes
  664. # Set to no and use an absolute path as control-interface to use
  665. # a unix local named pipe for unbound-control.
  666. # control-use-cert: yes
  667. # what interfaces are listened to for remote control.
  668. # give 0.0.0.0 and ::0 to listen to all interfaces.
  669. # control-interface: 127.0.0.1
  670. # control-interface: ::1
  671. # port number for remote control operations.
  672. # control-port: 8953
  673. # unbound server key file.
  674. server-key-file: "/etc/unbound/unbound_server.key"
  675. # unbound server certificate file.
  676. server-cert-file: "/etc/unbound/unbound_server.pem"
  677. # unbound-control key file.
  678. control-key-file: "/etc/unbound/unbound_control.key"
  679. # unbound-control certificate file.
  680. control-cert-file: "/etc/unbound/unbound_control.pem"
  681. # Stub and Forward zones
  682. include: /etc/unbound/conf.d/*.conf
  683. # Stub zones.
  684. # Create entries like below, to make all queries for 'example.com' and
  685. # 'example.org' go to the given list of nameservers. list zero or more
  686. # nameservers by hostname or by ipaddress. If you set stub-prime to yes,
  687. # the list is treated as priming hints (default is no).
  688. # With stub-first yes, it attempts without the stub if it fails.
  689. # Consider adding domain-insecure: name and local-zone: name nodefault
  690. # to the server: section if the stub is a locally served zone.
  691. # stub-zone:
  692. # name: "example.com"
  693. # stub-addr: 192.0.2.68
  694. # stub-prime: no
  695. # stub-first: no
  696. # stub-tls-upstream: no
  697. # stub-zone:
  698. # name: "example.org"
  699. # stub-host: ns.example.com.
  700. # You can now also dynamically create and delete stub-zone's using
  701. # unbound-control stub_add domain.com 1.2.3.4 5.6.7.8
  702. # unbound-control stub_remove domain.com 1.2.3.4 5.6.7.8
  703. # Forward zones
  704. # Create entries like below, to make all queries for 'example.com' and
  705. # 'example.org' go to the given list of servers. These servers have to handle
  706. # recursion to other nameservers. List zero or more nameservers by hostname
  707. # or by ipaddress. Use an entry with name "." to forward all queries.
  708. # If you enable forward-first, it attempts without the forward if it fails.
  709. forward-zone:
  710. name: "int.example.com"
  711. forward-host: serverb.lab.example.com
  712. forward-host: serverc.lab.example.com
  713. forward-first: yes
  714. forward-zone:
  715. name: .
  716. forward-addr: 172.25.250.254
  717. # You can now also dynamically create and delete forward-zone's using
  718. # unbound-control forward_add domain.com 1.2.3.4 5.6.7.8
  719. # unbound-control forward_remove domain.com 1.2.3.4 5.6.7.8
  720. # Authority zones
  721. # The data for these zones is kept locally, from a file or downloaded.
  722. # The data can be served to downstream clients, or used instead of the
  723. # upstream (which saves a lookup to the upstream). The first example
  724. # has a copy of the root for local usage. The second serves example.org
  725. # authoritatively. zonefile: reads from file (and writes to it if you also
  726. # download it), master: fetches with AXFR and IXFR, or url to zonefile.
  727. auth-zone:
  728. name: "."
  729. for-downstream: no
  730. for-upstream: yes
  731. fallback-enabled: yes
  732. master: b.root-servers.net
  733. master: c.root-servers.net
  734. master: e.root-servers.net
  735. master: f.root-servers.net
  736. master: g.root-servers.net
  737. master: k.root-servers.net
  738. # auth-zone:
  739. # name: "example.org"
  740. # for-downstream: yes
  741. # for-upstream: yes
  742. # zonefile: "example.org.zone"
  743. # Views
  744. # Create named views. Name must be unique. Map views to requests using
  745. # the access-control-view option. Views can contain zero or more local-zone
  746. # and local-data options. Options from matching views will override global
  747. # options. Global options will be used if no matching view is found.
  748. # With view-first yes, it will try to answer using the global local-zone and
  749. # local-data elements if there is no view specific match.
  750. # view:
  751. # name: "viewname"
  752. # local-zone: "example.com" redirect
  753. # local-data: "example.com A 192.0.2.3"
  754. # local-data-ptr: "192.0.2.3 www.example.com"
  755. # view-first: no
  756. # view:
  757. # name: "anotherview"
  758. # local-zone: "example.com" refuse
  759. # Fedora: DNSCrypt support not enabled since it requires linking to
  760. # another crypto library
  761. #
  762. # DNSCrypt
  763. # Caveats:
  764. # 1. the keys/certs cannot be produced by unbound. You can use dnscrypt-wrapper
  765. # for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage
  766. # 2. dnscrypt channel attaches to an interface. you MUST set interfaces to
  767. # listen on `dnscrypt-port` with the follo0wing snippet:
  768. # server:
  769. # interface: 0.0.0.0@443
  770. # interface: ::0@443
  771. #
  772. # Finally, `dnscrypt` config has its own section.
  773. # dnscrypt:
  774. # dnscrypt-enable: yes
  775. # dnscrypt-port: 443
  776. # dnscrypt-provider: 2.dnscrypt-cert.example.com.
  777. # dnscrypt-secret-key: /path/unbound-conf/keys1/1.key
  778. # dnscrypt-secret-key: /path/unbound-conf/keys2/1.key
  779. # dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert
  780. # dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert
  781. # CacheDB
  782. # Enable external backend DB as auxiliary cache. Specify the backend name
  783. # (default is "testframe", which has no use other than for debugging and
  784. # testing) and backend-specific options. The 'cachedb' module must be
  785. # included in module-config.
  786. # cachedb:
  787. # backend: "testframe"
  788. # # secret seed string to calculate hashed keys
  789. # secret-seed: "default"
  790. # # For "redis" backend:
  791. # # redis server's IP address or host name
  792. # redis-server-host: 127.0.0.1
  793. # # redis server's TCP port
  794. # redis-server-port: 6379
  795. # # timeout (in ms) for communication with the redis server
  796. # redis-timeout: 100