1 .\" Copyright (c) 2007-2020 Roy Marples
2 .\" All rights reserved
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
30 .Nd a framework for managing multiple DNS configurations
38 .Fl a Ar interface Ns Op Ar .protocol
46 .Fl d Ar interface Ns Op Ar .protocol
58 files from multiple sources, such as DHCP and VPN clients.
59 Traditionally, the host runs just one client and that updates
60 .Pa /etc/resolv.conf .
61 More modern systems frequently have wired and wireless interfaces and there is
62 no guarantee both are on the same network.
63 With the advent of VPN and other
64 types of networking daemons, many things now contend for the contents of
65 .Pa /etc/resolv.conf .
68 solves this by letting the daemon send their
75 .Fl a Ar interface Ns Op Ar .protocol
76 instead of the filesystem.
81 When a local resolver other than libc is installed, such as
87 will supply files that the resolver should be configured to include.
90 assumes it has a job to do.
93 needs to act as a deterrent to writing to
94 .Pa /etc/resolv.conf .
95 Where this file cannot be made immutable or you just need to toggle this
98 can be disabled by adding
99 .Sy resolvconf Ns = Ns NO
101 .Xr resolvconf.conf 5 .
104 can mark an interfaces
107 This means that the name servers listed in that
109 are only used for queries against the domain/search listed in the same file.
110 This only works when a local resolver other than libc is installed.
112 .Xr resolvconf.conf 5
115 to use a local name server and how to remove the private marking.
118 can mark an interfaces
121 Only the latest exclusive interface is used for processing, otherwise all are.
123 When an interface goes down, it should then call
127 arguments to delete the
133 For systems that support the concept of persisting configuration when
134 the carrier goes down, then it should instead call
138 arguments to deprecate the matching interfaces and
140 to activate the matching interfaces when the carrier comes up.
141 This only affects the order in which interfaces are processed.
143 Here are some options for the above commands:-
144 .Bl -tag -width pattern_opt
146 Ignore non existent interfaces.
147 Only really useful for deleting interfaces.
149 Set the metric of the interface when adding it, default of 0.
150 Lower metrics take precedence.
151 This affects the default order of interfaces when listed.
159 as exclusive when adding, otherwise only use the latest exclusive interface.
163 has some more commands for general usage:-
164 .Bl -tag -width pattern_opt
166 List the interfaces and protocols, optionally matching
177 is specified then we list the files for the interfaces and protocols
182 to update all its subscribers.
184 does not update the subscribers when adding a resolv.conf that matches
185 what it already has for that interface.
187 Echo the resolvconf version to
192 also has some commands designed to be used by it's subscribers and
194 .Bl -tag -width pattern_opt
196 Initialise the state directory
198 This only needs to be called if the initial system boot sequence does not
199 automatically clean it out; for example the state directory is moved
202 If used, it should only be called once as early in the system boot sequence
203 as possible and before
205 is used to add interfaces.
207 Echo the command used to restart a service.
211 is running then restart it.
212 If the service does not exist or is not running then zero is returned,
213 otherwise the result of restarting the service.
215 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
216 configure the resolver easily.
220 except that only the information configured in
221 .Xr resolvconf.conf 5
224 .Sh INTERFACE ORDERING
227 to work effectively, it has to process the resolv.confs for the interfaces
228 in the correct order.
230 first processes interfaces from the
232 list, then interfaces without a metic and that match the
234 list, then interfaces with a metric in order and finally the rest in
235 the operating systems lexical order.
237 .Xr resolvconf.conf 5
238 for details on these lists.
240 Here are some suggested protocol tags to use for each
242 file registered on an
243 .Ar interface Ns No :-
244 .Bl -tag -width pattern_opt
246 Dynamic Host Configuration Protocol.
251 tag be appended to the
254 When the protocol is absent, it is assumed to be the DHCP protocol.
256 Point-to-Point Protocol.
258 IPv6 Router Advertisement.
260 Dynamic Host Configuration Protocol, version 6.
262 .Sh IMPLEMENTATION NOTES
263 If a subscriber has the executable bit then it is executed otherwise it is
264 assumed to be a shell script and sourced into the current environment in a
266 This is done so that subscribers can remain fast, but are also not limited
267 to the shell language.
269 Portable subscribers should not use anything outside of
275 and others may not be available when booting.
276 Also, it would be unwise to assume any shell specific features.
282 option is not present then we use
296 .It Pa /etc/resolv.conf.bak
297 Backup file of the original resolv.conf.
298 .It Pa @SYSCONFDIR@/resolvconf.conf
299 Configuration file for
302 Directory of subscribers which are run every time
304 adds, deletes or updates.
305 .It Pa @LIBEXECDIR@/libc.d
306 Directory of subscribers which are run after the libc subscriber is run.
315 .Xr resolvconf.conf 5
317 This implementation of
319 is called openresolv and is fully command line compatible with Debian's
320 resolvconf, as written by Thomas Hood.
322 .An Roy Marples Aq Mt roy@marples.name
324 Please report them to
325 .Lk http://roy.marples.name/projects/openresolv
328 does not validate any of the files given to it.
330 When running a local resolver other than libc, you will need to configure it
331 to include files that
335 .Xr resolvconf.conf 5
336 for instructions on how to configure your resolver.