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