source: hybrid/branches/releng-10/nanobsd/files/var/unbound/unbound.conf@ 12940

Last change on this file since 12940 was 12940, checked in by huub, 10 years ago

forward-zone sample voor unbound config

File size: 10.7 KB
Line 
1## Authoritative, validating, recursive caching DNS
2## unbound.conf -- https://calomel.org
3#
4server:
5
6 directory: /var/unbound
7 username: unbound
8 chroot: /var/unbound
9 logfile: /var/unbound/unbound.log
10 pidfile: /var/run/unbound.pid
11 auto-trust-anchor-file: /var/unbound/root.key
12
13
14 # log verbosity
15 verbosity: 1
16
17 # specify the interfaces to answer queries from by ip-address. The default
18 # is to listen to localhost (127.0.0.1 and ::1). specify 0.0.0.0 and ::0 to
19 # bind to all available interfaces. specify every interface[@port] on a new
20 # 'interface:' labeled line. The listen interfaces are not changed on
21 # reload, only on restart.
22 interface: 0.0.0.0
23
24 # port to answer queries from
25 port: 53
26
27 # Enable IPv4, "yes" or "no".
28 do-ip4: yes
29
30 # Enable IPv6, "yes" or "no".
31 do-ip6: no
32
33 # Enable UDP, "yes" or "no".
34 do-udp: yes
35
36 # Enable TCP, "yes" or "no". If TCP is not needed, Unbound is actually
37 # quicker to resolve as the functions related to TCP checks are not done.i
38 # NOTE: you may need tcp enabled to get the DNSSEC results from *.edu domains
39 # due to their size.
40 do-tcp: yes
41
42 # control which client ips are allowed to make (recursive) queries to this
43 # server. Specify classless netblocks with /size and action. By default
44 # everything is refused, except for localhost. Choose deny (drop message),
45 # refuse (polite error reply), allow (recursive ok), allow_snoop (recursive
46 # and nonrecursive ok)
47 access-control: 127.0.0.0/8 allow
48 access-control: 172.16.0.0/12 allow
49
50 # Read the root hints from this file. Default is nothing, using built in
51 # hints for the IN class. The file has the format of zone files, with root
52 # nameserver names and addresses only. The default may become outdated,
53 # when servers change, therefore it is good practice to use a root-hints
54 # file. get one from ftp://FTP.INTERNIC.NET/domain/named.cache
55 root-hints: "/var/unbound/root.hints"
56
57 # enable to not answer id.server and hostname.bind queries.
58 hide-identity: yes
59
60 # enable to not answer version.server and version.bind queries.
61 hide-version: yes
62
63 # Will trust glue only if it is within the servers authority.
64 # Harden against out of zone rrsets, to avoid spoofing attempts.
65 # Hardening queries multiple name servers for the same data to make
66 # spoofing significantly harder and does not mandate dnssec.
67 harden-glue: yes
68
69 # Require DNSSEC data for trust-anchored zones, if such data is absent, the
70 # zone becomes bogus. Harden against receiving dnssec-stripped data. If you
71 # turn it off, failing to validate dnskey data for a trustanchor will trigger
72 # insecure mode for that zone (like without a trustanchor). Default on,
73 # which insists on dnssec data for trust-anchored zones.
74 harden-dnssec-stripped: yes
75
76 # Use 0x20-encoded random bits in the query to foil spoof attempts.
77 # http://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00
78 # While upper and lower case letters are allowed in domain names, no significance
79 # is attached to the case. That is, two names with the same spelling but
80 # different case are to be treated as if identical. This means calomel.org is the
81 # same as CaLoMeL.Org which is the same as CALOMEL.ORG.
82 use-caps-for-id: yes
83
84 # the time to live (TTL) value lower bound, in seconds. Default 0.
85 # If more than an hour could easily give trouble due to stale data.
86 cache-min-ttl: 3600
87
88 # the time to live (TTL) value cap for RRsets and messages in the
89 # cache. Items are not cached for longer. In seconds.
90 cache-max-ttl: 86400
91
92 # perform prefetching of close to expired message cache entries. If a client
93 # requests the dns lookup and the TTL of the cached hostname is going to
94 # expire in less than 10% of its TTL, unbound will (1st) return the ip of the
95 # host to the client and (2nd) pre-fetch the dns request from the remote dns
96 # server. This method has been shown to increase the amount of cached hits by
97 # local clients by 10% on average.
98 prefetch: yes
99
100 # number of threads to create. 1 disables threading. This should equal the number
101 # of CPU cores in the machine. Our example machine has 4 CPU cores.
102 num-threads: 1
103
104
105 ## Unbound Optimization and Speed Tweaks ###
106
107 # the number of slabs to use for cache and must be a power of 2 times the
108 # number of num-threads set above. more slabs reduce lock contention, but
109 # fragment memory usage.
110 msg-cache-slabs: 8
111 rrset-cache-slabs: 8
112 infra-cache-slabs: 8
113 key-cache-slabs: 8
114
115 # Increase the memory size of the cache. Use roughly twice as much rrset cache
116 # memory as you use msg cache memory. Due to malloc overhead, the total memory
117 # usage is likely to rise to double (or 2.5x) the total cache memory. The test
118 # box has 4gig of ram so 256meg for rrset allows a lot of room for cacheed objects.
119 rrset-cache-size: 64m
120 msg-cache-size: 32m
121
122 # buffer size for UDP port 53 incoming (SO_RCVBUF socket option). This sets
123 # the kernel buffer larger so that no messages are lost in spikes in the traffic.
124 so-rcvbuf: 1m
125
126 ## Unbound Optimization and Speed Tweaks ###
127
128
129 # Enforce privacy of these addresses. Strips them away from answers. It may
130 # cause DNSSEC validation to additionally mark it as bogus. Protects against
131 # 'DNS Rebinding' (uses browser as network proxy). Only 'private-domain' and
132 # 'local-data' names are allowed to have these private addresses. No default.
133 private-address: 10.0.0.0/8
134 private-address: 172.16.0.0/12
135 private-address: 10.0.0.0/16
136 private-address: 192.254.0.0/16
137
138 # Allow the domain (and its subdomains) to contain private addresses.
139 # local-data statements are allowed to contain private addresses too.
140 private-domain: "wleiden.net"
141
142 # If nonzero, unwanted replies are not only reported in statistics, but also
143 # a running total is kept per thread. If it reaches the threshold, a warning
144 # is printed and a defensive action is taken, the cache is cleared to flush
145 # potential poison out of it. A suggested value is 10000000, the default is
146 # 0 (turned off). We think 10K is a good value.
147 unwanted-reply-threshold: 10000
148
149 # IMPORTANT FOR TESTING: If you are testing and setup NSD or BIND on
150 # localhost you will want to allow the resolver to send queries to localhost.
151 # Make sure to set do-not-query-localhost: yes . If yes, the above default
152 # do-not-query-address entries are present. if no, localhost can be queried
153 # (for testing and debugging).
154 do-not-query-localhost: no
155
156 # File with trusted keys, kept up to date using RFC5011 probes, initial file
157 # like trust-anchor-file, then it stores metadata. Use several entries, one
158 # per domain name, to track multiple zones. If you use forward-zone below to
159 # query the Google DNS servers you MUST comment out this option or all DNS
160 # queries will fail.
161 # auto-trust-anchor-file: "/var/unbound/etc/root.key"
162
163 # Should additional section of secure message also be kept clean of unsecure
164 # data. Useful to shield the users of this validator from potential bogus
165 # data in the additional section. All unsigned data in the additional section
166 # is removed from secure messages.
167 val-clean-additional: yes
168
169 # Blocking Ad Server domains. Google's AdSense, DoubleClick and Yahoo
170 # account for a 70 percent share of all advertising traffic. Block them.
171 local-zone: "doubleclick.net" redirect
172 local-data: "doubleclick.net A 127.0.0.1"
173 local-zone: "googlesyndication.com" redirect
174 local-data: "googlesyndication.com A 127.0.0.1"
175 local-zone: "googleadservices.com" redirect
176 local-data: "googleadservices.com A 127.0.0.1"
177 local-zone: "google-analytics.com" redirect
178 local-data: "google-analytics.com A 127.0.0.1"
179 local-zone: "ads.youtube.com" redirect
180 local-data: "ads.youtube.com A 127.0.0.1"
181 local-zone: "adserver.yahoo.com" redirect
182 local-data: "adserver.yahoo.com A 127.0.0.1"
183
184
185 # Unbound will not load if you specify the same local-zone and local-data
186 # servers in the main configuration as well as in this "include:" file. We
187 # suggest commenting out any of the local-zone and local-data lines above if
188 # you suspect they could be included in the unbound_ad_servers servers file.
189 #include: "/usr/local/etc/unbound/unbound_ad_servers"
190
191 # locally served zones can be configured for the machines on the LAN.
192
193# local-zone: "wleiden.net" static
194
195# local-data: "firewall.home.lan. IN A 10.0.0.1"
196# local-data: "laptop.home.lan. IN A 10.0.0.2"
197# local-data: "xboxone.home.lan. IN A 10.0.0.3"
198# local-data: "ps4.home.lan. IN A 10.0.0.4"
199# local-data: "dhcp5.home.lan. IN A 10.0.0.5"
200# local-data: "dhcp6.home.lan. IN A 10.0.0.6"
201# local-data: "dhcp7.home.lan. IN A 10.0.0.7"
202
203# local-data-ptr: "10.0.0.1 firewall.home.lan"
204# local-data-ptr: "10.0.0.2 laptop.home.lan"
205# local-data-ptr: "10.0.0.3 xboxone.home.lan"
206# local-data-ptr: "10.0.0.4 ps4.home.lan"
207# local-data-ptr: "10.0.0.5 dhcp5.home.lan"
208# local-data-ptr: "10.0.0.6 dhcp6.home.lan"
209# local-data-ptr: "10.0.0.7 dhcp7.home.lan"
210
211 # Unbound can query your NSD or BIND server for private domain queries too.
212 # On our NSD page we have NSD configured to serve the private domain,
213 # "home.lan". Here we can tell Unbound to connect to the NSD server when it
214 # needs to resolve a *.home.lan hostname or IP.
215 #
216 # private-domain: "home.lan"
217 # local-zone: "0.0.10.in-addr.arpa." nodefault
218 # stub-zone:
219 # name: "home.lan"
220 # stub-addr: 10.0.0.111@53
221
222
223 include: /var/unbound/stub-zone
224
225
226 # If you have an internal or private DNS names the external DNS servers can
227 # not resolve, then you can assign domain name strings to be redirected to a
228 # seperate dns server. For example, our comapny has the domain
229 # organization.com and the domain name internal.organization.com can not be
230 # resolved by Google's public DNS, but can be resolved by our private DNS
231 # server located at 1.1.1.1. The following tells Unbound that any
232 # organization.com domain, i.e. *.organization.com be dns resolved by 1.1.1.1
233 # instead of the public dns servers.
234 #
235 # forward-zone:
236 # name: "organization.com"
237 # forward-addr: 1.1.1.1 # Internal or private DNS
238
239 # Use the following forward-zone to forward all queries to Google DNS,
240 # OpenDNS.com or your local ISP's dns servers for example. To test resolution
241 # speeds use "drill calomel.org @8.8.8.8" and look for the "Query time:" in
242 # milliseconds.
243 #
244# forward-zone:
245# name: "."
246# forward-addr: 8.8.8.8 # Google Public DNS
247# forward-addr: 74.82.42.42 # Hurricane Electric
248# forward-addr: 4.2.2.4 # Level3 Verizon
249#
250
251 include: /var/unbound/forward-zone
252
253
254## Authoritative, validating, recursive caching DNS
255## unbound.conf -- https://calomel.org
256
Note: See TracBrowser for help on using the repository browser.