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