unbound.conf.j2 37 KB

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