xref: /freebsd/contrib/openresolv/resolvconf.conf.5.in (revision d7149f4e5176e24d02ef4cc3a0636623153209f0)
1*d7149f4eSGlen Barber.\" Copyright (c) 2009-2015 Roy Marples
2587392a5SHajimu UMEMOTO.\" All rights reserved
3587392a5SHajimu UMEMOTO.\"
4587392a5SHajimu UMEMOTO.\" Redistribution and use in source and binary forms, with or without
5587392a5SHajimu UMEMOTO.\" modification, are permitted provided that the following conditions
6587392a5SHajimu UMEMOTO.\" are met:
7587392a5SHajimu UMEMOTO.\" 1. Redistributions of source code must retain the above copyright
8587392a5SHajimu UMEMOTO.\"    notice, this list of conditions and the following disclaimer.
9587392a5SHajimu UMEMOTO.\" 2. Redistributions in binary form must reproduce the above copyright
10587392a5SHajimu UMEMOTO.\"    notice, this list of conditions and the following disclaimer in the
11587392a5SHajimu UMEMOTO.\"    documentation and/or other materials provided with the distribution.
12587392a5SHajimu UMEMOTO.\"
13587392a5SHajimu UMEMOTO.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14587392a5SHajimu UMEMOTO.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15587392a5SHajimu UMEMOTO.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16587392a5SHajimu UMEMOTO.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17587392a5SHajimu UMEMOTO.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18587392a5SHajimu UMEMOTO.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19587392a5SHajimu UMEMOTO.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20587392a5SHajimu UMEMOTO.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21587392a5SHajimu UMEMOTO.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22587392a5SHajimu UMEMOTO.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23587392a5SHajimu UMEMOTO.\" SUCH DAMAGE.
24587392a5SHajimu UMEMOTO.\"
25*d7149f4eSGlen Barber.Dd March 20, 2015
26*d7149f4eSGlen Barber.Dt RESOLVCONF.CONF 5
27587392a5SHajimu UMEMOTO.Os
28587392a5SHajimu UMEMOTO.Sh NAME
29587392a5SHajimu UMEMOTO.Nm resolvconf.conf
30587392a5SHajimu UMEMOTO.Nd resolvconf configuration file
31587392a5SHajimu UMEMOTO.Sh DESCRIPTION
32587392a5SHajimu UMEMOTO.Nm
33587392a5SHajimu UMEMOTOis the configuration file for
34587392a5SHajimu UMEMOTO.Xr resolvconf 8 .
35587392a5SHajimu UMEMOTOThe
36587392a5SHajimu UMEMOTO.Nm
37587392a5SHajimu UMEMOTOfile is a shell script that is sourced by
38587392a5SHajimu UMEMOTO.Xr resolvconf 8 ,
39587392a5SHajimu UMEMOTOmeaning that
40587392a5SHajimu UMEMOTO.Nm
41587392a5SHajimu UMEMOTOmust contain valid shell commands.
42587392a5SHajimu UMEMOTOListed below are the standard
43587392a5SHajimu UMEMOTO.Nm
44587392a5SHajimu UMEMOTOvariables that may be set.
45*d7149f4eSGlen BarberIf the values contain white space for special shell characters,
46*d7149f4eSGlen Barberensure they are quoted and escaped correctly.
47587392a5SHajimu UMEMOTO.Pp
4848855ec7SHajimu UMEMOTOAfter updating this file, you may wish to run
49587392a5SHajimu UMEMOTO.Nm resolvconf -u
50587392a5SHajimu UMEMOTOto apply the new configuration.
51*d7149f4eSGlen Barber.Pp
52*d7149f4eSGlen BarberWhen a dynamically generated list is appended or prepended to, the whole
53*d7149f4eSGlen Barberis made unique where left-most wins.
54587392a5SHajimu UMEMOTO.Sh RESOLVCONF OPTIONS
55587392a5SHajimu UMEMOTO.Bl -tag -width indent
56*d7149f4eSGlen Barber.It Sy resolvconf
57*d7149f4eSGlen BarberSet to NO to disable
58*d7149f4eSGlen Barber.Nm resolvconf
59*d7149f4eSGlen Barberfrom running any subscribers.
60*d7149f4eSGlen BarberDefaults to YES.
61587392a5SHajimu UMEMOTO.It Sy interface_order
62587392a5SHajimu UMEMOTOThese interfaces will always be processed first.
63587392a5SHajimu UMEMOTOIf unset, defaults to the following:-
64587392a5SHajimu UMEMOTO.D1 lo lo[0-9]*
65587392a5SHajimu UMEMOTO.It Sy dynamic_order
66587392a5SHajimu UMEMOTOThese interfaces will be processed next, unless they have a metric.
67587392a5SHajimu UMEMOTOIf unset, defaults to the following:-
68587392a5SHajimu UMEMOTO.D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
69*d7149f4eSGlen Barber.It Sy local_nameservers
70*d7149f4eSGlen BarberIf unset, defaults to the following:-
71*d7149f4eSGlen Barber.D1 127.* 0.0.0.0 255.255.255.255 ::1
72587392a5SHajimu UMEMOTO.It Sy search_domains
73587392a5SHajimu UMEMOTOPrepend search domains to the dynamically generated list.
74587392a5SHajimu UMEMOTO.It Sy search_domains_append
75587392a5SHajimu UMEMOTOAppend search domains to the dynamically generated list.
76*d7149f4eSGlen Barber.It Sy domain_blacklist
77*d7149f4eSGlen BarberA list of domains to be removed from consideration.
78*d7149f4eSGlen BarberTo remove a domain, you can use foo.*
79*d7149f4eSGlen BarberTo remove a sub domain, you can use *.bar
80587392a5SHajimu UMEMOTO.It Sy name_servers
81587392a5SHajimu UMEMOTOPrepend name servers to the dynamically generated list.
82587392a5SHajimu UMEMOTOYou should set this to 127.0.0.1 if you use a local name server other than
83587392a5SHajimu UMEMOTOlibc.
84587392a5SHajimu UMEMOTO.It Sy name_servers_append
85587392a5SHajimu UMEMOTOAppend name servers to the dynamically generated list.
86*d7149f4eSGlen Barber.It Sy name_server_blacklist
87*d7149f4eSGlen BarberA list of name servers to be removed from consideration.
88*d7149f4eSGlen BarberThe default is 0.0.0.0 as some faulty routers send it via DHCP.
89*d7149f4eSGlen BarberTo remove a block, you can use 192.168.*
90587392a5SHajimu UMEMOTO.It Sy private_interfaces
91587392a5SHajimu UMEMOTOThese interfaces name servers will only be queried for the domains listed
92587392a5SHajimu UMEMOTOin their resolv.conf.
93587392a5SHajimu UMEMOTOUseful for VPN domains.
94587392a5SHajimu UMEMOTOThis is equivalent to the
95587392a5SHajimu UMEMOTO.Nm resolvconf -p
96587392a5SHajimu UMEMOTOoption.
97*d7149f4eSGlen Barber.It Sy replace
98*d7149f4eSGlen BarberIs a space separated list of replacement keywords. The syntax is this:
99*d7149f4eSGlen Barber.Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement
100*d7149f4eSGlen Barber.Pp
101*d7149f4eSGlen BarberExample, given this resolv.conf:
102*d7149f4eSGlen Barber.D1 domain foo.org
103*d7149f4eSGlen Barber.D1 search foo.org dead.beef
104*d7149f4eSGlen Barber.D1 nameserver 1.2.3.4
105*d7149f4eSGlen Barber.D1 nameserver 2.3.4.5
106*d7149f4eSGlen Barberand this configuaration:
107*d7149f4eSGlen Barber.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/"
108*d7149f4eSGlen Barberyou would get this resolv.conf instead:
109*d7149f4eSGlen Barber.D1 domain foo.org
110*d7149f4eSGlen Barber.D1 search bar.com
111*d7149f4eSGlen Barber.D1 nameserver 5.6.7.8
112*d7149f4eSGlen Barber.It Sy replace_sub
113*d7149f4eSGlen BarberWorks the same way as
114*d7149f4eSGlen Barber.Sy replace
115*d7149f4eSGlen Barberexcept it works on each space separated value rather than the whole line,
116*d7149f4eSGlen Barberso it's useful for the replacing a single domain within the search directive.
117*d7149f4eSGlen BarberUsing the same example resolv.conf and changing
118*d7149f4eSGlen Barber.Sy replace
119*d7149f4eSGlen Barberto
120*d7149f4eSGlen Barber.Sy replace_sub ,
121*d7149f4eSGlen Barberyou would get this resolv.conf instead:
122*d7149f4eSGlen Barber.D1 domain foo.org
123*d7149f4eSGlen Barber.D1 search bar.com dead.beef
124*d7149f4eSGlen Barber.D1 nameserver 5.6.7.8
125587392a5SHajimu UMEMOTO.It Sy state_dir
126587392a5SHajimu UMEMOTOOverride the default state directory of
127587392a5SHajimu UMEMOTO.Pa @VARDIR@ .
128587392a5SHajimu UMEMOTOThis should not be changed once
129587392a5SHajimu UMEMOTO.Nm resolvconf
130587392a5SHajimu UMEMOTOis in use unless the old directory is copied to the new one.
131587392a5SHajimu UMEMOTO.El
132587392a5SHajimu UMEMOTO.Sh LIBC OPTIONS
133587392a5SHajimu UMEMOTOThe following variables affect
134587392a5SHajimu UMEMOTO.Xr resolv.conf 5
135587392a5SHajimu UMEMOTOdirectly:-
136587392a5SHajimu UMEMOTO.Bl -tag -width indent
137587392a5SHajimu UMEMOTO.It Sy resolv_conf
138587392a5SHajimu UMEMOTODefaults to
139587392a5SHajimu UMEMOTO.Pa /etc/resolv.conf
140587392a5SHajimu UMEMOTOif not set.
141587392a5SHajimu UMEMOTO.It Sy resolv_conf_options
142587392a5SHajimu UMEMOTOA list of libc resolver options, as specified in
143587392a5SHajimu UMEMOTO.Xr resolv.conf 5 .
144587392a5SHajimu UMEMOTO.It Sy resolv_conf_passthrough
145587392a5SHajimu UMEMOTOWhen set to YES the latest resolv.conf is written to
146587392a5SHajimu UMEMOTO.Sy resolv_conf
147587392a5SHajimu UMEMOTOwithout any alteration.
148*d7149f4eSGlen BarberWhen set to /dev/null or NULL,
149*d7149f4eSGlen Barber.Sy resolv_conf_local_only
150*d7149f4eSGlen Barberis defaulted to NO,
151*d7149f4eSGlen Barber.Sy local_nameservers
152*d7149f4eSGlen Barberis unset unless overriden and only the information set in
153*d7149f4eSGlen Barber.Nm
154*d7149f4eSGlen Barberis written to
155*d7149f4eSGlen Barber.Sy resolv_conf .
156*d7149f4eSGlen Barber.It Sy resolv_conf_sortlist
157*d7149f4eSGlen BarberA libc resolver sortlist, as specified in
158*d7149f4eSGlen Barber.Xr resolv.conf 5 .
159*d7149f4eSGlen Barber.It Sy resolv_conf_local_only
160*d7149f4eSGlen BarberIf a local name server is configured then the default is just to specify that
161*d7149f4eSGlen Barberand ignore all other entries as they will be configured for the local
162*d7149f4eSGlen Barbername server.
163*d7149f4eSGlen BarberSet this to NO to also list non-local nameservers.
164*d7149f4eSGlen BarberThis will give you working DNS even if the local nameserver stops functioning
165*d7149f4eSGlen Barberat the expense of duplicated server queries.
166*d7149f4eSGlen Barber.It Sy append_nameservers
167*d7149f4eSGlen BarberAppend name servers to the dynamically generated list.
168*d7149f4eSGlen Barber.It Sy prepend_nameservers
169*d7149f4eSGlen BarberPrepend name servers to the dynamically generated list.
170*d7149f4eSGlen Barber.It Sy append_search
171*d7149f4eSGlen BarberAppend search domains to the dynamically generated list.
172*d7149f4eSGlen Barber.It Sy prepend_search
173*d7149f4eSGlen BarberPrepend search domains to the dynamically generated list.
174587392a5SHajimu UMEMOTO.El
175587392a5SHajimu UMEMOTO.Sh SUBSCRIBER OPTIONS
176587392a5SHajimu UMEMOTOopenresolv ships with subscribers for the name servers
177587392a5SHajimu UMEMOTO.Xr dnsmasq 8 ,
178587392a5SHajimu UMEMOTO.Xr named 8 ,
179587392a5SHajimu UMEMOTO.Xr pdnsd 8
180587392a5SHajimu UMEMOTOand
181587392a5SHajimu UMEMOTO.Xr unbound 8 .
182587392a5SHajimu UMEMOTOEach subscriber can create configuration files which should be included in
183587392a5SHajimu UMEMOTOin the subscribers main configuration file.
184*d7149f4eSGlen Barber.Pp
185*d7149f4eSGlen BarberTo disable a subscriber, simply set it's name to NO.
186*d7149f4eSGlen BarberFor example, to disable the libc subscriber you would set:
187*d7149f4eSGlen Barber.D1 libc=NO
188587392a5SHajimu UMEMOTO.Bl -tag -width indent
189587392a5SHajimu UMEMOTO.It Sy dnsmasq_conf
190587392a5SHajimu UMEMOTOThis file tells dnsmasq which name servers to use for specific domains.
191587392a5SHajimu UMEMOTO.It Sy dnsmasq_resolv
192587392a5SHajimu UMEMOTOThis file tells dnsmasq which name servers to use for global lookups.
193587392a5SHajimu UMEMOTO.Pp
194587392a5SHajimu UMEMOTOExample resolvconf.conf for dnsmasq:
19527c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
196587392a5SHajimu UMEMOTO.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf
197587392a5SHajimu UMEMOTO.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf
198587392a5SHajimu UMEMOTO.Pp
199587392a5SHajimu UMEMOTOExample dnsmasq.conf:
200587392a5SHajimu UMEMOTO.D1 listen-address=127.0.0.1
201*d7149f4eSGlen Barber.D1 # If dnsmasq is compiled for DBus then we can take
202*d7149f4eSGlen Barber.D1 # advantage of not having to restart dnsmasq.
203*d7149f4eSGlen Barber.D1 enable-dbus
204587392a5SHajimu UMEMOTO.D1 conf-file=/etc/dnsmasq-conf.conf
205587392a5SHajimu UMEMOTO.D1 resolv-file=/etc/dnsmasq-resolv.conf
206587392a5SHajimu UMEMOTO.It Sy named_options
207587392a5SHajimu UMEMOTOInclude this file in the named options block.
208587392a5SHajimu UMEMOTOThis file tells named which name servers to use for global lookups.
209587392a5SHajimu UMEMOTO.It Sy named_zones
210587392a5SHajimu UMEMOTOInclude this file in the named global scope, after the options block.
211587392a5SHajimu UMEMOTOThis file tells named which name servers to use for specific domains.
212587392a5SHajimu UMEMOTO.Pp
213587392a5SHajimu UMEMOTOExample resolvconf.conf for named:
21427c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
215587392a5SHajimu UMEMOTO.D1 named_options=/etc/named-options.conf
216587392a5SHajimu UMEMOTO.D1 named_zones=/etc/named-zones.conf
217587392a5SHajimu UMEMOTO.Pp
218587392a5SHajimu UMEMOTOExample named.conf:
219587392a5SHajimu UMEMOTO.D1 options {
220587392a5SHajimu UMEMOTO.D1 	listen-on { 127.0.0.1; };
221587392a5SHajimu UMEMOTO.D1 	include "/etc/named-options.conf";
222587392a5SHajimu UMEMOTO.D1 };
223587392a5SHajimu UMEMOTO.D1 include "/etc/named-zones.conf";
224587392a5SHajimu UMEMOTO.It Sy pdnsd_conf
225587392a5SHajimu UMEMOTOThis is the main pdnsd configuration file which we modify to add our
226587392a5SHajimu UMEMOTOforward domains to.
227587392a5SHajimu UMEMOTOIf this variable is not set then we rely on the pdnsd configuration file
228587392a5SHajimu UMEMOTOsetup to read
229587392a5SHajimu UMEMOTO.Pa pdnsd_resolv
230587392a5SHajimu UMEMOTOas documented below.
231587392a5SHajimu UMEMOTO.It Sy pdnsd_resolv
232587392a5SHajimu UMEMOTOThis file tells pdnsd about global name servers.
233587392a5SHajimu UMEMOTOIf this variable is not set then it's written to
234587392a5SHajimu UMEMOTO.Pa pdnsd_conf .
235587392a5SHajimu UMEMOTO.Pp
236587392a5SHajimu UMEMOTOExample resolvconf.conf for pdnsd:
23727c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
238587392a5SHajimu UMEMOTO.D1 pdnsd_conf=/etc/pdnsd.conf
239587392a5SHajimu UMEMOTO.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf
240587392a5SHajimu UMEMOTO.Pp
241587392a5SHajimu UMEMOTOExample pdnsd.conf:
242587392a5SHajimu UMEMOTO.D1 global {
243587392a5SHajimu UMEMOTO.D1 	server_ip = 127.0.0.1;
244587392a5SHajimu UMEMOTO.D1 	status_ctl = on;
245587392a5SHajimu UMEMOTO.D1 }
246587392a5SHajimu UMEMOTO.D1 server {
247587392a5SHajimu UMEMOTO.D1 	# A server definition is required, even if emtpy.
248587392a5SHajimu UMEMOTO.D1 	label="empty";
249587392a5SHajimu UMEMOTO.D1 	proxy_only=on;
250587392a5SHajimu UMEMOTO.D1 	# file="/etc/pdnsd-resolv.conf";
251587392a5SHajimu UMEMOTO.D1 }
252587392a5SHajimu UMEMOTO.It Sy unbound_conf
253587392a5SHajimu UMEMOTOThis file tells unbound about specific and global name servers.
254*d7149f4eSGlen Barber.It Sy unbound_insecure
255*d7149f4eSGlen BarberWhen set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC.
256587392a5SHajimu UMEMOTO.Pp
257587392a5SHajimu UMEMOTOExample resolvconf.conf for unbound:
25827c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
259587392a5SHajimu UMEMOTO.D1 unbound_conf=/etc/unbound-resolvconf.conf
260587392a5SHajimu UMEMOTO.Pp
261587392a5SHajimu UMEMOTOExample unbound.conf:
262587392a5SHajimu UMEMOTO.D1 include: /etc/unbound-resolvconf.conf
263587392a5SHajimu UMEMOTO.El
264*d7149f4eSGlen Barber.Sh SUBSCRIBER INTEGRATION
265*d7149f4eSGlen BarberNot all distributions store the files the subscribers need in the same
266*d7149f4eSGlen Barberlocations.
267*d7149f4eSGlen BarberFor example, named service scripts have been called named, bind and rc.bind
268*d7149f4eSGlen Barberand they could be located in a directory called /etc/rc.d, /etc/init.d or
269*d7149f4eSGlen Barbersimilar.
270*d7149f4eSGlen BarberEach subscriber attempts to automatically configure itself, but not every
271*d7149f4eSGlen Barberdistribution has been catered for.
272*d7149f4eSGlen BarberAlso, users could equally want to use a different version from the one
273*d7149f4eSGlen Barberinstalled by default, such as bind8 and bind9.
274*d7149f4eSGlen BarberTo accomodate this, the subscribers have these files in configurable
275*d7149f4eSGlen Barbervariables, documented below.
276*d7149f4eSGlen Barber.Pp
277*d7149f4eSGlen Barber.Bl -tag -width indent
278*d7149f4eSGlen Barber.It Sy dnsmasq_service
279*d7149f4eSGlen BarberLocation of the dnsmasq service.
280*d7149f4eSGlen Barber.It Sy dnsmasq_restart
281*d7149f4eSGlen BarberCommand to restart the dnsmasq service.
282*d7149f4eSGlen Barber.It Sy dnsmasq_pid
283*d7149f4eSGlen BarberLocation of the dnsmasq pidfile.
284*d7149f4eSGlen Barber.It Sy libc_service
285*d7149f4eSGlen BarberLocation of the libc service.
286*d7149f4eSGlen Barber.It Sy libc_restart
287*d7149f4eSGlen BarberCommand to restart the libc service.
288*d7149f4eSGlen Barber.It Sy named_service
289*d7149f4eSGlen BarberLocation of the named service.
290*d7149f4eSGlen Barber.It Sy named_restart
291*d7149f4eSGlen BarberCommand to restart the named service.
292*d7149f4eSGlen Barber.It Sy pdnsd_restart
293*d7149f4eSGlen BarberCommand to restart the pdnsd service.
294*d7149f4eSGlen Barber.It Sy unbound_service
295*d7149f4eSGlen BarberLocation of the unbound service.
296*d7149f4eSGlen Barber.It Sy unbound_restart
297*d7149f4eSGlen BarberCommand to restart the unbound service.
298*d7149f4eSGlen Barber.It Sy unbound_pid
299*d7149f4eSGlen BarberLocation of the unbound pidfile.
300*d7149f4eSGlen Barber.El
301587392a5SHajimu UMEMOTO.Sh SEE ALSO
302*d7149f4eSGlen Barber.Xr resolv.conf 5 ,
303*d7149f4eSGlen Barber.Xr resolvconf 8
304587392a5SHajimu UMEMOTOand
305*d7149f4eSGlen Barber.Xr sh 1 .
306587392a5SHajimu UMEMOTO.Sh AUTHORS
307*d7149f4eSGlen Barber.An Roy Marples Aq Mt roy@marples.name
308587392a5SHajimu UMEMOTO.Sh BUGS
309*d7149f4eSGlen BarberEach distribution is a special snowflake and likes to name the same thing
310*d7149f4eSGlen Barberdifferently, namely the named service script.
311*d7149f4eSGlen Barber.Pp
312*d7149f4eSGlen BarberPlease report them to
313*d7149f4eSGlen Barber.Lk http://roy.marples.name/projects/openresolv
314