xref: /freebsd/contrib/openresolv/resolvconf.conf.5.in (revision 2d004dd5bc51eaef924f55d1e2407e80a9b4bcb5)
1d7149f4eSGlen 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*2d004dd5SPedro F. Giffuni.Dd May 14, 2015
26d7149f4eSGlen 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.
45d7149f4eSGlen BarberIf the values contain white space for special shell characters,
46d7149f4eSGlen 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.
51d7149f4eSGlen Barber.Pp
52d7149f4eSGlen BarberWhen a dynamically generated list is appended or prepended to, the whole
53d7149f4eSGlen Barberis made unique where left-most wins.
54587392a5SHajimu UMEMOTO.Sh RESOLVCONF OPTIONS
55587392a5SHajimu UMEMOTO.Bl -tag -width indent
56d7149f4eSGlen Barber.It Sy resolvconf
57d7149f4eSGlen BarberSet to NO to disable
58d7149f4eSGlen Barber.Nm resolvconf
59d7149f4eSGlen Barberfrom running any subscribers.
60d7149f4eSGlen 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]*
69d7149f4eSGlen Barber.It Sy local_nameservers
70d7149f4eSGlen BarberIf unset, defaults to the following:-
71d7149f4eSGlen 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.
76d7149f4eSGlen Barber.It Sy domain_blacklist
77d7149f4eSGlen BarberA list of domains to be removed from consideration.
78d7149f4eSGlen BarberTo remove a domain, you can use foo.*
79d7149f4eSGlen 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.
86d7149f4eSGlen Barber.It Sy name_server_blacklist
87d7149f4eSGlen BarberA list of name servers to be removed from consideration.
88d7149f4eSGlen BarberThe default is 0.0.0.0 as some faulty routers send it via DHCP.
89d7149f4eSGlen 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.
94*2d004dd5SPedro F. GiffuniSetting
95*2d004dd5SPedro F. Giffuni.Sy private_interfaces Ns ="*"
96*2d004dd5SPedro F. Giffuniwill stop the forwarding of the root zone and allows the local resolver to
97*2d004dd5SPedro F. Giffunirecursively query the root servers directly.
98*2d004dd5SPedro F. GiffuniRequires a local nameserver other than libc.
99587392a5SHajimu UMEMOTOThis is equivalent to the
100587392a5SHajimu UMEMOTO.Nm resolvconf -p
101587392a5SHajimu UMEMOTOoption.
102d7149f4eSGlen Barber.It Sy replace
103d7149f4eSGlen BarberIs a space separated list of replacement keywords. The syntax is this:
104d7149f4eSGlen Barber.Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement
105d7149f4eSGlen Barber.Pp
106d7149f4eSGlen BarberExample, given this resolv.conf:
107d7149f4eSGlen Barber.D1 domain foo.org
108d7149f4eSGlen Barber.D1 search foo.org dead.beef
109d7149f4eSGlen Barber.D1 nameserver 1.2.3.4
110d7149f4eSGlen Barber.D1 nameserver 2.3.4.5
111d7149f4eSGlen Barberand this configuaration:
112d7149f4eSGlen Barber.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/"
113d7149f4eSGlen Barberyou would get this resolv.conf instead:
114d7149f4eSGlen Barber.D1 domain foo.org
115d7149f4eSGlen Barber.D1 search bar.com
116d7149f4eSGlen Barber.D1 nameserver 5.6.7.8
117d7149f4eSGlen Barber.It Sy replace_sub
118d7149f4eSGlen BarberWorks the same way as
119d7149f4eSGlen Barber.Sy replace
120d7149f4eSGlen Barberexcept it works on each space separated value rather than the whole line,
121d7149f4eSGlen Barberso it's useful for the replacing a single domain within the search directive.
122d7149f4eSGlen BarberUsing the same example resolv.conf and changing
123d7149f4eSGlen Barber.Sy replace
124d7149f4eSGlen Barberto
125d7149f4eSGlen Barber.Sy replace_sub ,
126d7149f4eSGlen Barberyou would get this resolv.conf instead:
127d7149f4eSGlen Barber.D1 domain foo.org
128d7149f4eSGlen Barber.D1 search bar.com dead.beef
129d7149f4eSGlen Barber.D1 nameserver 5.6.7.8
130587392a5SHajimu UMEMOTO.It Sy state_dir
131587392a5SHajimu UMEMOTOOverride the default state directory of
132587392a5SHajimu UMEMOTO.Pa @VARDIR@ .
133587392a5SHajimu UMEMOTOThis should not be changed once
134587392a5SHajimu UMEMOTO.Nm resolvconf
135587392a5SHajimu UMEMOTOis in use unless the old directory is copied to the new one.
136587392a5SHajimu UMEMOTO.El
137587392a5SHajimu UMEMOTO.Sh LIBC OPTIONS
138587392a5SHajimu UMEMOTOThe following variables affect
139587392a5SHajimu UMEMOTO.Xr resolv.conf 5
140587392a5SHajimu UMEMOTOdirectly:-
141587392a5SHajimu UMEMOTO.Bl -tag -width indent
142587392a5SHajimu UMEMOTO.It Sy resolv_conf
143587392a5SHajimu UMEMOTODefaults to
144587392a5SHajimu UMEMOTO.Pa /etc/resolv.conf
145587392a5SHajimu UMEMOTOif not set.
146587392a5SHajimu UMEMOTO.It Sy resolv_conf_options
147587392a5SHajimu UMEMOTOA list of libc resolver options, as specified in
148587392a5SHajimu UMEMOTO.Xr resolv.conf 5 .
149587392a5SHajimu UMEMOTO.It Sy resolv_conf_passthrough
150587392a5SHajimu UMEMOTOWhen set to YES the latest resolv.conf is written to
151587392a5SHajimu UMEMOTO.Sy resolv_conf
152587392a5SHajimu UMEMOTOwithout any alteration.
153d7149f4eSGlen BarberWhen set to /dev/null or NULL,
154d7149f4eSGlen Barber.Sy resolv_conf_local_only
155d7149f4eSGlen Barberis defaulted to NO,
156d7149f4eSGlen Barber.Sy local_nameservers
157*2d004dd5SPedro F. Giffuniis unset unless overridden and only the information set in
158d7149f4eSGlen Barber.Nm
159d7149f4eSGlen Barberis written to
160d7149f4eSGlen Barber.Sy resolv_conf .
161d7149f4eSGlen Barber.It Sy resolv_conf_sortlist
162d7149f4eSGlen BarberA libc resolver sortlist, as specified in
163d7149f4eSGlen Barber.Xr resolv.conf 5 .
164d7149f4eSGlen Barber.It Sy resolv_conf_local_only
165d7149f4eSGlen BarberIf a local name server is configured then the default is just to specify that
166d7149f4eSGlen Barberand ignore all other entries as they will be configured for the local
167d7149f4eSGlen Barbername server.
168d7149f4eSGlen BarberSet this to NO to also list non-local nameservers.
169d7149f4eSGlen BarberThis will give you working DNS even if the local nameserver stops functioning
170d7149f4eSGlen Barberat the expense of duplicated server queries.
171d7149f4eSGlen Barber.It Sy append_nameservers
172d7149f4eSGlen BarberAppend name servers to the dynamically generated list.
173d7149f4eSGlen Barber.It Sy prepend_nameservers
174d7149f4eSGlen BarberPrepend name servers to the dynamically generated list.
175d7149f4eSGlen Barber.It Sy append_search
176d7149f4eSGlen BarberAppend search domains to the dynamically generated list.
177d7149f4eSGlen Barber.It Sy prepend_search
178d7149f4eSGlen BarberPrepend search domains to the dynamically generated list.
179587392a5SHajimu UMEMOTO.El
180587392a5SHajimu UMEMOTO.Sh SUBSCRIBER OPTIONS
181587392a5SHajimu UMEMOTOopenresolv ships with subscribers for the name servers
182587392a5SHajimu UMEMOTO.Xr dnsmasq 8 ,
183587392a5SHajimu UMEMOTO.Xr named 8 ,
184587392a5SHajimu UMEMOTO.Xr pdnsd 8
185587392a5SHajimu UMEMOTOand
186587392a5SHajimu UMEMOTO.Xr unbound 8 .
187587392a5SHajimu UMEMOTOEach subscriber can create configuration files which should be included in
188587392a5SHajimu UMEMOTOin the subscribers main configuration file.
189d7149f4eSGlen Barber.Pp
190d7149f4eSGlen BarberTo disable a subscriber, simply set it's name to NO.
191d7149f4eSGlen BarberFor example, to disable the libc subscriber you would set:
192d7149f4eSGlen Barber.D1 libc=NO
193587392a5SHajimu UMEMOTO.Bl -tag -width indent
194587392a5SHajimu UMEMOTO.It Sy dnsmasq_conf
195587392a5SHajimu UMEMOTOThis file tells dnsmasq which name servers to use for specific domains.
196587392a5SHajimu UMEMOTO.It Sy dnsmasq_resolv
197587392a5SHajimu UMEMOTOThis file tells dnsmasq which name servers to use for global lookups.
198587392a5SHajimu UMEMOTO.Pp
199587392a5SHajimu UMEMOTOExample resolvconf.conf for dnsmasq:
20027c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
201587392a5SHajimu UMEMOTO.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf
202587392a5SHajimu UMEMOTO.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf
203587392a5SHajimu UMEMOTO.Pp
204587392a5SHajimu UMEMOTOExample dnsmasq.conf:
205587392a5SHajimu UMEMOTO.D1 listen-address=127.0.0.1
206d7149f4eSGlen Barber.D1 # If dnsmasq is compiled for DBus then we can take
207d7149f4eSGlen Barber.D1 # advantage of not having to restart dnsmasq.
208d7149f4eSGlen Barber.D1 enable-dbus
209587392a5SHajimu UMEMOTO.D1 conf-file=/etc/dnsmasq-conf.conf
210587392a5SHajimu UMEMOTO.D1 resolv-file=/etc/dnsmasq-resolv.conf
211587392a5SHajimu UMEMOTO.It Sy named_options
212587392a5SHajimu UMEMOTOInclude this file in the named options block.
213587392a5SHajimu UMEMOTOThis file tells named which name servers to use for global lookups.
214587392a5SHajimu UMEMOTO.It Sy named_zones
215587392a5SHajimu UMEMOTOInclude this file in the named global scope, after the options block.
216587392a5SHajimu UMEMOTOThis file tells named which name servers to use for specific domains.
217587392a5SHajimu UMEMOTO.Pp
218587392a5SHajimu UMEMOTOExample resolvconf.conf for named:
21927c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
220587392a5SHajimu UMEMOTO.D1 named_options=/etc/named-options.conf
221587392a5SHajimu UMEMOTO.D1 named_zones=/etc/named-zones.conf
222587392a5SHajimu UMEMOTO.Pp
223587392a5SHajimu UMEMOTOExample named.conf:
224587392a5SHajimu UMEMOTO.D1 options {
225587392a5SHajimu UMEMOTO.D1 	listen-on { 127.0.0.1; };
226587392a5SHajimu UMEMOTO.D1 	include "/etc/named-options.conf";
227587392a5SHajimu UMEMOTO.D1 };
228587392a5SHajimu UMEMOTO.D1 include "/etc/named-zones.conf";
229587392a5SHajimu UMEMOTO.It Sy pdnsd_conf
230587392a5SHajimu UMEMOTOThis is the main pdnsd configuration file which we modify to add our
231587392a5SHajimu UMEMOTOforward domains to.
232587392a5SHajimu UMEMOTOIf this variable is not set then we rely on the pdnsd configuration file
233587392a5SHajimu UMEMOTOsetup to read
234587392a5SHajimu UMEMOTO.Pa pdnsd_resolv
235587392a5SHajimu UMEMOTOas documented below.
236587392a5SHajimu UMEMOTO.It Sy pdnsd_resolv
237587392a5SHajimu UMEMOTOThis file tells pdnsd about global name servers.
238587392a5SHajimu UMEMOTOIf this variable is not set then it's written to
239587392a5SHajimu UMEMOTO.Pa pdnsd_conf .
240587392a5SHajimu UMEMOTO.Pp
241587392a5SHajimu UMEMOTOExample resolvconf.conf for pdnsd:
24227c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
243587392a5SHajimu UMEMOTO.D1 pdnsd_conf=/etc/pdnsd.conf
244587392a5SHajimu UMEMOTO.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf
245587392a5SHajimu UMEMOTO.Pp
246587392a5SHajimu UMEMOTOExample pdnsd.conf:
247587392a5SHajimu UMEMOTO.D1 global {
248587392a5SHajimu UMEMOTO.D1 	server_ip = 127.0.0.1;
249587392a5SHajimu UMEMOTO.D1 	status_ctl = on;
250587392a5SHajimu UMEMOTO.D1 }
251587392a5SHajimu UMEMOTO.D1 server {
252587392a5SHajimu UMEMOTO.D1 	# A server definition is required, even if emtpy.
253587392a5SHajimu UMEMOTO.D1 	label="empty";
254587392a5SHajimu UMEMOTO.D1 	proxy_only=on;
255587392a5SHajimu UMEMOTO.D1 	# file="/etc/pdnsd-resolv.conf";
256587392a5SHajimu UMEMOTO.D1 }
257587392a5SHajimu UMEMOTO.It Sy unbound_conf
258587392a5SHajimu UMEMOTOThis file tells unbound about specific and global name servers.
259d7149f4eSGlen Barber.It Sy unbound_insecure
260d7149f4eSGlen BarberWhen set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC.
261587392a5SHajimu UMEMOTO.Pp
262587392a5SHajimu UMEMOTOExample resolvconf.conf for unbound:
26327c9070eSAndrey A. Chernov.D1 name_servers=127.0.0.1
264587392a5SHajimu UMEMOTO.D1 unbound_conf=/etc/unbound-resolvconf.conf
265587392a5SHajimu UMEMOTO.Pp
266587392a5SHajimu UMEMOTOExample unbound.conf:
267587392a5SHajimu UMEMOTO.D1 include: /etc/unbound-resolvconf.conf
268587392a5SHajimu UMEMOTO.El
269d7149f4eSGlen Barber.Sh SUBSCRIBER INTEGRATION
270d7149f4eSGlen BarberNot all distributions store the files the subscribers need in the same
271d7149f4eSGlen Barberlocations.
272d7149f4eSGlen BarberFor example, named service scripts have been called named, bind and rc.bind
273d7149f4eSGlen Barberand they could be located in a directory called /etc/rc.d, /etc/init.d or
274d7149f4eSGlen Barbersimilar.
275d7149f4eSGlen BarberEach subscriber attempts to automatically configure itself, but not every
276d7149f4eSGlen Barberdistribution has been catered for.
277d7149f4eSGlen BarberAlso, users could equally want to use a different version from the one
278d7149f4eSGlen Barberinstalled by default, such as bind8 and bind9.
279*2d004dd5SPedro F. GiffuniTo accommodate this, the subscribers have these files in configurable
280d7149f4eSGlen Barbervariables, documented below.
281d7149f4eSGlen Barber.Pp
282d7149f4eSGlen Barber.Bl -tag -width indent
283d7149f4eSGlen Barber.It Sy dnsmasq_service
284d7149f4eSGlen BarberLocation of the dnsmasq service.
285d7149f4eSGlen Barber.It Sy dnsmasq_restart
286d7149f4eSGlen BarberCommand to restart the dnsmasq service.
287d7149f4eSGlen Barber.It Sy dnsmasq_pid
288d7149f4eSGlen BarberLocation of the dnsmasq pidfile.
289d7149f4eSGlen Barber.It Sy libc_service
290d7149f4eSGlen BarberLocation of the libc service.
291d7149f4eSGlen Barber.It Sy libc_restart
292d7149f4eSGlen BarberCommand to restart the libc service.
293d7149f4eSGlen Barber.It Sy named_service
294d7149f4eSGlen BarberLocation of the named service.
295d7149f4eSGlen Barber.It Sy named_restart
296d7149f4eSGlen BarberCommand to restart the named service.
297d7149f4eSGlen Barber.It Sy pdnsd_restart
298d7149f4eSGlen BarberCommand to restart the pdnsd service.
299d7149f4eSGlen Barber.It Sy unbound_service
300d7149f4eSGlen BarberLocation of the unbound service.
301d7149f4eSGlen Barber.It Sy unbound_restart
302d7149f4eSGlen BarberCommand to restart the unbound service.
303d7149f4eSGlen Barber.It Sy unbound_pid
304d7149f4eSGlen BarberLocation of the unbound pidfile.
305d7149f4eSGlen Barber.El
306587392a5SHajimu UMEMOTO.Sh SEE ALSO
307d7149f4eSGlen Barber.Xr resolv.conf 5 ,
308d7149f4eSGlen Barber.Xr resolvconf 8
309587392a5SHajimu UMEMOTOand
310d7149f4eSGlen Barber.Xr sh 1 .
311587392a5SHajimu UMEMOTO.Sh AUTHORS
312d7149f4eSGlen Barber.An Roy Marples Aq Mt roy@marples.name
313587392a5SHajimu UMEMOTO.Sh BUGS
314d7149f4eSGlen BarberEach distribution is a special snowflake and likes to name the same thing
315d7149f4eSGlen Barberdifferently, namely the named service script.
316d7149f4eSGlen Barber.Pp
317d7149f4eSGlen BarberPlease report them to
318d7149f4eSGlen Barber.Lk http://roy.marples.name/projects/openresolv
319