1.\" Copyright (c) 2009-2016 Roy Marples
2.\" All rights reserved
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
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.
12.\"
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
23.\" SUCH DAMAGE.
24.\"
25.Dd December 29, 2016
26.Dt RESOLVCONF.CONF 5
27.Os
28.Sh NAME
29.Nm resolvconf.conf
30.Nd resolvconf configuration file
31.Sh DESCRIPTION
32.Nm
33is the configuration file for
34.Xr resolvconf 8 .
35The
36.Nm
37file is a shell script that is sourced by
38.Xr resolvconf 8 ,
39meaning that
40.Nm
41must contain valid shell commands.
42Listed below are the standard
43.Nm
44variables that may be set.
45If the values contain whitespace, wildcards or other special shell characters,
46ensure they are quoted and escaped correctly.
47See the
48.Sy replace
49variable for an example on quoting.
50.Pp
51After updating this file, you may wish to run
52.Nm resolvconf -u
53to apply the new configuration.
54.Pp
55When a dynamically generated list is appended or prepended to, the whole
56is made unique where left-most wins.
57.Sh RESOLVCONF OPTIONS
58.Bl -tag -width indent
59.It Sy resolvconf
60Set to NO to disable
61.Nm resolvconf
62from running any subscribers.
63Defaults to YES.
64.It Sy interface_order
65These interfaces will always be processed first.
66If unset, defaults to the following:-
67.D1 lo lo[0-9]*
68.It Sy dynamic_order
69These interfaces will be processed next, unless they have a metric.
70If unset, defaults to the following:-
71.D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
72.It Sy inclusive_interfaces
73Ignore any exlcusive marking for these interfaces.
74This is handy when 3rd party integrations force the
75.Nm resolvconf -x
76option and you want to disable it easily.
77.It Sy local_nameservers
78If unset, defaults to the following:-
79.D1 127.* 0.0.0.0 255.255.255.255 ::1
80.It Sy search_domains
81Prepend search domains to the dynamically generated list.
82.It Sy search_domains_append
83Append search domains to the dynamically generated list.
84.It Sy domain_blacklist
85A list of domains to be removed from consideration.
86To remove a domain, you can use foo.*
87To remove a sub domain, you can use *.bar
88.It Sy name_servers
89Prepend name servers to the dynamically generated list.
90You should set this to 127.0.0.1 if you use a local name server other than
91libc.
92.It Sy name_servers_append
93Append name servers to the dynamically generated list.
94.It Sy name_server_blacklist
95A list of name servers to be removed from consideration.
96The default is 0.0.0.0 as some faulty routers send it via DHCP.
97To remove a block, you can use 192.168.*
98.It Sy private_interfaces
99These interfaces name servers will only be queried for the domains listed
100in their resolv.conf.
101Useful for VPN domains.
102Setting
103.Sy private_interfaces Ns ="*"
104will stop the forwarding of the root zone and allows the local resolver to
105recursively query the root servers directly.
106Requires a local nameserver other than libc.
107This is equivalent to the
108.Nm resolvconf -p
109option.
110.It Sy public_interfaces
111Force these interface to be public, overriding the private marking.
112This is handy when 3rd party integrations force the
113.Nm resolvconf -p
114option and you want to disable it easily.
115.It Sy replace
116Is a space separated list of replacement keywords.
117The syntax is this:
118.Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement
119.Pp
120Example, given this resolv.conf:
121.D1 domain foo.org
122.D1 search foo.org dead.beef
123.D1 nameserver 1.2.3.4
124.D1 nameserver 2.3.4.5
125and this configuaration:
126.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/"
127you would get this resolv.conf instead:
128.D1 domain foo.org
129.D1 search bar.com
130.D1 nameserver 5.6.7.8
131.It Sy replace_sub
132Works the same way as
133.Sy replace
134except it works on each space separated value rather than the whole line,
135so it's useful for the replacing a single domain within the search directive.
136Using the same example resolv.conf and changing
137.Sy replace
138to
139.Sy replace_sub ,
140you would get this resolv.conf instead:
141.D1 domain foo.org
142.D1 search bar.com dead.beef
143.D1 nameserver 5.6.7.8
144.It Sy state_dir
145Override the default state directory of
146.Pa @VARDIR@ .
147This should not be changed once
148.Nm resolvconf
149is in use unless the old directory is copied to the new one.
150.El
151.Sh LIBC OPTIONS
152The following variables affect
153.Xr resolv.conf 5
154directly:-
155.Bl -tag -width indent
156.It Sy resolv_conf
157Defaults to
158.Pa /etc/resolv.conf
159if not set.
160.It Sy resolv_conf_options
161A list of libc resolver options, as specified in
162.Xr resolv.conf 5 .
163.It Sy resolv_conf_passthrough
164When set to YES the latest resolv.conf is written to
165.Sy resolv_conf
166without any alteration.
167When set to /dev/null or NULL,
168.Sy resolv_conf_local_only
169is defaulted to NO,
170.Sy local_nameservers
171is unset unless overridden and only the information set in
172.Nm
173is written to
174.Sy resolv_conf .
175.It Sy resolv_conf_sortlist
176A libc resolver sortlist, as specified in
177.Xr resolv.conf 5 .
178.It Sy resolv_conf_local_only
179If a local name server is configured then the default is just to specify that
180and ignore all other entries as they will be configured for the local
181name server.
182Set this to NO to also list non-local nameservers.
183This will give you working DNS even if the local nameserver stops functioning
184at the expense of duplicated server queries.
185.It Sy append_nameservers
186Append name servers to the dynamically generated list.
187.It Sy prepend_nameservers
188Prepend name servers to the dynamically generated list.
189.It Sy append_search
190Append search domains to the dynamically generated list.
191.It Sy prepend_search
192Prepend search domains to the dynamically generated list.
193.El
194.Sh SUBSCRIBER OPTIONS
195openresolv ships with subscribers for the name servers
196.Xr dnsmasq 8 ,
197.Xr named 8 ,
198.Xr pdnsd 8
199and
200.Xr unbound 8 .
201Each subscriber can create configuration files which should be included in
202in the subscribers main configuration file.
203.Pp
204To disable a subscriber, simply set it's name to NO.
205For example, to disable the libc subscriber you would set:
206.D1 libc=NO
207.Bl -tag -width indent
208.It Sy dnsmasq_conf
209This file tells dnsmasq which name servers to use for specific domains.
210.It Sy dnsmasq_resolv
211This file tells dnsmasq which name servers to use for global lookups.
212.Pp
213Example resolvconf.conf for dnsmasq:
214.D1 name_servers=127.0.0.1
215.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf
216.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf
217.Pp
218Example dnsmasq.conf:
219.D1 listen-address=127.0.0.1
220.D1 # If dnsmasq is compiled for DBus then we can take
221.D1 # advantage of not having to restart dnsmasq.
222.D1 enable-dbus
223.D1 conf-file=/etc/dnsmasq-conf.conf
224.D1 resolv-file=/etc/dnsmasq-resolv.conf
225.It Sy named_options
226Include this file in the named options block.
227This file tells named which name servers to use for global lookups.
228.It Sy named_zones
229Include this file in the named global scope, after the options block.
230This file tells named which name servers to use for specific domains.
231.Pp
232Example resolvconf.conf for named:
233.D1 name_servers=127.0.0.1
234.D1 named_options=/etc/named-options.conf
235.D1 named_zones=/etc/named-zones.conf
236.Pp
237Example named.conf:
238.D1 options {
239.D1     listen-on { 127.0.0.1; };
240.D1     include "/etc/named-options.conf";
241.D1 };
242.D1 include "/etc/named-zones.conf";
243.It Sy pdnsd_conf
244This is the main pdnsd configuration file which we modify to add our
245forward domains to.
246If this variable is not set then we rely on the pdnsd configuration file
247setup to read
248.Pa pdnsd_resolv
249as documented below.
250.It Sy pdnsd_resolv
251This file tells pdnsd about global name servers.
252If this variable is not set then it's written to
253.Pa pdnsd_conf .
254.Pp
255Example resolvconf.conf for pdnsd:
256.D1 name_servers=127.0.0.1
257.D1 pdnsd_conf=/etc/pdnsd.conf
258.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf
259.Pp
260Example pdnsd.conf:
261.D1 global {
262.D1     server_ip = 127.0.0.1;
263.D1     status_ctl = on;
264.D1 }
265.D1 server {
266.D1     # A server definition is required, even if emtpy.
267.D1     label="empty";
268.D1     proxy_only=on;
269.D1     # file="/etc/pdnsd-resolv.conf";
270.D1 }
271.It Sy unbound_conf
272This file tells unbound about specific and global name servers.
273.It Sy unbound_insecure
274When set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC.
275.Pp
276Example resolvconf.conf for unbound:
277.D1 name_servers=127.0.0.1
278.D1 unbound_conf=/etc/unbound-resolvconf.conf
279.Pp
280Example unbound.conf:
281.D1 include: /etc/unbound-resolvconf.conf
282.El
283.Sh SUBSCRIBER INTEGRATION
284Not all distributions store the files the subscribers need in the same
285locations.
286For example, named service scripts have been called named, bind and rc.bind
287and they could be located in a directory called /etc/rc.d, /etc/init.d or
288similar.
289Each subscriber attempts to automatically configure itself, but not every
290distribution has been catered for.
291Also, users could equally want to use a different version from the one
292installed by default, such as bind8 and bind9.
293To accommodate this, the subscribers have these files in configurable
294variables, documented below.
295.Bl -tag -width indent
296.It Sy dnsmasq_service
297Name of the dnsmasq service.
298.It Sy dnsmasq_restart
299Command to restart the dnsmasq service.
300.It Sy dnsmasq_pid
301Location of the dnsmasq pidfile.
302.It Sy libc_service
303Name of the libc service.
304.It Sy libc_restart
305Command to restart the libc service.
306.It Sy named_service
307Name of the named service.
308.It Sy named_restart
309Command to restart the named service.
310.It Sy pdnsd_restart
311Command to restart the pdnsd service.
312.It Sy unbound_service
313Name of the unbound service.
314.It Sy unbound_restart
315Command to restart the unbound service.
316.It Sy unbound_pid
317Location of the unbound pidfile.
318.El
319.Sh SEE ALSO
320.Xr sh 1 ,
321.Xr resolv.conf 5 ,
322.Xr resolvconf 8
323.Sh AUTHORS
324.An Roy Marples Aq Mt roy@marples.name
325.Sh BUGS
326Each distribution is a special snowflake and likes to name the same thing
327differently, namely the named service script.
328.Pp
329Please report them to
330.Lk http://roy.marples.name/projects/openresolv
331