]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/openresolv/resolvconf.8.in
Update the device tree source files to a Linux 4.7-RC.
[FreeBSD/FreeBSD.git] / contrib / openresolv / resolvconf.8.in
1 .\" Copyright (c) 2007-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 May 7, 2016
26 .Dt RESOLVCONF 8
27 .Os
28 .Sh NAME
29 .Nm resolvconf
30 .Nd a framework for managing multiple DNS configurations
31 .Sh SYNOPSIS
32 .Nm
33 .Fl I
34 .Nm
35 .Op Fl m Ar metric
36 .Op Fl p
37 .Op Fl x
38 .Fl a Ar interface Ns Op Ar .protocol
39 .No < Ns Pa file
40 .Nm
41 .Op Fl f
42 .Fl d Ar interface Ns Op Ar .protocol
43 .Nm
44 .Op Fl x
45 .Fl il Ar pattern
46 .Nm
47 .Fl u
48 .Sh DESCRIPTION
49 .Nm
50 manages
51 .Xr resolv.conf 5
52 files from multiple sources, such as DHCP and VPN clients.
53 Traditionally, the host runs just one client and that updates
54 .Pa /etc/resolv.conf .
55 More modern systems frequently have wired and wireless interfaces and there is
56 no guarantee both are on the same network.
57 With the advent of VPN and other
58 types of networking daemons, many things now contend for the contents of
59 .Pa /etc/resolv.conf .
60 .Pp
61 .Nm
62 solves this by letting the daemon send their
63 .Xr resolv.conf 5
64 file to
65 .Nm
66 via
67 .Xr stdin 4
68 with the argument
69 .Fl a Ar interface Ns Op Ar .protocol
70 instead of the filesystem.
71 .Nm
72 then updates
73 .Pa /etc/resolv.conf
74 as it thinks best.
75 When a local resolver other than libc is installed, such as
76 .Xr dnsmasq 8
77 or
78 .Xr named 8 ,
79 then
80 .Nm
81 will supply files that the resolver should be configured to include.
82 .Pp
83 .Nm
84 assumes it has a job to do.
85 In some situations
86 .Nm
87 needs to act as a deterrent to writing to
88 .Pa /etc/resolv.conf .
89 Where this file cannot be made immutable or you just need to toggle this
90 behaviour,
91 .Nm
92 can be disabled by adding
93 .Sy resolvconf Ns = Ns NO
94 to
95 .Xr resolvconf.conf 5 .
96 .Pp
97 .Nm
98 can mark an interfaces
99 .Pa resolv.conf
100 as private.
101 This means that the name servers listed in that
102 .Pa resolv.conf
103 are only used for queries against the domain/search listed in the same file.
104 This only works when a local resolver other than libc is installed.
105 See
106 .Xr resolvconf.conf 5
107 for how to configure
108 .Nm
109 to use a local name server.
110 .Pp
111 .Nm
112 can mark an interfaces
113 .Pa resolv.conf
114 as exclusive.
115 Only the latest exclusive interface is used for processing, otherwise all are.
116 .Pp
117 When an interface goes down, it should then call
118 .Nm
119 with
120 .Fl d Ar interface.*
121 arguments to delete the
122 .Pa resolv.conf
123 file(s) for all the
124 .Ar protocols
125 on the
126 .Ar interface .
127 .Pp
128 Here are some options for the above commands:-
129 .Bl -tag -width indent
130 .It Fl f
131 Ignore non existent interfaces.
132 Only really useful for deleting interfaces.
133 .It Fl m Ar metric
134 Set the metric of the interface when adding it, default of 0.
135 Lower metrics take precedence.
136 This affects the default order of interfaces when listed.
137 .It Fl p
138 Marks the interface
139 .Pa resolv.conf
140 as private.
141 .It Fl x
142 Mark the interface
143 .Pa resolv.conf
144 as exclusive when adding, otherwise only use the latest exclusive interface.
145 .El
146 .Pp
147 .Nm
148 has some more commands for general usage:-
149 .Bl -tag -width indent
150 .It Fl i Ar pattern
151 List the interfaces and protocols, optionally matching
152 .Ar pattern ,
153 we have
154 .Pa resolv.conf
155 files for.
156 .It Fl l Ar pattern
157 List the
158 .Pa resolv.conf
159 files we have.
160 If
161 .Ar pattern
162 is specified then we list the files for the interfaces and protocols
163 that match it.
164 .It Fl u
165 Force
166 .Nm
167 to update all its subscribers.
168 .Nm
169 does not update the subscribers when adding a resolv.conf that matches
170 what it already has for that interface.
171 .El
172 .Pp
173 .Nm
174 also has some commands designed to be used by it's subscribers and
175 system startup:-
176 .Bl -tag -width indent
177 .It Fl I
178 Initialise the state directory
179 .Pa @VARDIR@ .
180 This only needs to be called if the initial system boot sequence does not
181 automatically clean it out; for example the state directory is moved
182 somewhere other than
183 .Pa /var/run .
184 If used, it should only be called once as early in the system boot sequence
185 as possible and before
186 .Nm
187 is used to add interfaces.
188 .It Fl R
189 Echo the command used to restart a service.
190 .It Fl r Ar service
191 If the
192 .Ar service
193 is running then restart it.
194 If the service does not exist or is not running then zero is returned,
195 otherwise the result of restarting the service.
196 .It Fl v
197 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
198 configure the resolver easily.
199 .It Fl V
200 Same as
201 .Fl v
202 except that only the information configured in
203 .Xr resolvconf.conf 5
204 is set.
205 .El
206 .Sh INTERFACE ORDERING
207 For
208 .Nm
209 to work effectively, it has to process the resolv.confs for the interfaces
210 in the correct order.
211 .Nm
212 first processes interfaces from the
213 .Sy interface_order
214 list, then interfaces without a metic and that match the
215 .Sy dynamic_order
216 list, then interfaces with a metric in order and finally the rest in
217 the operating systems lexical order.
218 See
219 .Xr resolvconf.conf 5
220 for details on these lists.
221 .Sh PROTOCOLS
222 Here are some suggested protocol tags to use for each
223 .Pa resolv.conf
224 file registered on an
225 .Ar interface Ns No :-
226 .Bl -tag -width indent
227 .It dhcp
228 Dynamic Host Configuration Protocol.
229 Initial versions of
230 .Nm
231 did not recommend a
232 .Ar protocol
233 tag be appended to the
234 .Ar interface
235 name.
236 When the protocol is absent, it is assumed to be the DHCP protocol.
237 .It ppp
238 Point-to-Point Protocol.
239 .It ra
240 IPv6 Router Advertisement.
241 .It dhcp6
242 Dynamic Host Configuration Protocol, version 6.
243 .El
244 .Sh IMPLEMENTATION NOTES
245 If a subscriber has the executable bit then it is executed otherwise it is
246 assumed to be a shell script and sourced into the current environment in a
247 subshell.
248 This is done so that subscribers can remain fast, but are also not limited
249 to the shell language.
250 .Pp
251 Portable subscribers should not use anything outside of
252 .Pa /bin
253 and
254 .Pa /sbin
255 because
256 .Pa /usr
257 and others may not be available when booting.
258 Also, it would be unwise to assume any shell specific features.
259 .Sh ENVIRONMENT
260 .Bl -ohang
261 .It Va IF_METRIC
262 If the
263 .Fl m
264 option is not present then we use
265 .Va IF_METRIC
266 for the metric.
267 .It Va IF_PRIVATE
268 Marks the interface
269 .Pa resolv.conf
270 as private.
271 .It Va IF_EXCLUSIVE
272 Marks the interface
273 .Pa resolv.conf
274 as exclusive.
275 .El
276 .Sh FILES
277 .Bl -ohang
278 .It Pa /etc/resolv.conf.bak
279 Backup file of the original resolv.conf.
280 .It Pa @SYSCONFDIR@/resolvconf.conf
281 Configuration file for
282 .Nm .
283 .It Pa @LIBEXECDIR@
284 Directory of subscribers which are run every time
285 .Nm
286 adds, deletes or updates.
287 .It Pa @LIBEXECDIR@/libc.d
288 Directory of subscribers which are run after the libc subscriber is run.
289 .It Pa @VARDIR@
290 State directory for
291 .Nm .
292 .El
293 .Sh SEE ALSO
294 .Xr resolver 3 ,
295 .Xr stdin 4 ,
296 .Xr resolv.conf 5 ,
297 .Xr resolvconf.conf 5
298 .Sh HISTORY
299 This implementation of
300 .Nm
301 is called openresolv and is fully command line compatible with Debian's
302 resolvconf, as written by Thomas Hood.
303 .Sh AUTHORS
304 .An Roy Marples Aq Mt roy@marples.name
305 .Sh BUGS
306 Please report them to
307 .Lk http://roy.marples.name/projects/openresolv
308 .Pp
309 .Nm
310 does not validate any of the files given to it.
311 .Pp
312 When running a local resolver other than libc, you will need to configure it
313 to include files that
314 .Nm
315 will generate.
316 You should consult
317 .Xr resolvconf.conf 5
318 for instructions on how to configure your resolver.