1 .\" Copyright (c) 2007-2016 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
42 .Fl d Ar interface Ns Op Ar .protocol
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 .
62 solves this by letting the daemon send their
69 .Fl a Ar interface Ns Op Ar .protocol
70 instead of the filesystem.
75 When a local resolver other than libc is installed, such as
81 will supply files that the resolver should be configured to include.
84 assumes it has a job to do.
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
92 can be disabled by adding
93 .Sy resolvconf Ns = Ns NO
95 .Xr resolvconf.conf 5 .
98 can mark an interfaces
101 This means that the name servers listed in that
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.
106 .Xr resolvconf.conf 5
109 to use a local name server.
112 can mark an interfaces
115 Only the latest exclusive interface is used for processing, otherwise all are.
117 When an interface goes down, it should then call
121 arguments to delete the
128 Here are some options for the above commands:-
129 .Bl -tag -width indent
131 Ignore non existent interfaces.
132 Only really useful for deleting interfaces.
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.
144 as exclusive when adding, otherwise only use the latest exclusive interface.
148 has some more commands for general usage:-
149 .Bl -tag -width indent
151 List the interfaces and protocols, optionally matching
162 is specified then we list the files for the interfaces and protocols
167 to update all its subscribers.
169 does not update the subscribers when adding a resolv.conf that matches
170 what it already has for that interface.
174 also has some commands designed to be used by it's subscribers and
176 .Bl -tag -width indent
178 Initialise the state directory
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
184 If used, it should only be called once as early in the system boot sequence
185 as possible and before
187 is used to add interfaces.
189 Echo the command used to restart a 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.
197 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
198 configure the resolver easily.
202 except that only the information configured in
203 .Xr resolvconf.conf 5
206 .Sh INTERFACE ORDERING
209 to work effectively, it has to process the resolv.confs for the interfaces
210 in the correct order.
212 first processes interfaces from the
214 list, then interfaces without a metic and that match the
216 list, then interfaces with a metric in order and finally the rest in
217 the operating systems lexical order.
219 .Xr resolvconf.conf 5
220 for details on these lists.
222 Here are some suggested protocol tags to use for each
224 file registered on an
225 .Ar interface Ns No :-
226 .Bl -tag -width indent
228 Dynamic Host Configuration Protocol.
233 tag be appended to the
236 When the protocol is absent, it is assumed to be the DHCP protocol.
238 Point-to-Point Protocol.
240 IPv6 Router Advertisement.
242 Dynamic Host Configuration Protocol, version 6.
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
248 This is done so that subscribers can remain fast, but are also not limited
249 to the shell language.
251 Portable subscribers should not use anything outside of
257 and others may not be available when booting.
258 Also, it would be unwise to assume any shell specific features.
264 option is not present then we use
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
284 Directory of subscribers which are run every time
286 adds, deletes or updates.
287 .It Pa @LIBEXECDIR@/libc.d
288 Directory of subscribers which are run after the libc subscriber is run.
297 .Xr resolvconf.conf 5
299 This implementation of
301 is called openresolv and is fully command line compatible with Debian's
302 resolvconf, as written by Thomas Hood.
304 .An Roy Marples Aq Mt roy@marples.name
306 Please report them to
307 .Lk http://roy.marples.name/projects/openresolv
310 does not validate any of the files given to it.
312 When running a local resolver other than libc, you will need to configure it
313 to include files that
317 .Xr resolvconf.conf 5
318 for instructions on how to configure your resolver.