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