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

Last change on this file since 13458 was 13422, checked in by rick, 10 years ago

PoC unbound.conf for WL images

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