unbound.conf 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  1. #
  2. # Example configuration file.
  3. #
  4. # See unbound.conf(5) man page, version 1.21.1.
  5. #
  6. # this is a comment.
  7. # Use this anywhere in the file to include other text into this file.
  8. #include: "otherfile.conf"
  9. # Use this anywhere in the file to include other text, that explicitly starts a
  10. # clause, into this file. Text after this directive needs to start a clause.
  11. #include-toplevel: "otherfile.conf"
  12. # The server clause sets the main parameters.
  13. server:
  14. # whitespace is not necessary, but looks cleaner.
  15. # verbosity number, 0 is least verbose. 1 is default.
  16. # verbosity: 1
  17. # print statistics to the log (for every thread) every N seconds.
  18. # Set to "" or 0 to disable. Default is disabled.
  19. # statistics-interval: 0
  20. # enable shm for stats, default no. if you enable also enable
  21. # statistics-interval, every time it also writes stats to the
  22. # shared memory segment keyed with shm-key.
  23. # shm-enable: no
  24. # shm for stats uses this key, and key+1 for the shared mem segment.
  25. # shm-key: 11777
  26. # enable cumulative statistics, without clearing them after printing.
  27. # statistics-cumulative: no
  28. # enable extended statistics (query types, answer codes, status)
  29. # printed from unbound-control. Default off, because of speed.
  30. # extended-statistics: no
  31. # Inhibits selected extended statistics (qtype, qclass, qopcode, rcode,
  32. # rpz-actions) from printing if their value is 0.
  33. # Default on.
  34. # statistics-inhibit-zero: yes
  35. # number of threads to create. 1 disables threading.
  36. # num-threads: 1
  37. # specify the interfaces to answer queries from by ip-address.
  38. # The default is to listen to localhost (127.0.0.1 and ::1).
  39. # specify 0.0.0.0 and ::0 to bind to all available interfaces.
  40. # specify every interface[@port] on a new 'interface:' labelled line.
  41. # The listen interfaces are not changed on reload, only on restart.
  42. # interface: 192.0.2.153
  43. # interface: 192.0.2.154
  44. # interface: 192.0.2.154@5003
  45. # interface: 2001:DB8::5
  46. # interface: eth0@5003
  47. interface: 127.0.0.1
  48. interface: ::1
  49. interface: vtnet0
  50. interface: lo1
  51. # enable this feature to copy the source address of queries to reply.
  52. # Socket options are not supported on all platforms. experimental.
  53. # interface-automatic: no
  54. # instead of the default port, open additional ports separated by
  55. # spaces when interface-automatic is enabled, by listing them here.
  56. # interface-automatic-ports: ""
  57. # port to answer queries from
  58. # port: 53
  59. # specify the interfaces to send outgoing queries to authoritative
  60. # server from by ip-address. If none, the default (all) interface
  61. # is used. Specify every interface on a 'outgoing-interface:' line.
  62. # outgoing-interface: 192.0.2.153
  63. # outgoing-interface: 2001:DB8::5
  64. # outgoing-interface: 2001:DB8::6
  65. # Specify a netblock to use remainder 64 bits as random bits for
  66. # upstream queries. Uses freebind option (Linux).
  67. # outgoing-interface: 2001:DB8::/64
  68. # Also (Linux:) ip -6 addr add 2001:db8::/64 dev lo
  69. # And: ip -6 route add local 2001:db8::/64 dev lo
  70. # And set prefer-ip6: yes to use the ip6 randomness from a netblock.
  71. # Set this to yes to prefer ipv6 upstream servers over ipv4.
  72. prefer-ip6: yes
  73. # Prefer ipv4 upstream servers, even if ipv6 is available.
  74. # prefer-ip4: no
  75. # number of ports to allocate per thread, determines the size of the
  76. # port range that can be open simultaneously. About double the
  77. # num-queries-per-thread, or, use as many as the OS will allow you.
  78. # outgoing-range: 4096
  79. # permit Unbound to use this port number or port range for
  80. # making outgoing queries, using an outgoing interface.
  81. # outgoing-port-permit: 32768
  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. # outgoing-port-avoid: "3200-3208"
  90. # number of outgoing simultaneous tcp buffers to hold per thread.
  91. # outgoing-num-tcp: 10
  92. # number of incoming simultaneous tcp buffers to hold per thread.
  93. # incoming-num-tcp: 10
  94. # buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
  95. # 0 is system default. Use 4m to catch query spikes for busy servers.
  96. # so-rcvbuf: 0
  97. # buffer size for UDP port 53 outgoing (SO_SNDBUF socket option).
  98. # 0 is system default. Use 4m to handle spikes on very busy servers.
  99. # so-sndbuf: 0
  100. # use SO_REUSEPORT to distribute queries over threads.
  101. # at extreme load it could be better to turn it off to distribute even.
  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: no
  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. # the value of the Differentiated Services Codepoint (DSCP)
  112. # in the differentiated services field (DS) of the outgoing
  113. # IP packets
  114. # ip-dscp: 0
  115. # EDNS reassembly buffer to advertise to UDP peers (the actual buffer
  116. # is set with msg-buffer-size).
  117. # edns-buffer-size: 1232
  118. # Maximum UDP response size (not applied to TCP response).
  119. # Suggested values are 512 to 4096. Default is 1232. 65536 disables it.
  120. # max-udp-size: 1232
  121. # max memory to use for stream(tcp and tls) waiting result buffers.
  122. # stream-wait-size: 4m
  123. # buffer size for handling DNS data. No messages larger than this
  124. # size can be sent or received, by UDP or TCP. In bytes.
  125. # msg-buffer-size: 65552
  126. # the amount of memory to use for the message cache.
  127. # plain value in bytes or you can append k, m or G. default is "4Mb".
  128. # msg-cache-size: 4m
  129. # the number of slabs to use for the message cache.
  130. # the number of slabs must be a power of 2.
  131. # more slabs reduce lock contention, but fragment memory usage.
  132. # msg-cache-slabs: 4
  133. # the number of queries that a thread gets to service.
  134. # num-queries-per-thread: 1024
  135. # if very busy, 50% queries run to completion, 50% get timeout in msec
  136. # jostle-timeout: 200
  137. # msec to wait before close of port on timeout UDP. 0 disables.
  138. # delay-close: 0
  139. # perform connect for UDP sockets to mitigate ICMP side channel.
  140. # udp-connect: yes
  141. # The number of retries, per upstream nameserver in a delegation, when
  142. # a throwaway response (also timeouts) is received.
  143. # outbound-msg-retry: 5
  144. # Hard limit on the number of outgoing queries Unbound will make while
  145. # resolving a name, making sure large NS sets do not loop.
  146. # It resets on query restarts (e.g., CNAME) and referrals.
  147. # max-sent-count: 32
  148. # Hard limit on the number of times Unbound is allowed to restart a
  149. # query upon encountering a CNAME record.
  150. # max-query-restarts: 11
  151. # msec for waiting for an unknown server to reply. Increase if you
  152. # are behind a slow satellite link, to eg. 1128.
  153. # unknown-server-time-limit: 376
  154. # msec before recursion replies are dropped. The work item continues.
  155. # discard-timeout: 1900
  156. # Max number of replies waiting for recursion per IP address.
  157. # wait-limit: 1000
  158. # Max replies waiting for recursion for IP address with cookie.
  159. # wait-limit-cookie: 10000
  160. # Apart from the default, the wait limit can be set for a netblock.
  161. # wait-limit-netblock: 192.0.2.0/24 50000
  162. # Apart from the default, the wait limit with cookie can be adjusted.
  163. # wait-limit-cookie-netblock: 192.0.2.0/24 50000
  164. # the amount of memory to use for the RRset cache.
  165. # plain value in bytes or you can append k, m or G. default is "4Mb".
  166. # rrset-cache-size: 4m
  167. # the number of slabs to use for the RRset cache.
  168. # the number of slabs must be a power of 2.
  169. # more slabs reduce lock contention, but fragment memory usage.
  170. # rrset-cache-slabs: 4
  171. # the time to live (TTL) value lower bound, in seconds. Default 0.
  172. # If more than an hour could easily give trouble due to stale data.
  173. # cache-min-ttl: 0
  174. # the time to live (TTL) value cap for RRsets and messages in the
  175. # cache. Items are not cached for longer. In seconds.
  176. # cache-max-ttl: 86400
  177. # the time to live (TTL) value cap for negative responses in the cache
  178. # cache-max-negative-ttl: 3600
  179. # the time to live (TTL) value lower bound, in seconds. Default 0.
  180. # For negative responses in the cache. If disabled, default,
  181. # cache-min-ttl applies if configured.
  182. # cache-min-negative-ttl: 0
  183. # the time to live (TTL) value for cached roundtrip times, lameness and
  184. # EDNS version information for hosts. In seconds.
  185. # infra-host-ttl: 900
  186. # minimum wait time for responses, increase if uplink is long. In msec.
  187. # infra-cache-min-rtt: 50
  188. # maximum wait time for responses. In msec.
  189. # infra-cache-max-rtt: 120000
  190. # enable to make server probe down hosts more frequently.
  191. # infra-keep-probing: no
  192. # the number of slabs to use for the Infrastructure cache.
  193. # the number of slabs must be a power of 2.
  194. # more slabs reduce lock contention, but fragment memory usage.
  195. # infra-cache-slabs: 4
  196. # the maximum number of hosts that are cached (roundtrip, EDNS, lame).
  197. # infra-cache-numhosts: 10000
  198. # define a number of tags here, use with local-zone, access-control,
  199. # interface-*.
  200. # repeat the define-tag statement to add additional tags.
  201. # define-tag: "tag1 tag2 tag3"
  202. # Enable IPv4, "yes" or "no".
  203. # do-ip4: yes
  204. # Enable IPv6, "yes" or "no".
  205. # do-ip6: yes
  206. # If running unbound on an IPv6-only host, domains that only have
  207. # IPv4 servers would become unresolveable. If NAT64 is available in
  208. # the network, unbound can use NAT64 to reach these servers with
  209. # the following option. This is NOT needed for enabling DNS64 on a
  210. # system that has IPv4 connectivity.
  211. # Consider also enabling prefer-ip6 to prefer native IPv6 connections
  212. # to nameservers.
  213. # do-nat64: no
  214. # NAT64 prefix. Defaults to using dns64-prefix value.
  215. # nat64-prefix: 64:ff9b::0/96
  216. # Enable UDP, "yes" or "no".
  217. # do-udp: yes
  218. # Enable TCP, "yes" or "no".
  219. # do-tcp: yes
  220. # upstream connections use TCP only (and no UDP), "yes" or "no"
  221. # useful for tunneling scenarios, default no.
  222. # tcp-upstream: no
  223. # upstream connections also use UDP (even if do-udp is no).
  224. # useful if if you want UDP upstream, but don't provide UDP downstream.
  225. # udp-upstream-without-downstream: no
  226. # Maximum segment size (MSS) of TCP socket on which the server
  227. # responds to queries. Default is 0, system default MSS.
  228. # tcp-mss: 0
  229. # Maximum segment size (MSS) of TCP socket for outgoing queries.
  230. # Default is 0, system default MSS.
  231. # outgoing-tcp-mss: 0
  232. # Idle TCP timeout, connection closed in milliseconds
  233. # tcp-idle-timeout: 30000
  234. # Enable EDNS TCP keepalive option.
  235. # edns-tcp-keepalive: no
  236. # Timeout for EDNS TCP keepalive, in msec. Overrides tcp-idle-timeout
  237. # if edns-tcp-keepalive is set.
  238. # edns-tcp-keepalive-timeout: 120000
  239. # UDP queries that have waited in the socket buffer for a long time
  240. # can be dropped. Default is 0, disabled. In seconds, such as 3.
  241. # sock-queue-timeout: 0
  242. # Use systemd socket activation for UDP, TCP, and control sockets.
  243. # use-systemd: no
  244. # Detach from the terminal, run in background, "yes" or "no".
  245. # Set the value to "no" when Unbound runs as systemd service.
  246. # do-daemonize: yes
  247. # control which clients are allowed to make (recursive) queries
  248. # to this server. Specify classless netblocks with /size and action.
  249. # By default everything is refused, except for localhost.
  250. # Choose deny (drop message), refuse (polite error reply),
  251. # allow (recursive ok), allow_setrd (recursive ok, rd bit is forced on),
  252. # allow_snoop (recursive and nonrecursive ok)
  253. # allow_cookie (allow UDP with valid cookie or stateful transport)
  254. # deny_non_local (drop queries unless can be answered from local-data)
  255. # refuse_non_local (like deny_non_local but polite error reply).
  256. access-control: 127.0.0.0/8 allow
  257. access-control: ::1 allow
  258. access-control: ::ffff:127.0.0.1 allow
  259. access-control: 192.168.0.1/24 allow
  260. access-control: fd00::1/24 allow
  261. # tag access-control with list of tags (in "" with spaces between)
  262. # Clients using this access control element use localzones that
  263. # are tagged with one of these tags.
  264. # access-control-tag: 192.0.2.0/24 "tag2 tag3"
  265. # set action for particular tag for given access control element.
  266. # if you have multiple tag values, the tag used to lookup the action
  267. # is the first tag match between access-control-tag and local-zone-tag
  268. # where "first" comes from the order of the define-tag values.
  269. # access-control-tag-action: 192.0.2.0/24 tag3 refuse
  270. # set redirect data for particular tag for access control element
  271. # access-control-tag-data: 192.0.2.0/24 tag2 "A 127.0.0.1"
  272. # Set view for access control element
  273. # access-control-view: 192.0.2.0/24 viewname
  274. # Similar to 'access-control:' but for interfaces.
  275. # Control which listening interfaces are allowed to accept (recursive)
  276. # queries for this server.
  277. # The specified interfaces should be the same as the ones specified in
  278. # 'interface:' followed by the action.
  279. # The actions are the same as 'access-control:' above.
  280. # By default all the interfaces configured are refused.
  281. # Note: any 'access-control*:' setting overrides all 'interface-*:'
  282. # settings for targeted clients.
  283. # interface-action: 192.0.2.153 allow
  284. # interface-action: 192.0.2.154 allow
  285. # interface-action: 192.0.2.154@5003 allow
  286. # interface-action: 2001:DB8::5 allow
  287. # interface-action: eth0@5003 allow
  288. interface-action: vtnet0 allow
  289. # Similar to 'access-control-tag:' but for interfaces.
  290. # Tag interfaces with a list of tags (in "" with spaces between).
  291. # Interfaces using these tags use localzones that are tagged with one
  292. # of these tags.
  293. # The specified interfaces should be the same as the ones specified in
  294. # 'interface:' followed by the list of tags.
  295. # Note: any 'access-control*:' setting overrides all 'interface-*:'
  296. # settings for targeted clients.
  297. # interface-tag: eth0@5003 "tag2 tag3"
  298. # Similar to 'access-control-tag-action:' but for interfaces.
  299. # Set action for particular tag for a given interface element.
  300. # If you have multiple tag values, the tag used to lookup the action
  301. # is the first tag match between interface-tag and local-zone-tag
  302. # where "first" comes from the order of the define-tag values.
  303. # The specified interfaces should be the same as the ones specified in
  304. # 'interface:' followed by the tag and action.
  305. # Note: any 'access-control*:' setting overrides all 'interface-*:'
  306. # settings for targeted clients.
  307. # interface-tag-action: eth0@5003 tag3 refuse
  308. # Similar to 'access-control-tag-data:' but for interfaces.
  309. # Set redirect data for a particular tag for an interface element.
  310. # The specified interfaces should be the same as the ones specified in
  311. # 'interface:' followed by the tag and the redirect data.
  312. # Note: any 'access-control*:' setting overrides all 'interface-*:'
  313. # settings for targeted clients.
  314. # interface-tag-data: eth0@5003 tag2 "A 127.0.0.1"
  315. # Similar to 'access-control-view:' but for interfaces.
  316. # Set view for an interface element.
  317. # The specified interfaces should be the same as the ones specified in
  318. # 'interface:' followed by the view name.
  319. # Note: any 'access-control*:' setting overrides all 'interface-*:'
  320. # settings for targeted clients.
  321. # interface-view: eth0@5003 viewname
  322. # if given, a chroot(2) is done to the given directory.
  323. # i.e. you can chroot to the working directory, for example,
  324. # for extra security, but make sure all files are in that directory.
  325. #
  326. # If chroot is enabled, you should pass the configfile (from the
  327. # commandline) as a full path from the original root. After the
  328. # chroot has been performed the now defunct portion of the config
  329. # file path is removed to be able to reread the config after a reload.
  330. #
  331. # All other file paths (working dir, logfile, roothints, and
  332. # key files) can be specified in several ways:
  333. # o as an absolute path relative to the new root.
  334. # o as a relative path to the working directory.
  335. # o as an absolute path relative to the original root.
  336. # In the last case the path is adjusted to remove the unused portion.
  337. #
  338. # The pid file can be absolute and outside of the chroot, it is
  339. # written just prior to performing the chroot and dropping permissions.
  340. #
  341. # Additionally, Unbound may need to access /dev/urandom (for entropy).
  342. # How to do this is specific to your OS.
  343. #
  344. # If you give "" no chroot is performed. The path must not end in a /.
  345. # chroot: "/usr/local/etc/unbound"
  346. # if given, user privileges are dropped (after binding port),
  347. # and the given username is assumed. Default is user "unbound".
  348. # If you give "" no privileges are dropped.
  349. # username: "unbound"
  350. # the working directory. The relative files in this config are
  351. # relative to this directory. If you give "" the working directory
  352. # is not changed.
  353. # If you give a server: directory: dir before include: file statements
  354. # then those includes can be relative to the working directory.
  355. # directory: "/usr/local/etc/unbound"
  356. # the log file, "" means log to stderr.
  357. # Use of this option sets use-syslog to "no".
  358. # logfile: ""
  359. # Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
  360. # log to. If yes, it overrides the logfile.
  361. # use-syslog: yes
  362. # Log identity to report. if empty, defaults to the name of argv[0]
  363. # (usually "unbound").
  364. # log-identity: ""
  365. # print UTC timestamp in ascii to logfile, default is epoch in seconds.
  366. # log-time-ascii: no
  367. # print one line with time, IP, name, type, class for every query.
  368. # log-queries: no
  369. # print one line per reply, with time, IP, name, type, class, rcode,
  370. # timetoresolve, fromcache and responsesize.
  371. # log-replies: no
  372. # log with tag 'query' and 'reply' instead of 'info' for
  373. # filtering log-queries and log-replies from the log.
  374. # log-tag-queryreply: no
  375. # log with destination address, port and type for log-replies.
  376. # log-destaddr: no
  377. # log the local-zone actions, like local-zone type inform is enabled
  378. # also for the other local zone types.
  379. # log-local-actions: no
  380. # print log lines that say why queries return SERVFAIL to clients.
  381. # log-servfail: no
  382. # the pid file. Can be an absolute path outside of chroot/work dir.
  383. # pidfile: "/usr/local/etc/unbound/unbound.pid"
  384. # file to read root hints from.
  385. # get one from https://www.internic.net/domain/named.cache
  386. # root-hints: ""
  387. # enable to not answer id.server and hostname.bind queries.
  388. hide-identity: yes
  389. # enable to not answer version.server and version.bind queries.
  390. hide-version: yes
  391. # enable to not answer trustanchor.unbound queries.
  392. # hide-trustanchor: no
  393. # enable to not set the User-Agent HTTP header.
  394. # hide-http-user-agent: no
  395. # the identity to report. Leave "" or default to return hostname.
  396. # identity: ""
  397. # the version to report. Leave "" or default to return package version.
  398. # version: ""
  399. # NSID identity (hex string, or "ascii_somestring"). default disabled.
  400. # nsid: "aabbccdd"
  401. # User-Agent HTTP header to use. Leave "" or default to use package name
  402. # and version.
  403. # http-user-agent: ""
  404. # the target fetch policy.
  405. # series of integers describing the policy per dependency depth.
  406. # The number of values in the list determines the maximum dependency
  407. # depth the recursor will pursue before giving up. Each integer means:
  408. # -1 : fetch all targets opportunistically,
  409. # 0: fetch on demand,
  410. # positive value: fetch that many targets opportunistically.
  411. # Enclose the list of numbers between quotes ("").
  412. # target-fetch-policy: "3 2 1 0 0"
  413. # Harden against very small EDNS buffer sizes.
  414. # harden-short-bufsize: yes
  415. # Harden against unseemly large queries.
  416. # harden-large-queries: no
  417. # Harden against out of zone rrsets, to avoid spoofing attempts.
  418. # harden-glue: yes
  419. # Harden against receiving dnssec-stripped data. If you turn it
  420. # off, failing to validate dnskey data for a trustanchor will
  421. # trigger insecure mode for that zone (like without a trustanchor).
  422. # Default on, which insists on dnssec data for trust-anchored zones.
  423. # harden-dnssec-stripped: yes
  424. # Harden against queries that fall under dnssec-signed nxdomain names.
  425. # harden-below-nxdomain: yes
  426. # Harden the referral path by performing additional queries for
  427. # infrastructure data. Validates the replies (if possible).
  428. # Default off, because the lookups burden the server. Experimental
  429. # implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
  430. # harden-referral-path: no
  431. # Harden against algorithm downgrade when multiple algorithms are
  432. # advertised in the DS record. If no, allows the weakest algorithm
  433. # to validate the zone.
  434. # harden-algo-downgrade: no
  435. # Harden against unknown records in the authority section and the
  436. # additional section.
  437. # harden-unknown-additional: no
  438. # Sent minimum amount of information to upstream servers to enhance
  439. # privacy. Only sent minimum required labels of the QNAME and set QTYPE
  440. # to A when possible.
  441. # qname-minimisation: yes
  442. # QNAME minimisation in strict mode. Do not fall-back to sending full
  443. # QNAME to potentially broken nameservers. A lot of domains will not be
  444. # resolvable when this option in enabled.
  445. # This option only has effect when qname-minimisation is enabled.
  446. # qname-minimisation-strict: no
  447. # Aggressive NSEC uses the DNSSEC NSEC chain to synthesize NXDOMAIN
  448. # and other denials, using information from previous NXDOMAINs answers.
  449. aggressive-nsec: yes
  450. # Use 0x20-encoded random bits in the query to foil spoof attempts.
  451. # This feature is an experimental implementation of draft dns-0x20.
  452. # use-caps-for-id: no
  453. # Domains (and domains in them) without support for dns-0x20 and
  454. # the fallback fails because they keep sending different answers.
  455. # caps-exempt: "licdn.com"
  456. # caps-exempt: "senderbase.org"
  457. # Enforce privacy of these addresses. Strips them away from answers.
  458. # It may cause DNSSEC validation to additionally mark it as bogus.
  459. # Protects against 'DNS Rebinding' (uses browser as network proxy).
  460. # Only 'private-domain' and 'local-data' names are allowed to have
  461. # these private addresses. No default.
  462. private-address: 10.0.0.0/8
  463. private-address: 172.16.0.0/12
  464. private-address: 192.168.0.0/16
  465. private-address: 169.254.0.0/16
  466. private-address: fd00::/8
  467. private-address: fe80::/10
  468. private-address: ::ffff:0:0/96
  469. # Allow the domain (and its subdomains) to contain private addresses.
  470. # local-data statements are allowed to contain private addresses too.
  471. # private-domain: "example.com"
  472. # If nonzero, unwanted replies are not only reported in statistics,
  473. # but also a running total is kept per thread. If it reaches the
  474. # threshold, a warning is printed and a defensive action is taken,
  475. # the cache is cleared to flush potential poison out of it.
  476. # A suggested value is 10000000, the default is 0 (turned off).
  477. # unwanted-reply-threshold: 0
  478. # Do not query the following addresses. No DNS queries are sent there.
  479. # List one address per entry. List classless netblocks with /size,
  480. # do-not-query-address: 127.0.0.1/8
  481. # do-not-query-address: ::1
  482. # if yes, the above default do-not-query-address entries are present.
  483. # if no, localhost can be queried (for testing and debugging).
  484. # do-not-query-localhost: yes
  485. # if yes, perform prefetching of almost expired message cache entries.
  486. prefetch: yes
  487. # if yes, perform key lookups adjacent to normal lookups.
  488. # prefetch-key: no
  489. # deny queries of type ANY with an empty response.
  490. # deny-any: no
  491. # if yes, Unbound rotates RRSet order in response.
  492. # rrset-roundrobin: yes
  493. # if yes, Unbound doesn't insert authority/additional sections
  494. # into response messages when those sections are not required.
  495. # minimal-responses: yes
  496. # true to disable DNSSEC lameness check in iterator.
  497. # disable-dnssec-lame-check: no
  498. # module configuration of the server. A string with identifiers
  499. # separated by spaces. Syntax: "[dns64] [validator] iterator"
  500. # most modules have to be listed at the beginning of the line,
  501. # except cachedb(just before iterator), and python (at the beginning,
  502. # or, just before the iterator).
  503. # module-config: "validator iterator"
  504. # File with trusted keys, kept uptodate using RFC5011 probes,
  505. # initial file like trust-anchor-file, then it stores metadata.
  506. # Use several entries, one per domain name, to track multiple zones.
  507. #
  508. # If you want to perform DNSSEC validation, run unbound-anchor before
  509. # you start Unbound (i.e. in the system boot scripts).
  510. # And then enable the auto-trust-anchor-file config item.
  511. # Please note usage of unbound-anchor root anchor is at your own risk
  512. # and under the terms of our LICENSE (see that file in the source).
  513. auto-trust-anchor-file: "/usr/local/etc/unbound/root.key"
  514. # trust anchor signaling sends a RFC8145 key tag query after priming.
  515. # trust-anchor-signaling: yes
  516. # Root key trust anchor sentinel (draft-ietf-dnsop-kskroll-sentinel)
  517. # root-key-sentinel: yes
  518. # File with trusted keys for validation. Specify more than one file
  519. # with several entries, one file per entry.
  520. # Zone file format, with DS and DNSKEY entries.
  521. # Note this gets out of date, use auto-trust-anchor-file please.
  522. # trust-anchor-file: ""
  523. # Trusted key for validation. DS or DNSKEY. specify the RR on a
  524. # single line, surrounded by "". TTL is ignored. class is IN default.
  525. # Note this gets out of date, use auto-trust-anchor-file please.
  526. # (These examples are from August 2007 and may not be valid anymore).
  527. # trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
  528. # trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
  529. # File with trusted keys for validation. Specify more than one file
  530. # with several entries, one file per entry. Like trust-anchor-file
  531. # but has a different file format. Format is BIND-9 style format,
  532. # the trusted-keys { name flag proto algo "key"; }; clauses are read.
  533. # you need external update procedures to track changes in keys.
  534. # trusted-keys-file: ""
  535. # Ignore chain of trust. Domain is treated as insecure.
  536. # domain-insecure: "example.com"
  537. # Override the date for validation with a specific fixed date.
  538. # Do not set this unless you are debugging signature inception
  539. # and expiration. "" or "0" turns the feature off. -1 ignores date.
  540. # val-override-date: ""
  541. # The time to live for bogus data, rrsets and messages. This avoids
  542. # some of the revalidation, until the time interval expires. in secs.
  543. # val-bogus-ttl: 60
  544. # The signature inception and expiration dates are allowed to be off
  545. # by 10% of the signature lifetime (expir-incep) from our local clock.
  546. # This leeway is capped with a minimum and a maximum. In seconds.
  547. # val-sig-skew-min: 3600
  548. # val-sig-skew-max: 86400
  549. # The maximum number the validator should restart validation with
  550. # another authority in case of failed validation.
  551. # val-max-restart: 5
  552. # Should additional section of secure message also be kept clean of
  553. # unsecure data. Useful to shield the users of this validator from
  554. # potential bogus data in the additional section. All unsigned data
  555. # in the additional section is removed from secure messages.
  556. # val-clean-additional: yes
  557. # Turn permissive mode on to permit bogus messages. Thus, messages
  558. # for which security checks failed will be returned to clients,
  559. # instead of SERVFAIL. It still performs the security checks, which
  560. # result in interesting log files and possibly the AD bit in
  561. # replies if the message is found secure. The default is off.
  562. # val-permissive-mode: no
  563. # Ignore the CD flag in incoming queries and refuse them bogus data.
  564. # Enable it if the only clients of Unbound are legacy servers (w2008)
  565. # that set CD but cannot validate themselves.
  566. # ignore-cd-flag: no
  567. # Disable the DO flag in outgoing requests. It is helpful for upstream
  568. # devices that cannot handle DNSSEC information. But do not enable it
  569. # otherwise, because it would stop DNSSEC validation.
  570. # disable-edns-do: no
  571. # Serve expired responses from cache, with serve-expired-reply-ttl in
  572. # the response, and then attempt to fetch the data afresh.
  573. # serve-expired: no
  574. #
  575. # Limit serving of expired responses to configured seconds after
  576. # expiration. 0 disables the limit.
  577. # serve-expired-ttl: 0
  578. #
  579. # Set the TTL of expired records to the serve-expired-ttl value after a
  580. # failed attempt to retrieve the record from upstream. This makes sure
  581. # that the expired records will be served as long as there are queries
  582. # for it.
  583. # serve-expired-ttl-reset: no
  584. #
  585. # TTL value to use when replying with expired data.
  586. # serve-expired-reply-ttl: 30
  587. #
  588. # Time in milliseconds before replying to the client with expired data.
  589. # This essentially enables the serve-stale behavior as specified in
  590. # RFC 8767 that first tries to resolve before
  591. # immediately responding with expired data. 0 disables this behavior.
  592. # A recommended value is 1800.
  593. # serve-expired-client-timeout: 0
  594. # Return the original TTL as received from the upstream name server rather
  595. # than the decrementing TTL as stored in the cache. Enabling this feature
  596. # does not impact cache expiry, it only changes the TTL Unbound embeds in
  597. # responses to queries. Note that enabling this feature implicitly disables
  598. # enforcement of the configured minimum and maximum TTL.
  599. # serve-original-ttl: no
  600. # Have the validator log failed validations for your diagnosis.
  601. # 0: off. 1: A line per failed user query. 2: With reason and bad IP.
  602. # val-log-level: 0
  603. # It is possible to configure NSEC3 maximum iteration counts per
  604. # keysize. Keep this table very short, as linear search is done.
  605. # A message with an NSEC3 with larger count is marked insecure.
  606. # List in ascending order the keysize and count values.
  607. # val-nsec3-keysize-iterations: "1024 150 2048 150 4096 150"
  608. # if enabled, ZONEMD verification failures do not block the zone.
  609. # zonemd-permissive-mode: no
  610. # instruct the auto-trust-anchor-file probing to add anchors after ttl.
  611. # add-holddown: 2592000 # 30 days
  612. # instruct the auto-trust-anchor-file probing to del anchors after ttl.
  613. # del-holddown: 2592000 # 30 days
  614. # auto-trust-anchor-file probing removes missing anchors after ttl.
  615. # If the value 0 is given, missing anchors are not removed.
  616. # keep-missing: 31622400 # 366 days
  617. # debug option that allows very small holddown times for key rollover,
  618. # otherwise the RFC mandates probe intervals must be at least 1 hour.
  619. # permit-small-holddown: no
  620. # the amount of memory to use for the key cache.
  621. # plain value in bytes or you can append k, m or G. default is "4Mb".
  622. # key-cache-size: 4m
  623. # the number of slabs to use for the key cache.
  624. # the number of slabs must be a power of 2.
  625. # more slabs reduce lock contention, but fragment memory usage.
  626. # key-cache-slabs: 4
  627. # the amount of memory to use for the negative cache.
  628. # plain value in bytes or you can append k, m or G. default is "1Mb".
  629. # neg-cache-size: 1m
  630. # By default, for a number of zones a small default 'nothing here'
  631. # reply is built-in. Query traffic is thus blocked. If you
  632. # wish to serve such zone you can unblock them by uncommenting one
  633. # of the nodefault statements below.
  634. # You may also have to use domain-insecure: zone to make DNSSEC work,
  635. # unless you have your own trust anchors for this zone.
  636. # local-zone: "localhost." nodefault
  637. # local-zone: "127.in-addr.arpa." nodefault
  638. # 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
  639. # local-zone: "home.arpa." nodefault
  640. # local-zone: "onion." nodefault
  641. # local-zone: "test." nodefault
  642. # local-zone: "invalid." nodefault
  643. # local-zone: "10.in-addr.arpa." nodefault
  644. # local-zone: "16.172.in-addr.arpa." nodefault
  645. # local-zone: "17.172.in-addr.arpa." nodefault
  646. # local-zone: "18.172.in-addr.arpa." nodefault
  647. # local-zone: "19.172.in-addr.arpa." nodefault
  648. # local-zone: "20.172.in-addr.arpa." nodefault
  649. # local-zone: "21.172.in-addr.arpa." nodefault
  650. # local-zone: "22.172.in-addr.arpa." nodefault
  651. # local-zone: "23.172.in-addr.arpa." nodefault
  652. # local-zone: "24.172.in-addr.arpa." nodefault
  653. # local-zone: "25.172.in-addr.arpa." nodefault
  654. # local-zone: "26.172.in-addr.arpa." nodefault
  655. # local-zone: "27.172.in-addr.arpa." nodefault
  656. # local-zone: "28.172.in-addr.arpa." nodefault
  657. # local-zone: "29.172.in-addr.arpa." nodefault
  658. # local-zone: "30.172.in-addr.arpa." nodefault
  659. # local-zone: "31.172.in-addr.arpa." nodefault
  660. # local-zone: "168.192.in-addr.arpa." nodefault
  661. # local-zone: "0.in-addr.arpa." nodefault
  662. # local-zone: "254.169.in-addr.arpa." nodefault
  663. # local-zone: "2.0.192.in-addr.arpa." nodefault
  664. # local-zone: "100.51.198.in-addr.arpa." nodefault
  665. # local-zone: "113.0.203.in-addr.arpa." nodefault
  666. # local-zone: "255.255.255.255.in-addr.arpa." nodefault
  667. # 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
  668. # local-zone: "d.f.ip6.arpa." nodefault
  669. # local-zone: "8.e.f.ip6.arpa." nodefault
  670. # local-zone: "9.e.f.ip6.arpa." nodefault
  671. # local-zone: "a.e.f.ip6.arpa." nodefault
  672. # local-zone: "b.e.f.ip6.arpa." nodefault
  673. # local-zone: "8.b.d.0.1.0.0.2.ip6.arpa." nodefault
  674. # And for 64.100.in-addr.arpa. to 127.100.in-addr.arpa.
  675. # Add example.com into ipset
  676. # local-zone: "example.com" ipset
  677. # If Unbound is running service for the local host then it is useful
  678. # to perform lan-wide lookups to the upstream, and unblock the
  679. # long list of local-zones above. If this Unbound is a dns server
  680. # for a network of computers, disabled is better and stops information
  681. # leakage of local lan information.
  682. # unblock-lan-zones: no
  683. # The insecure-lan-zones option disables validation for
  684. # these zones, as if they were all listed as domain-insecure.
  685. # insecure-lan-zones: no
  686. # a number of locally served zones can be configured.
  687. # local-zone: <zone> <type>
  688. # local-data: "<resource record string>"
  689. # o deny serves local data (if any), else, drops queries.
  690. # o refuse serves local data (if any), else, replies with error.
  691. # o static serves local data, else, nxdomain or nodata answer.
  692. # o transparent gives local data, but resolves normally for other names
  693. # o redirect serves the zone data for any subdomain in the zone.
  694. # o nodefault can be used to normally resolve AS112 zones.
  695. # o typetransparent resolves normally for other types and other names
  696. # o inform acts like transparent, but logs client IP address
  697. # o inform_deny drops queries and logs client IP address
  698. # o inform_redirect redirects queries and logs client IP address
  699. # o always_transparent, always_refuse, always_nxdomain, always_nodata,
  700. # always_deny resolve in that way but ignore local data for
  701. # that name
  702. # o block_a resolves all records normally but returns
  703. # NODATA for A queries and ignores local data for that name
  704. # o always_null returns 0.0.0.0 or ::0 for any name in the zone.
  705. # o noview breaks out of that view towards global local-zones.
  706. #
  707. # defaults are localhost address, reverse for 127.0.0.1 and ::1
  708. # and nxdomain for AS112 zones. If you configure one of these zones
  709. # the default content is omitted, or you can omit it with 'nodefault'.
  710. #
  711. # If you configure local-data without specifying local-zone, by
  712. # default a transparent local-zone is created for the data.
  713. #
  714. # You can add locally served data with
  715. # local-zone: "local." static
  716. # local-data: "mycomputer.local. IN A 192.0.2.51"
  717. # local-data: 'mytext.local TXT "content of text record"'
  718. #
  719. # You can override certain queries with
  720. # local-data: "adserver.example.com A 127.0.0.1"
  721. #
  722. # You can redirect a domain to a fixed address with
  723. # (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
  724. # local-zone: "example.com" redirect
  725. # local-data: "example.com A 192.0.2.3"
  726. #
  727. # Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
  728. # You can also add PTR records using local-data directly, but then
  729. # you need to do the reverse notation yourself.
  730. # local-data-ptr: "192.0.2.3 www.example.com"
  731. # tag a localzone with a list of tag names (in "" with spaces between)
  732. # local-zone-tag: "example.com" "tag2 tag3"
  733. # add a netblock specific override to a localzone, with zone type
  734. # local-zone-override: "example.com" 192.0.2.0/24 refuse
  735. # service clients over TLS (on the TCP sockets) with plain DNS inside
  736. # the TLS stream, and over HTTPS using HTTP/2 as specified in RFC8484.
  737. # Give the certificate to use and private key.
  738. # default is "" (disabled). requires restart to take effect.
  739. # tls-service-key: "path/to/privatekeyfile.key"
  740. # tls-service-pem: "path/to/publiccertfile.pem"
  741. # tls-port: 853
  742. # https-port: 443
  743. # cipher setting for TLSv1.2
  744. # tls-ciphers: "DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256"
  745. # cipher setting for TLSv1.3
  746. # tls-ciphersuites: "TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_8_SHA256:TLS_AES_128_CCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256"
  747. # Pad responses to padded queries received over TLS
  748. # pad-responses: yes
  749. # Padded responses will be padded to the closest multiple of this size.
  750. # pad-responses-block-size: 468
  751. # Use the SNI extension for TLS connections. Default is yes.
  752. # Changing the value requires a reload.
  753. # tls-use-sni: yes
  754. # Add the secret file for TLS Session Ticket.
  755. # Secret file must be 80 bytes of random data.
  756. # First key use to encrypt and decrypt TLS session tickets.
  757. # Other keys use to decrypt only.
  758. # requires restart to take effect.
  759. # tls-session-ticket-keys: "path/to/secret_file1"
  760. # tls-session-ticket-keys: "path/to/secret_file2"
  761. # request upstream over TLS (with plain DNS inside the TLS stream).
  762. # Default is no. Can be turned on and off with unbound-control.
  763. # tls-upstream: no
  764. # Certificates used to authenticate connections made upstream.
  765. tls-cert-bundle: "/usr/local/share/certs/ca-root-nss.crt"
  766. # Add system certs to the cert bundle, from the Windows Cert Store
  767. # tls-win-cert: no
  768. # and on other systems, the default openssl certificates
  769. tls-system-cert: yes
  770. # Pad queries over TLS upstreams
  771. # pad-queries: yes
  772. # Padded queries will be padded to the closest multiple of this size.
  773. # pad-queries-block-size: 128
  774. # Also serve tls on these port numbers (eg. 443, ...), by listing
  775. # tls-additional-port: portno for each of the port numbers.
  776. # HTTP endpoint to provide DNS-over-HTTPS service on.
  777. # http-endpoint: "/dns-query"
  778. # HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS value to use.
  779. # http-max-streams: 100
  780. # Maximum number of bytes used for all HTTP/2 query buffers.
  781. # http-query-buffer-size: 4m
  782. # Maximum number of bytes used for all HTTP/2 response buffers.
  783. # http-response-buffer-size: 4m
  784. # Set TCP_NODELAY socket option on sockets used for DNS-over-HTTPS
  785. # service.
  786. # http-nodelay: yes
  787. # Disable TLS for DNS-over-HTTP downstream service.
  788. # http-notls-downstream: no
  789. # The interfaces that use these listed port numbers will support and
  790. # expect PROXYv2. For UDP and TCP/TLS interfaces.
  791. # proxy-protocol-port: portno for each of the port numbers.
  792. # DNS64 prefix. Must be specified when DNS64 is use.
  793. # Enable dns64 in module-config. Used to synthesize IPv6 from IPv4.
  794. # dns64-prefix: 64:ff9b::0/96
  795. # DNS64 ignore AAAA records for these domains and use A instead.
  796. # dns64-ignore-aaaa: "example.com"
  797. # ratelimit for uncached, new queries, this limits recursion effort.
  798. # ratelimiting is experimental, and may help against randomqueryflood.
  799. # if 0(default) it is disabled, otherwise state qps allowed per zone.
  800. # ratelimit: 0
  801. # ratelimits are tracked in a cache, size in bytes of cache (or k,m).
  802. # ratelimit-size: 4m
  803. # ratelimit cache slabs, reduces lock contention if equal to cpucount.
  804. # ratelimit-slabs: 4
  805. # 0 blocks when ratelimited, otherwise let 1/xth traffic through
  806. # ratelimit-factor: 10
  807. # Aggressive rate limit when the limit is reached and until demand has
  808. # decreased in a 2 second rate window.
  809. # ratelimit-backoff: no
  810. # override the ratelimit for a specific domain name.
  811. # give this setting multiple times to have multiple overrides.
  812. # ratelimit-for-domain: example.com 1000
  813. # override the ratelimits for all domains below a domain name
  814. # can give this multiple times, the name closest to the zone is used.
  815. # ratelimit-below-domain: com 1000
  816. # global query ratelimit for all ip addresses.
  817. # feature is experimental.
  818. # if 0(default) it is disabled, otherwise states qps allowed per ip address
  819. # ip-ratelimit: 0
  820. # global query ratelimit for all ip addresses with a valid DNS Cookie.
  821. # feature is experimental.
  822. # if 0(default) it is disabled, otherwise states qps allowed per ip address
  823. # useful in combination with 'allow_cookie'.
  824. # If used, suggested to be higher than ip-ratelimit, tenfold.
  825. # ip-ratelimit-cookie: 0
  826. # ip ratelimits are tracked in a cache, size in bytes of cache (or k,m).
  827. # ip-ratelimit-size: 4m
  828. # ip ratelimit cache slabs, reduces lock contention if equal to cpucount.
  829. # ip-ratelimit-slabs: 4
  830. # 0 blocks when ip is ratelimited, otherwise let 1/xth traffic through
  831. # ip-ratelimit-factor: 10
  832. # Aggressive rate limit when the limit is reached and until demand has
  833. # decreased in a 2 second rate window.
  834. # ip-ratelimit-backoff: no
  835. # Limit the number of connections simultaneous from a netblock
  836. # tcp-connection-limit: 192.0.2.0/24 12
  837. # select from the fastest servers this many times out of 1000. 0 means
  838. # the fast server select is disabled. prefetches are not sped up.
  839. # fast-server-permil: 0
  840. # the number of servers that will be used in the fast server selection.
  841. # fast-server-num: 3
  842. # reply to requests containing DNS Cookies as specified in RFC 7873 and RFC 9018.
  843. # answer-cookie: no
  844. # secret for DNS Cookie generation.
  845. # useful for anycast deployments.
  846. # example value "000102030405060708090a0b0c0d0e0f".
  847. # cookie-secret: <128 bit random hex string>
  848. # File with cookie secrets, the 'cookie-secret:' option is ignored
  849. # and the file can be managed to have staging and active secrets
  850. # with remote control commands. Disabled with "". Default is "".
  851. # cookie-secret-file: "/usr/local/etc/unbound_cookiesecrets.txt"
  852. # Enable to attach Extended DNS Error codes (RFC8914) to responses.
  853. # ede: no
  854. # Enable to attach an Extended DNS Error (RFC8914) Code 3 - Stale
  855. # Answer as EDNS0 option to expired responses.
  856. # Note that the ede option above needs to be enabled for this to work.
  857. # ede-serve-expired: no
  858. # Specific options for ipsecmod. Unbound needs to be configured with
  859. # --enable-ipsecmod for these to take effect.
  860. #
  861. # Enable or disable ipsecmod (it still needs to be defined in
  862. # module-config above). Can be used when ipsecmod needs to be
  863. # enabled/disabled via remote-control(below).
  864. # ipsecmod-enabled: yes
  865. #
  866. # Path to executable external hook. It must be defined when ipsecmod is
  867. # listed in module-config (above).
  868. # ipsecmod-hook: "./my_executable"
  869. #
  870. # When enabled Unbound will reply with SERVFAIL if the return value of
  871. # the ipsecmod-hook is not 0.
  872. # ipsecmod-strict: no
  873. #
  874. # Maximum time to live (TTL) for cached A/AAAA records with IPSECKEY.
  875. # ipsecmod-max-ttl: 3600
  876. #
  877. # Reply with A/AAAA even if the relevant IPSECKEY is bogus. Mainly used for
  878. # testing.
  879. # ipsecmod-ignore-bogus: no
  880. #
  881. # Domains for which ipsecmod will be triggered. If not defined (default)
  882. # all domains are treated as being allowed.
  883. # ipsecmod-allow: "example.com"
  884. # ipsecmod-allow: "nlnetlabs.nl"
  885. # Timeout for REUSE entries in milliseconds.
  886. # tcp-reuse-timeout: 60000
  887. # Max number of queries on a reuse connection.
  888. # max-reuse-tcp-queries: 200
  889. # Timeout in milliseconds for TCP queries to auth servers.
  890. # tcp-auth-query-timeout: 3000
  891. # Python config section. To enable:
  892. # o use --with-pythonmodule to configure before compiling.
  893. # o list python in the module-config string (above) to enable.
  894. # It can be at the start, it gets validated results, or just before
  895. # the iterator and process before DNSSEC validation.
  896. # o and give a python-script to run.
  897. python:
  898. # Script file to load
  899. # python-script: "/usr/local/etc/unbound/ubmodule-tst.py"
  900. # Dynamic library config section. To enable:
  901. # o use --with-dynlibmodule to configure before compiling.
  902. # o list dynlib in the module-config string (above) to enable.
  903. # It can be placed anywhere, the dynlib module is only a very thin wrapper
  904. # to load modules dynamically.
  905. # o and give a dynlib-file to run. If more than one dynlib entry is listed in
  906. # the module-config then you need one dynlib-file per instance.
  907. dynlib:
  908. # Script file to load
  909. # dynlib-file: "/usr/local/etc/unbound/dynlib.so"
  910. # Remote control config section.
  911. remote-control:
  912. # Enable remote control with unbound-control(8) here.
  913. # set up the keys and certificates with unbound-control-setup.
  914. control-enable: yes
  915. # what interfaces are listened to for remote control.
  916. # give 0.0.0.0 and ::0 to listen to all interfaces.
  917. # set to an absolute path to use a unix local name pipe, certificates
  918. # are not used for that, so key and cert files need not be present.
  919. control-interface: 127.0.0.1
  920. control-interface: ::1
  921. # port number for remote control operations.
  922. control-port: 8953
  923. # for localhost, you can disable use of TLS by setting this to "no"
  924. # For local sockets this option is ignored, and TLS is not used.
  925. control-use-cert: "no"
  926. # Unbound server key file.
  927. # server-key-file: "/usr/local/etc/unbound/unbound_server.key"
  928. # Unbound server certificate file.
  929. # server-cert-file: "/usr/local/etc/unbound/unbound_server.pem"
  930. # unbound-control key file.
  931. # control-key-file: "/usr/local/etc/unbound/unbound_control.key"
  932. # unbound-control certificate file.
  933. # control-cert-file: "/usr/local/etc/unbound/unbound_control.pem"
  934. # Stub zones.
  935. # Create entries like below, to make all queries for 'example.com' and
  936. # 'example.org' go to the given list of nameservers. list zero or more
  937. # nameservers by hostname or by ipaddress. If you set stub-prime to yes,
  938. # the list is treated as priming hints (default is no).
  939. # With stub-first yes, it attempts without the stub if it fails.
  940. # Consider adding domain-insecure: name and local-zone: name nodefault
  941. # to the server: section if the stub is a locally served zone.
  942. # stub-zone:
  943. # name: "example.com"
  944. # stub-addr: 192.0.2.68
  945. # stub-prime: no
  946. # stub-first: no
  947. # stub-tcp-upstream: no
  948. # stub-tls-upstream: no
  949. # stub-no-cache: no
  950. # stub-zone:
  951. # name: "example.org"
  952. # stub-host: ns.example.com.
  953. # Forward zones
  954. # Create entries like below, to make all queries for 'example.com' and
  955. # 'example.org' go to the given list of servers. These servers have to handle
  956. # recursion to other nameservers. List zero or more nameservers by hostname
  957. # or by ipaddress. Use an entry with name "." to forward all queries.
  958. # If you enable forward-first, it attempts without the forward if it fails.
  959. # forward-zone:
  960. # name: "example.com"
  961. # forward-addr: 192.0.2.68
  962. # forward-addr: 192.0.2.73@5355 # forward to port 5355.
  963. # forward-first: no
  964. # forward-tcp-upstream: no
  965. # forward-tls-upstream: no
  966. # forward-no-cache: no
  967. # forward-zone:
  968. # name: "example.org"
  969. # forward-host: fwd.example.com
  970. # Authority zones
  971. # The data for these zones is kept locally, from a file or downloaded.
  972. # The data can be served to downstream clients, or used instead of the
  973. # upstream (which saves a lookup to the upstream). The first example
  974. # has a copy of the root for local usage. The second serves example.org
  975. # authoritatively. zonefile: reads from file (and writes to it if you also
  976. # download it), primary: fetches with AXFR and IXFR, or url to zonefile.
  977. # With allow-notify: you can give additional (apart from primaries and urls)
  978. # sources of notifies.
  979. # auth-zone:
  980. # name: "."
  981. # primary: 170.247.170.2 # b.root-servers.net
  982. # primary: 192.33.4.12 # c.root-servers.net
  983. # primary: 199.7.91.13 # d.root-servers.net
  984. # primary: 192.5.5.241 # f.root-servers.net
  985. # primary: 192.112.36.4 # g.root-servers.net
  986. # primary: 193.0.14.129 # k.root-servers.net
  987. # primary: 192.0.47.132 # xfr.cjr.dns.icann.org
  988. # primary: 192.0.32.132 # xfr.lax.dns.icann.org
  989. # primary: 2801:1b8:10::b # b.root-servers.net
  990. # primary: 2001:500:2::c # c.root-servers.net
  991. # primary: 2001:500:2d::d # d.root-servers.net
  992. # primary: 2001:500:2f::f # f.root-servers.net
  993. # primary: 2001:500:12::d0d # g.root-servers.net
  994. # primary: 2001:7fd::1 # k.root-servers.net
  995. # primary: 2620:0:2830:202::132 # xfr.cjr.dns.icann.org
  996. # primary: 2620:0:2d0:202::132 # xfr.lax.dns.icann.org
  997. # fallback-enabled: yes
  998. # for-downstream: no
  999. # for-upstream: yes
  1000. # auth-zone:
  1001. # name: "example.org"
  1002. # for-downstream: yes
  1003. # for-upstream: yes
  1004. # zonemd-check: no
  1005. # zonemd-reject-absence: no
  1006. # zonefile: "example.org.zone"
  1007. # Views
  1008. # Create named views. Name must be unique. Map views to requests using
  1009. # the access-control-view option. Views can contain zero or more local-zone
  1010. # and local-data options. Options from matching views will override global
  1011. # options. Global options will be used if no matching view is found.
  1012. # With view-first yes, it will try to answer using the global local-zone and
  1013. # local-data elements if there is no view specific match.
  1014. # view:
  1015. # name: "viewname"
  1016. # local-zone: "example.com" redirect
  1017. # local-data: "example.com A 192.0.2.3"
  1018. # local-data-ptr: "192.0.2.3 www.example.com"
  1019. # view-first: no
  1020. # view:
  1021. # name: "anotherview"
  1022. # local-zone: "example.com" refuse
  1023. # DNSCrypt
  1024. # To enable, use --enable-dnscrypt to configure before compiling.
  1025. # Caveats:
  1026. # 1. the keys/certs cannot be produced by Unbound. You can use dnscrypt-wrapper
  1027. # for this: https://github.com/cofyc/dnscrypt-wrapper/blob/master/README.md#usage
  1028. # 2. dnscrypt channel attaches to an interface. you MUST set interfaces to
  1029. # listen on `dnscrypt-port` with the follo0wing snippet:
  1030. # server:
  1031. # interface: 0.0.0.0@443
  1032. # interface: ::0@443
  1033. #
  1034. # Finally, `dnscrypt` config has its own section.
  1035. # dnscrypt:
  1036. # dnscrypt-enable: yes
  1037. # dnscrypt-port: 443
  1038. # dnscrypt-provider: 2.dnscrypt-cert.example.com.
  1039. # dnscrypt-secret-key: /path/unbound-conf/keys1/1.key
  1040. # dnscrypt-secret-key: /path/unbound-conf/keys2/1.key
  1041. # dnscrypt-provider-cert: /path/unbound-conf/keys1/1.cert
  1042. # dnscrypt-provider-cert: /path/unbound-conf/keys2/1.cert
  1043. # CacheDB
  1044. # External backend DB as auxiliary cache.
  1045. # To enable, use --enable-cachedb to configure before compiling.
  1046. # Specify the backend name
  1047. # (default is "testframe", which has no use other than for debugging and
  1048. # testing) and backend-specific options. The 'cachedb' module must be
  1049. # included in module-config, just before the iterator module.
  1050. # cachedb:
  1051. # backend: "testframe"
  1052. # # secret seed string to calculate hashed keys
  1053. # secret-seed: "default"
  1054. # # if the backend should be read from, but not written to.
  1055. # cachedb-no-store: no
  1056. # # if the cachedb should be checked before a serve-expired response is
  1057. # # given, when serve-expired is enabled.
  1058. # cachedb-check-when-serve-expired: yes
  1059. #
  1060. # # For "redis" backend:
  1061. # # (to enable, use --with-libhiredis to configure before compiling)
  1062. # # redis server's IP address or host name
  1063. # redis-server-host: 127.0.0.1
  1064. # # redis server's TCP port
  1065. # redis-server-port: 6379
  1066. # # if the server uses a unix socket, set its path, or "" when not used.
  1067. # # redis-server-path: "/var/lib/redis/redis-server.sock"
  1068. # # if the server uses an AUTH password, specify here, or "" when not used.
  1069. # # redis-server-password: ""
  1070. # # timeout (in ms) for communication with the redis server
  1071. # redis-timeout: 100
  1072. # # set timeout on redis records based on DNS response TTL
  1073. # redis-expire-records: no
  1074. # # redis logical database to use, 0 is the default database.
  1075. # redis-logical-db: 0
  1076. # IPSet
  1077. # Add specify domain into set via ipset.
  1078. # To enable:
  1079. # o use --enable-ipset to configure before compiling;
  1080. # o Unbound then needs to run as root user.
  1081. # ipset:
  1082. # # set name for ip v4 addresses
  1083. # name-v4: "list-v4"
  1084. # # set name for ip v6 addresses
  1085. # name-v6: "list-v6"
  1086. #
  1087. # Dnstap logging support, if compiled in by using --enable-dnstap to configure.
  1088. # To enable, set the dnstap-enable to yes and also some of
  1089. # dnstap-log-..-messages to yes. And select an upstream log destination, by
  1090. # socket path, TCP or TLS destination.
  1091. # dnstap:
  1092. # dnstap-enable: no
  1093. # # if set to yes frame streams will be used in bidirectional mode
  1094. # dnstap-bidirectional: yes
  1095. # dnstap-socket-path: ""
  1096. # # if "" use the unix socket in dnstap-socket-path, otherwise,
  1097. # # set it to "IPaddress[@port]" of the destination.
  1098. # dnstap-ip: ""
  1099. # # if set to yes if you want to use TLS to dnstap-ip, no for TCP.
  1100. # dnstap-tls: yes
  1101. # # name for authenticating the upstream server. or "" disabled.
  1102. # dnstap-tls-server-name: ""
  1103. # # if "", it uses the cert bundle from the main Unbound config.
  1104. # dnstap-tls-cert-bundle: ""
  1105. # # key file for client authentication, or "" disabled.
  1106. # dnstap-tls-client-key-file: ""
  1107. # # cert file for client authentication, or "" disabled.
  1108. # dnstap-tls-client-cert-file: ""
  1109. # dnstap-send-identity: no
  1110. # dnstap-send-version: no
  1111. # # if "" it uses the hostname.
  1112. # dnstap-identity: ""
  1113. # # if "" it uses the package version.
  1114. # dnstap-version: ""
  1115. # # log only 1/N messages, if 0 it is disabled. default 0.
  1116. # dnstap-sample-rate: 0
  1117. # dnstap-log-resolver-query-messages: no
  1118. # dnstap-log-resolver-response-messages: no
  1119. # dnstap-log-client-query-messages: no
  1120. # dnstap-log-client-response-messages: no
  1121. # dnstap-log-forwarder-query-messages: no
  1122. # dnstap-log-forwarder-response-messages: no
  1123. # Response Policy Zones
  1124. # RPZ policies. Applied in order of configuration. Any match from an earlier
  1125. # RPZ zone will terminate the RPZ lookup. QNAME, Response IP
  1126. # Address, nsdname, nsip and clientip triggers are supported. Supported
  1127. # actions are: NXDOMAIN, NODATA, PASSTHRU, DROP, Local Data, tcp-only
  1128. # and drop. Policies can be loaded from a file, or using zone
  1129. # transfer, or using HTTP. The respip module needs to be added
  1130. # to the module-config, e.g.: module-config: "respip validator iterator".
  1131. # rpz:
  1132. # name: "rpz.example.com"
  1133. # zonefile: "rpz.example.com"
  1134. # primary: 192.0.2.0
  1135. # allow-notify: 192.0.2.0/32
  1136. # url: http://www.example.com/rpz.example.org.zone
  1137. # rpz-action-override: cname
  1138. # rpz-cname-override: www.example.org
  1139. # rpz-log: yes
  1140. # rpz-log-name: "example policy"
  1141. # rpz-signal-nxdomain-ra: no
  1142. # for-downstream: no
  1143. # tags: "example"