1 | ## Authoritative, validating, recursive caching DNS
|
---|
2 | ## unbound.conf -- https://calomel.org
|
---|
3 | #
|
---|
4 | server:
|
---|
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 | #
|
---|
165 | # auto-trust-anchor-file: "/var/unbound/root.key"
|
---|
166 |
|
---|
167 | # Should additional section of secure message also be kept clean of unsecure
|
---|
168 | # data. Useful to shield the users of this validator from potential bogus
|
---|
169 | # data in the additional section. All unsigned data in the additional section
|
---|
170 | # is removed from secure messages.
|
---|
171 | val-clean-additional: yes
|
---|
172 |
|
---|
173 | # Blocking Ad Server domains. Google's AdSense, DoubleClick and Yahoo
|
---|
174 | # account for a 70 percent share of all advertising traffic. Block them.
|
---|
175 | local-zone: "doubleclick.net" redirect
|
---|
176 | local-data: "doubleclick.net A 127.0.0.1"
|
---|
177 | local-zone: "googlesyndication.com" redirect
|
---|
178 | local-data: "googlesyndication.com A 127.0.0.1"
|
---|
179 | local-zone: "googleadservices.com" redirect
|
---|
180 | local-data: "googleadservices.com A 127.0.0.1"
|
---|
181 | local-zone: "google-analytics.com" redirect
|
---|
182 | local-data: "google-analytics.com A 127.0.0.1"
|
---|
183 | local-zone: "ads.youtube.com" redirect
|
---|
184 | local-data: "ads.youtube.com A 127.0.0.1"
|
---|
185 | local-zone: "adserver.yahoo.com" redirect
|
---|
186 | local-data: "adserver.yahoo.com A 127.0.0.1"
|
---|
187 |
|
---|
188 | # Unbound will not load if you specify the same local-zone and local-data
|
---|
189 | # servers in the main configuration as well as in this "include:" file. We
|
---|
190 | # suggest commenting out any of the local-zone and local-data lines above if
|
---|
191 | # you suspect they could be included in the unbound_ad_servers servers file.
|
---|
192 | #include: "/var/unbound/unbound_ad_servers"
|
---|
193 |
|
---|
194 | # locally served zones can be configured for the machines on the LAN.
|
---|
195 | local-data: "welcome.wleiden.net 172.31.255.1"
|
---|
196 |
|
---|
197 | # include: /var/unbound/local-data
|
---|
198 |
|
---|
199 | # Unbound can query your NSD or BIND server for private domain queries too.
|
---|
200 | # On our NSD page we have NSD configured to serve the private domain,
|
---|
201 | # "home.lan". Here we can tell Unbound to connect to the NSD server when it
|
---|
202 | # needs to resolve a *.home.lan hostname or IP.
|
---|
203 | #
|
---|
204 | # private-domain: "home.lan"
|
---|
205 | # local-zone: "0.0.10.in-addr.arpa." nodefault
|
---|
206 | # stub-zone:
|
---|
207 | # name: "home.lan"
|
---|
208 | # stub-addr: 10.0.0.111@53
|
---|
209 | stub-zone:
|
---|
210 | name: "wleiden.net"
|
---|
211 | stub-addr: 172.16.4.46
|
---|
212 | stub-zone:
|
---|
213 | name: "16.172.in-addr.arpa."
|
---|
214 | stub-addr: 172.16.4.46
|
---|
215 | stub-zone:
|
---|
216 | name: "17.172.in-addr.arpa."
|
---|
217 | stub-addr: 172.16.4.46
|
---|
218 | stub-zone:
|
---|
219 | name: "18.172.in-addr.arpa."
|
---|
220 | stub-addr: 172.16.4.46
|
---|
221 | stub-zone:
|
---|
222 | name: "19.172.in-addr.arpa."
|
---|
223 | stub-addr: 172.16.4.46
|
---|
224 | stub-zone:
|
---|
225 | name: "20.172.in-addr.arpa."
|
---|
226 | stub-addr: 172.16.4.46
|
---|
227 | stub-zone:
|
---|
228 | name: "21.172.in-addr.arpa."
|
---|
229 | stub-addr: 172.16.4.46
|
---|
230 | stub-zone:
|
---|
231 | name: "22.172.in-addr.arpa."
|
---|
232 | stub-addr: 172.16.4.46
|
---|
233 | stub-zone:
|
---|
234 | name: "23.172.in-addr.arpa."
|
---|
235 | stub-addr: 172.16.4.46
|
---|
236 | stub-zone:
|
---|
237 | name: "24.172.in-addr.arpa."
|
---|
238 | stub-addr: 172.16.4.46
|
---|
239 | stub-zone:
|
---|
240 | name: "25.172.in-addr.arpa."
|
---|
241 | stub-addr: 172.16.4.46
|
---|
242 | stub-zone:
|
---|
243 | name: "26.172.in-addr.arpa."
|
---|
244 | stub-addr: 172.16.4.46
|
---|
245 | stub-zone:
|
---|
246 | name: "27.172.in-addr.arpa."
|
---|
247 | stub-addr: 172.16.4.46
|
---|
248 | stub-zone:
|
---|
249 | name: "28.172.in-addr.arpa."
|
---|
250 | stub-addr: 172.16.4.46
|
---|
251 | stub-zone:
|
---|
252 | name: "29.172.in-addr.arpa."
|
---|
253 | stub-addr: 172.16.4.46
|
---|
254 | stub-zone:
|
---|
255 | name: "30.172.in-addr.arpa."
|
---|
256 | stub-addr: 172.16.4.46
|
---|
257 | stub-zone:
|
---|
258 | name: "31.172.in-addr.arpa."
|
---|
259 | stub-addr: 172.16.4.46
|
---|
260 |
|
---|
261 | # If you have an internal or private DNS names the external DNS servers can
|
---|
262 | # not resolve, then you can assign domain name strings to be redirected to a
|
---|
263 | # seperate dns server. For example, our comapny has the domain
|
---|
264 | # organization.com and the domain name internal.organization.com can not be
|
---|
265 | # resolved by Google's public DNS, but can be resolved by our private DNS
|
---|
266 | # server located at 1.1.1.1. The following tells Unbound that any
|
---|
267 | # organization.com domain, i.e. *.organization.com be dns resolved by 1.1.1.1
|
---|
268 | # instead of the public dns servers.
|
---|
269 | #
|
---|
270 | # forward-zone:
|
---|
271 | # name: "organization.com"
|
---|
272 | # forward-addr: 1.1.1.1 # Internal or private DNS
|
---|
273 |
|
---|
274 | # Use the following forward-zone to forward all queries to Google DNS,
|
---|
275 | # OpenDNS.com or your local ISP's dns servers for example. To test resolution
|
---|
276 | # speeds use "drill calomel.org @8.8.8.8" and look for the "Query time:" in
|
---|
277 | # milliseconds.
|
---|
278 | #
|
---|
279 | # forward-zone:
|
---|
280 | # name: "."
|
---|
281 | # forward-addr: 8.8.8.8 # Google Public DNS
|
---|
282 | # forward-addr: 74.82.42.42 # Hurricane Electric
|
---|
283 | # forward-addr: 4.2.2.4 # Level3 Verizon
|
---|
284 |
|
---|
285 | include: /var/unbound/forward-zone
|
---|
286 |
|
---|
287 | #
|
---|
288 | ## Authoritative, validating, recursive caching DNS
|
---|
289 | ## unbound.conf -- https://calomel.org
|
---|
290 |
|
---|