xref: /netbsd-src/external/bsd/openresolv/dist/resolvconf.conf.5.in (revision bfcefd56cfc74946ba0f251734a8426a0b91e115)
1.\" Copyright (c) 2009-2013 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 April 27, 2013
26.Dt RESOLVCONF.CONF 5 SMM
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.
45.Pp
46After updating this file, you may wish to run
47.Nm resolvconf -u
48to apply the new configuration.
49.Sh RESOLVCONF OPTIONS
50.Bl -tag -width indent
51.It Sy interface_order
52These interfaces will always be processed first.
53If unset, defaults to the following:-
54.D1 lo lo[0-9]*
55.It Sy dynamic_order
56These interfaces will be processed next, unless they have a metric.
57If unset, defaults to the following:-
58.D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
59.It Sy search_domains
60Prepend search domains to the dynamically generated list.
61.It Sy search_domains_append
62Append search domains to the dynamically generated list.
63.It Sy domain_blacklist
64A list of domains to be removed from consideration.
65To remove a domain, you can use foo.*
66To remove a sub domain, you can use *.bar
67.It Sy name_servers
68Prepend name servers to the dynamically generated list.
69You should set this to 127.0.0.1 if you use a local name server other than
70libc.
71.It Sy name_servers_append
72Append name servers to the dynamically generated list.
73.It Sy name_server_blacklist
74A list of name servers to be removed from consideration.
75The default is 0.0.0.0 as some faulty routers send it via DHCP.
76To remove a block, you can use 192.168.*
77.It Sy private_interfaces
78These interfaces name servers will only be queried for the domains listed
79in their resolv.conf.
80Useful for VPN domains.
81This is equivalent to the
82.Nm resolvconf -p
83option.
84.It Sy state_dir
85Override the default state directory of
86.Pa @VARDIR@ .
87This should not be changed once
88.Nm resolvconf
89is in use unless the old directory is copied to the new one.
90.El
91.Sh LIBC OPTIONS
92The following variables affect
93.Xr resolv.conf 5
94directly:-
95.Bl -tag -width indent
96.It Sy resolv_conf
97Defaults to
98.Pa /etc/resolv.conf
99if not set.
100.It Sy resolv_conf_options
101A list of libc resolver options, as specified in
102.Xr resolv.conf 5 .
103.It Sy resolv_conf_passthrough
104When set to YES the latest resolv.conf is written to
105.Sy resolv_conf
106without any alteration.
107.It Sy resolv_conf_sortlist
108A libc resolver sortlist, as specified in
109.Xr resolv.conf 5 .
110.It Sy resolv_conf_local_only
111If a local name server is configured then the default is just to specify that
112and ignore all other entries as they will be configured for the local
113name server.
114Set this to NO to also list non-local nameservers.
115This will give you working DNS even if the local nameserver stops functioning
116at the expense of duplicated server queries.
117.El
118.Sh SUBSCRIBER OPTIONS
119openresolv ships with subscribers for the name servers
120.Xr dnsmasq 8 ,
121.Xr named 8 ,
122.Xr pdnsd 8
123and
124.Xr unbound 8 .
125Each subscriber can create configuration files which should be included in
126in the subscribers main configuration file.
127.Bl -tag -width indent
128.It Sy dnsmasq_conf
129This file tells dnsmasq which name servers to use for specific domains.
130.It Sy dnsmasq_resolv
131This file tells dnsmasq which name servers to use for global lookups.
132.Pp
133Example resolvconf.conf for dnsmasq:
134.D1 name_servers=127.0.0.1
135.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf
136.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf
137.Pp
138Example dnsmasq.conf:
139.D1 listen-address=127.0.0.1
140.D1 # If dnsmasq is compiled for DBus then we can take
141.D1 # advantage of not having to restart dnsmasq.
142.D1 enable-dbus
143.D1 conf-file=/etc/dnsmasq-conf.conf
144.D1 resolv-file=/etc/dnsmasq-resolv.conf
145.It Sy named_options
146Include this file in the named options block.
147This file tells named which name servers to use for global lookups.
148.It Sy named_zones
149Include this file in the named global scope, after the options block.
150This file tells named which name servers to use for specific domains.
151.Pp
152Example resolvconf.conf for named:
153.D1 name_servers=127.0.0.1
154.D1 named_options=/etc/named-options.conf
155.D1 named_zones=/etc/named-zones.conf
156.Pp
157Example named.conf:
158.D1 options {
159.D1 	listen-on { 127.0.0.1; };
160.D1 	include "/etc/named-options.conf";
161.D1 };
162.D1 include "/etc/named-zones.conf";
163.It Sy pdnsd_conf
164This is the main pdnsd configuration file which we modify to add our
165forward domains to.
166If this variable is not set then we rely on the pdnsd configuration file
167setup to read
168.Pa pdnsd_resolv
169as documented below.
170.It Sy pdnsd_resolv
171This file tells pdnsd about global name servers.
172If this variable is not set then it's written to
173.Pa pdnsd_conf .
174.Pp
175Example resolvconf.conf for pdnsd:
176.D1 name_servers=127.0.0.1
177.D1 pdnsd_conf=/etc/pdnsd.conf
178.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf
179.Pp
180Example pdnsd.conf:
181.D1 global {
182.D1 	server_ip = 127.0.0.1;
183.D1 	status_ctl = on;
184.D1 }
185.D1 server {
186.D1 	# A server definition is required, even if emtpy.
187.D1 	label="empty";
188.D1 	proxy_only=on;
189.D1 	# file="/etc/pdnsd-resolv.conf";
190.D1 }
191.It Sy unbound_conf
192This file tells unbound about specific and global name servers.
193.Pp
194Example resolvconf.conf for unbound:
195.D1 name_servers=127.0.0.1
196.D1 unbound_conf=/etc/unbound-resolvconf.conf
197.Pp
198Example unbound.conf:
199.D1 include: /etc/unbound-resolvconf.conf
200.El
201.Sh SUBSCRIBER INTEGRATION
202Not all distributions store the files the subscribers need in the same
203locations.
204For example, named service scripts have been called named, bind and rc.bind
205and they could be located in a directory called /etc/rc.d, /etc/init.d or
206similar.
207Each subscriber attempts to automatically configure itself, but not every
208distribution has been catered for.
209Also, users could equally want to use a different version from the one
210installed by default, such as bind8 and bind9.
211To accomodate this, the subscribers have these files in configurable
212variables, documented below.
213.Pp
214.Bl -tag -width indent
215.It Sy dnsmasq_service
216Location of the dnsmasq service.
217.It Sy dnsmasq_restart
218Command to restart the dnsmasq service.
219.It Sy dnsmasq_pid
220Location of the dnsmasq pidfile.
221.It Sy libc_service
222Location of the libc service.
223.It Sy libc_restart
224Command to restart the libc service.
225.It Sy named_service
226Location of the named service.
227.It Sy named_restart
228Command to restart the named service.
229.It Sy pdnsd_restart
230Command to restart the pdnsd service.
231.It Sy unbound_service
232Location of the unbound service.
233.It Sy unbound_restart
234Command to restart the unbound service.
235.It Sy unbound_pid
236Location of the unbound pidfile.
237.El
238.Sh SEE ALSO
239.Xr resolv.conf 5
240and
241.Xr resolvconf 8 .
242.Sh AUTHORS
243.An Roy Marples Aq Mt roy@marples.name
244.Sh BUGS
245Each distribution is a special snowflake and likes to name the same thing
246differently, namely the named service script.
247.Pp
248Please report them to
249.Lk http://roy.marples.name/projects/openresolv
250