.\" Copyright 2007-2008 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd Mar 05, 2008 .Dt RESOLVCONF 8 SMM .Sh NAME .Nm resolvconf .Nd a framework for managing multiple DNS configurations .Sh SYNOPSIS .Nm .Fl a Ar interface No < Ns Pa file .Nm .Op Fl f .Fl d Ar interface .Nm .Fl il Ar pattern .Nm .Fl u .Sh DESCRIPTION .Nm manages .Xr resolv.conf 5 files from multiple sources, such as DHCP and VPN clients. Traditionally, the host runs just one client and that updates .Pa /etc/resolv.conf . More modern systems frequently have wired and wireless interfaces and there is no guarantee both are on the same network. With the advent of VPN and other types of networking daemons, many things now contend for the contents of .Pa /etc/resolv.conf . .Pp .Nm solves this by letting the daemon send their .Xr resolv.conf 5 file to .Nm via .Xr stdin 3 with the argument .Fl a Ar interface instead of the filesystem. .Nm then updates .Pa /etc/resolv.conf as it thinks best. When a local resolver other than libc is installed, such as .Xr dnsmasq 8 or .Xr named 8 then .Nm will configure .Pa /etc/resolv.conf to use that and supply files that the resolver should be configured to include. This allows .Nm to configure the local resolver such that .Pa resolv.conf files specifiying a domain only query the listed nameservers when resolving for that domain. Otherwise the nameservers are treated as global nameservers. This in turn means, that you can trivially configure nameservers for say VPN domains. Example:- .Bd -literal -offset indent # resolv.conf from bge0 search foo.com nameserver 1.2.3.4 # resolv.conf from tap0 domain bar.org nameserver 5.6.7.8 .Ed .Pp In this instance, nameserver 5.6.7.8 will only handle requests for bar.org and nameserver 1.2.3.4 will handle everything else. .Pp When an interface goes down, it should then call .Nm with .Fl d Ar interface arguments to delete the .Pa resolv.conf file for the .Ar interface . .Pp Here are some more options that .Nm has:- .Bl -tag -width indent .It Fl f Ignore non existant interfaces. Only really useful for deleting interfaces. .It Fl i Ar pattern List the interfaces, optionally matching .Ar pattern , we have .Pa resolv.conf files for. .It Fl l Ar pattern List the .Pa resolv.conf files we have. If .Ar pattern is specified then we list the files for the interfaces that match it. .It Fl u Force .Nm to update all it's helpers. .El .Pp .Nm also has some options designed to be used by it's helpers:- .Bl -tag -width indent .It Fl s Ar service Ar command ... Try and send the .Ar command to the system .Ar service . Normally this is something like .Ar resolvconf -s named restart . We have this command, so the helpers don't have to know too much about the operating system on the host. .It Fl v Echo variables NEWDOMAIN, NEWSEARCH and NEWNS so that the helper can configure the resolver easily. .El .Sh FILES .Bl -ohang .It Pa @VARBASE@/run/resolvconf Directory that holds the data for .Nm . You could symlink .Pa /etc/resolv.conf to .Pa @VARBASE@/run/resolvconf/resolv.conf to support a read only .Pa /etc . .It Pa @SYSCONFDIR@/update.d Directory of the helper scripts which are run every time .Nm adds, deletes or updates. .It Pa @SYSCONFDIR@/update-libc.d Directory of helper scripts which are run after the libc helper script is run. .It Pa @SYSCONFDIR@/interface-order Determines the order in which nameserver information records are processed by resolvconf -l. .It Pa @SYSCONFDIR@/resolv.conf.d/base Contains basic resolver information which is included in .Pa /etc/resolv.conf even when no interfaces are configured. .It Pa @SYSCONFDIR@/resolv.conf.d/head File to be prepended to .Pa /etc/resolv.conf . Normally this is just a comment line. .It Pa @SYSCONFDIR@/resolv.conf.d/tail File to be appended to .Pa /etc/resolv.conf . .El .Sh HISTORY This implementation of .Nm is called openresolv and is fully command line compatible with Debians resolvconf, as written by Thomas Hood, on which openresolv is based. openresolv also shares a similar directory structure with the Debian version, but the included helpers are not compatible. .Pp The Debian version only works with bash and other GNU userland tools, whereas openresolv works with a POSIX shell and userland tools. .Sh BUGS .Nm does not validate any of the files given to it. .Pp When running a local resolver other than libc, you will need to configure it to include files that .Nm will generate. You should consult the comment section in the helper script for your resolver found in @SYSCONFDIR@/update.d for instructions on this. .Sh SEE ALSO .Xr dnsmasq 8 , .Xr named 8 , .Xr resolv.conf 5 , .Xr resolver 3 , .Xr stdin 3 .Sh AUTHORS .An "Roy Marples" Aq roy@marples.name .Sh BUGS Please report them to http://bugs.marples.name