1 .\" Copyright (c) 2009-2016 Roy Marples
2 .\" All rights reserved
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .Nd resolvconf configuration file
33 is the configuration file for
37 file is a shell script that is sourced by
41 must contain valid shell commands.
42 Listed below are the standard
44 variables that may be set.
45 If the values contain whitespace, wildcards or other special shell characters,
46 ensure they are quoted and escaped correctly.
49 variable for an example on quoting.
51 After updating this file, you may wish to run
53 to apply the new configuration.
55 When a dynamically generated list is appended or prepended to, the whole
56 is made unique where left-most wins.
57 .Sh RESOLVCONF OPTIONS
58 .Bl -tag -width indent
62 from running any subscribers.
64 .It Sy interface_order
65 These interfaces will always be processed first.
66 If unset, defaults to the following:-
67 .Bd -compact -literal -offset indent
71 These interfaces will be processed next, unless they have a metric.
72 If unset, defaults to the following:-
73 .Bd -compact -literal -offset indent
74 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
76 .It Sy inclusive_interfaces
77 Ignore any exclusive marking for these interfaces.
78 This is handy when 3rd party integrations force the
80 option and you want to disable it easily.
81 .It Sy local_nameservers
82 If unset, defaults to the following:-
83 .Bd -compact -literal -offset indent
84 127.* 0.0.0.0 255.255.255.255 ::1
87 Prepend search domains to the dynamically generated list.
88 .It Sy search_domains_append
89 Append search domains to the dynamically generated list.
90 .It Sy domain_blacklist
91 A list of domains to be removed from consideration.
92 To remove a domain, you can use foo.*
93 To remove a sub domain, you can use *.bar
95 Prepend name servers to the dynamically generated list.
96 You should set this to 127.0.0.1 if you use a local name server other than
98 .It Sy name_servers_append
99 Append name servers to the dynamically generated list.
100 .It Sy name_server_blacklist
101 A list of name servers to be removed from consideration.
102 The default is 0.0.0.0 as some faulty routers send it via DHCP.
103 To remove a block, you can use 192.168.*
104 .It Sy private_interfaces
105 These interfaces name servers will only be queried for the domains listed
106 in their resolv.conf.
107 Useful for VPN domains.
109 .Sy private_interfaces Ns ="*"
110 will stop the forwarding of the root zone and allows the local resolver to
111 recursively query the root servers directly.
112 Requires a local nameserver other than libc.
113 This is equivalent to the
116 .It Sy public_interfaces
117 Force these interface to be public, overriding the private marking.
118 This is handy when 3rd party integrations force the
120 option and you want to disable it easily.
122 Is a space separated list of replacement keywords.
124 .Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement
126 Example, given this resolv.conf:
127 .Bd -compact -literal -offset indent
129 search foo.org dead.beef
133 and this configuaration:
134 .Bd -compact -literal -offset indent
135 replace="search/foo*/bar.com"
136 replace="$replace nameserver/1.2.3.4/5.6.7.8"
137 replace="$replace nameserver/2.3.4.5/"
139 you would get this resolv.conf instead:
140 .Bd -compact -literal -offset indent
146 Works the same way as
148 except it works on each space separated value rather than the whole line,
149 so it's useful for the replacing a single domain within the search directive.
150 Using the same example resolv.conf and changing
154 you would get this resolv.conf instead:
155 .Bd -compact -literal -offset indent
157 search bar.com dead.beef
161 Override the default state directory of
163 This should not be changed once
165 is in use unless the old directory is copied to the new one.
168 The following variables affect
171 .Bl -tag -width indent
176 .It Sy resolv_conf_options
177 A list of libc resolver options, as specified in
179 .It Sy resolv_conf_passthrough
180 When set to YES the latest resolv.conf is written to
182 without any alteration.
183 When set to /dev/null or NULL,
184 .Sy resolv_conf_local_only
186 .Sy local_nameservers
187 is unset unless overridden and only the information set in
191 .It Sy resolv_conf_sortlist
192 A libc resolver sortlist, as specified in
194 .It Sy resolv_conf_local_only
195 If a local name server is configured then the default is just to specify that
196 and ignore all other entries as they will be configured for the local
198 Set this to NO to also list non-local nameservers.
199 This will give you working DNS even if the local nameserver stops functioning
200 at the expense of duplicated server queries.
201 .It Sy append_nameservers
202 Append name servers to the dynamically generated list.
203 .It Sy prepend_nameservers
204 Prepend name servers to the dynamically generated list.
206 Append search domains to the dynamically generated list.
207 .It Sy prepend_search
208 Prepend search domains to the dynamically generated list.
210 .Sh SUBSCRIBER OPTIONS
211 openresolv ships with subscribers for the name servers
215 .Xr pdns_recursor 8 ,
218 Each subscriber can create configuration files which should be included in
219 in the subscribers main configuration file.
221 To disable a subscriber, simply set it's name to NO.
222 For example, to disable the libc subscriber you would set:
223 .Bd -compact -literal -offset indent
226 .Bl -tag -width indent
228 This file tells dnsmasq which name servers to use for specific domains.
229 .It Sy dnsmasq_resolv
230 This file tells dnsmasq which name servers to use for global lookups.
232 Example resolvconf.conf for dnsmasq:
233 .Bd -compact -literal -offset indent
234 name_servers=127.0.0.1
235 dnsmasq_conf=/etc/dnsmasq-conf.conf
236 dnsmasq_resolv=/etc/dnsmasq-resolv.conf
239 Example dnsmasq.conf:
240 .Bd -compact -literal -offset indent
241 listen-address=127.0.0.1
242 # If dnsmasq is compiled for DBus then we can take
243 # advantage of not having to restart dnsmasq.
245 conf-file=/etc/dnsmasq-conf.conf
246 resolv-file=/etc/dnsmasq-resolv.conf
249 Include this file in the named options block.
250 This file tells named which name servers to use for global lookups.
252 Include this file in the named global scope, after the options block.
253 This file tells named which name servers to use for specific domains.
255 Example resolvconf.conf for named:
256 .Bd -compact -literal -offset indent
257 name_servers=127.0.0.1
258 named_options=/etc/named-options.conf
259 named_zones=/etc/named-zones.conf
263 .Bd -compact -literal -offset indent
265 listen-on { 127.0.0.1; };
266 include "/etc/named-options.conf";
269 include "/etc/named-zones.conf";
272 This is the main pdnsd configuration file which we modify to add our
274 If this variable is not set then we rely on the pdnsd configuration file
279 This file tells pdnsd about global name servers.
280 If this variable is not set then it's written to
283 Example resolvconf.conf for pdnsd:
284 .Bd -compact -literal -offset indent
285 name_servers=127.0.0.1
286 pdnsd_conf=/etc/pdnsd.conf
287 # pdnsd_resolv=/etc/pdnsd-resolv.conf
291 .Bd -compact -literal -offset indent
293 server_ip = 127.0.0.1;
297 # A server definition is required, even if empty.
300 # file="/etc/pdnsd-resolv.conf";
304 This file tells pdns_recursor about specific and global name servers.
306 Example resolvconf.conf for pdns_recursor:
307 .Bd -compact -literal -offset indent
308 name_servers=127.0.0.1
309 pdns_zones=/etc/pdns/recursor-zones.conf
312 Example recursor.conf:
313 .Bd -compact -literal -offset indent
314 allow-from=127.0.0.0/8, ::1/128
315 forward-zones-file=/etc/pdns/recursor-zones.conf
318 This file tells unbound about specific and global name servers.
319 .It Sy unbound_insecure
320 When set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC.
322 Example resolvconf.conf for unbound:
323 .Bd -compact -literal -offset indent
324 name_servers=127.0.0.1
325 unbound_conf=/etc/unbound-resolvconf.conf
328 Example unbound.conf:
329 .Bd -compact -literal -offset indent
330 include: /etc/unbound-resolvconf.conf
333 .Sh SUBSCRIBER INTEGRATION
334 Not all distributions store the files the subscribers need in the same
336 For example, named service scripts have been called named, bind and rc.bind
337 and they could be located in a directory called /etc/rc.d, /etc/init.d or
339 Each subscriber attempts to automatically configure itself, but not every
340 distribution has been catered for.
341 Also, users could equally want to use a different version from the one
342 installed by default, such as bind8 and bind9.
343 To accommodate this, the subscribers have these files in configurable
344 variables, documented below.
345 .Bl -tag -width indent
346 .It Sy dnsmasq_service
347 Name of the dnsmasq service.
348 .It Sy dnsmasq_restart
349 Command to restart the dnsmasq service.
351 Location of the dnsmasq pidfile.
353 Name of the libc service.
355 Command to restart the libc service.
357 Name of the named service.
359 Command to restart the named service.
361 Command to restart the pdnsd service.
363 Command to restart the pdns_recursor service.
365 Command to restart the pdns_recursor service.
366 .It Sy unbound_service
367 Name of the unbound service.
368 .It Sy unbound_restart
369 Command to restart the unbound service.
371 Location of the unbound pidfile.
378 .An Roy Marples Aq Mt roy@marples.name
380 Each distribution is a special snowflake and likes to name the same thing
381 differently, namely the named service script.
383 Please report them to
384 .Lk http://roy.marples.name/projects/openresolv