DragonFly On-Line Manual Pages
RESOLVCONF(8) DragonFly System Manager's Manual RESOLVCONF(8)
resolvconf -- a framework for managing multiple DNS configurations
resolvconf [-m metric] [-p] [-x] -a interface[.protocol] <file
resolvconf [-f] -d interface[.protocol]
resolvconf [-x] -il pattern
resolvconf manages resolv.conf(5) files from multiple sources, such as
DHCP and VPN clients. Traditionally, the host runs just one client and
that updates /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 /etc/resolv.conf.
resolvconf solves this by letting the daemon send their resolv.conf(5)
file to resolvconf via stdin(4) with the argument -a interface[.protocol]
instead of the filesystem. resolvconf then updates /etc/resolv.conf as
it thinks best. When a local resolver other than libc is installed, such
as dnsmasq(8) or named(8), then resolvconf will supply files that the
resolver should be configured to include.
resolvconf assumes it has a job to do. In some situations resolvconf
needs to act as a deterrent to writing to /etc/resolv.conf. Where this
file cannot be made immutable or you just need to toggle this behaviour,
resolvconf can be disabled by adding resolvconf=NO to resolvconf.conf(5).
resolvconf can mark an interfaces resolv.conf as private. This means
that the name servers listed in that resolv.conf are only used for
queries against the domain/search listed in the same file. This only
works when a local resolver other than libc is installed. See
resolvconf.conf(5) for how to configure resolvconf to use a local name
server and how to remove the private marking.
resolvconf can mark an interfaces resolv.conf as exclusive. Only the
latest exclusive interface is used for processing, otherwise all are.
When an interface goes down, it should then call resolvconf with -d
interface.* arguments to delete the resolv.conf file(s) for all the
protocols on the interface.
Here are some options for the above commands:-
-f Ignore non existent interfaces. Only really useful for
-m metric Set the metric of the interface when adding it, default of
0. Lower metrics take precedence. This affects the default
order of interfaces when listed.
-p Marks the interface resolv.conf as private.
-x Mark the interface resolv.conf as exclusive when adding,
otherwise only use the latest exclusive interface.
resolvconf has some more commands for general usage:-
-i pattern List the interfaces and protocols, optionally matching
pattern, we have resolv.conf files for.
-l pattern List the resolv.conf files we have. If pattern is specified
then we list the files for the interfaces and protocols that
-u Force resolvconf to update all its subscribers. resolvconf
does not update the subscribers when adding a resolv.conf
that matches what it already has for that interface.
--version Echo the resolvconf version to stdout.
resolvconf also has some commands designed to be used by it's subscribers
and system startup:-
-I Initialise the state directory /var/run/resolvconf. This
only needs to be called if the initial system boot sequence
does not automatically clean it out; for example the state
directory is moved somewhere other than /var/run. If used,
it should only be called once as early in the system boot
sequence as possible and before resolvconf is used to add
-R Echo the command used to restart a service.
-r service If the service is running then restart it. If the service
does not exist or is not running then zero is returned, oth-
erwise the result of restarting the service.
-v Echo variables DOMAINS, SEARCH and NAMESERVERS so that the
subscriber can configure the resolver easily.
-V Same as -v except that only the information configured in
resolvconf.conf(5) is set.
For resolvconf to work effectively, it has to process the resolv.confs
for the interfaces in the correct order. resolvconf first processes
interfaces from the interface_order list, then interfaces without a metic
and that match the dynamic_order list, then interfaces with a metric in
order and finally the rest in the operating systems lexical order. See
resolvconf.conf(5) for details on these lists.
Here are some suggested protocol tags to use for each resolv.conf file
registered on an interface:-
dhcp Dynamic Host Configuration Protocol. Initial versions of
resolvconf did not recommend a protocol tag be appended to
the interface name. When the protocol is absent, it is
assumed to be the DHCP protocol.
ppp Point-to-Point Protocol.
ra IPv6 Router Advertisement.
dhcp6 Dynamic Host Configuration Protocol, version 6.
If a subscriber has the executable bit then it is executed otherwise it
is assumed to be a shell script and sourced into the current environment
in a subshell. This is done so that subscribers can remain fast, but are
also not limited to the shell language.
Portable subscribers should not use anything outside of /bin and /sbin
because /usr and others may not be available when booting. Also, it
would be unwise to assume any shell specific features.
If the -m option is not present then we use IF_METRIC for the metric.
Marks the interface resolv.conf as private.
Marks the interface resolv.conf as exclusive.
Backup file of the original resolv.conf.
Configuration file for resolvconf.
Directory of subscribers which are run every time resolvconf adds,
deletes or updates.
Directory of subscribers which are run after the libc subscriber is run.
State directory for resolvconf.
resolver(3), stdin(4), resolv.conf(5), resolvconf.conf(5)
This implementation of resolvconf is called openresolv and is fully com-
mand line compatible with Debian's resolvconf, as written by Thomas Hood.
Roy Marples <email@example.com>
Please report them to
resolvconf does not validate any of the files given to it.
When running a local resolver other than libc, you will need to configure
it to include files that resolvconf will generate. You should consult
resolvconf.conf(5) for instructions on how to configure your resolver.
DragonFly 5.5 November 29, 2016 DragonFly 5.5
RESOLVCONF(8) openresolv RESOLVCONF(8)
resolvconf - manage nameserver information
cat FILE | resolvconf -a INTERFACE
resolvconf -d INTERFACE
resolvconf -l PATTERN
resolvconf -i PATTERN
resolvconf -v PATTERN
resolvconf -s SERVICE COMMAND [args]
Overwrite (-a) or delete (-d) the nameserver information record for
network interface INTERFACE and run the update scripts in
With -u, just run the update scripts.
With -l, list the resolv files for each interface, optionally with pat-
terns to match interface names.
With -i, list the interfaces we have resolv files for, optionally with
patterns to match interface names.
With -v, we echo variables NEWDOMAIN, NEWSEARCH and NEWNS to the con-
sole which can be used to make it easer writing scripts which configure
With -s, we work out if the service is running by finding its pidfile
and if it is we restart it. This means that only resolvconf needs to
know this for supported platforms and subscribers can just call this
Normally resolvconf is run only by hook scripts attached to network
interface configurers such as ppp(8) (for ppp interfaces), to DHCP
clients such as dhcpcd(8), to network configuration scripts and open-
vpn, and to DNS caches such as dnsmasq(8) (for the loopback interface).
However, the administrator can also run resolvconf from the command
line to add or delete auxiliary nameserver information.
Nameserver information provided to resolvconf is stored for use by sub-
scribers to resolvconf's notification service. Subscribers that need
to know when nameserver information has changed should install a script
in /usr/local/etc/resolvconf/update.d/ (... or in
/usr/local/etc/resolvconf/update-libc.d/: see below). For example, DNS
caches such as dnsmasq(8) and pdnsd(8) subscribe to the notification
service so that they know whither to forward queries.
The most important piece of software that subscribes to the notifica-
tion service is the set of functions that make up the C Library
resolver(3). When nameserver information is updated the script
/usr/local/etc/resolvconf/update.d/libc writes a new resolver configu-
ration file to /usr/local/etc/resolvconf/run/resolv.conf and then runs
the scripts in /usr/local/etc/resolvconf/update-libc.d/. To make the
resolver use the dynamically generated resolver configuration file the
administrator should ensure that /etc/resolv.conf is a symbolic link to
/usr/local/etc/resolvconf/run/resolv.conf. This link is never modified
by resolvconf. If you find that /etc/resolv.conf is not being updated,
check to see that the link is intact.
The C Library resolver library isn't the only resolver library avail-
able. However, any resolver library that reads /etc/resolv.conf (and
most of them do, in order to be compatible with the C Library resolver)
should work with resolvconf.
openresolv ships with subscribers for dnsmasq(8) and named(8) which
handle resolv.conf a bit differently. If they handle search AND domain
options then the nameservers listed with the domain are only used when
querying for that domain.
# resolv.conf from bge0
# resolv.conf from tap0
In this instance, nameserver 188.8.131.52 will only handle requests for
bar.org and nameserver 184.108.40.206 will handle everything else.
Subscribers that need to know only when the resolver configuration file
has changed should install a script in /usr/local/etc/resolv-
conf/update-libc.d/ rather than in /usr/local/etc/resolvconf/update.d/.
(This is important for synchronization purposes: scripts in update-
libc.d/ are run after resolv.conf has been updated; the same is not
necessarily true of scripts in update.d/.)
Add or overwrite the record for network interface INTERFACE.
When this option is used the information must be provided to
resolvconf on its standard input in the format of the
resolv.conf(5) file. Each line in the file must be terminated
by a newline.
Delete the record for network interface INTERFACE.
The INTERFACE name may not contain spaces, slashes, asterisks or ini-
tial dots, hyphens or tildes.
Following the addition or deletion of the record, resolvconf runs the
update scripts as described in the CLIENTS section.
-u Just run the update scripts.
List the resolv.conf files for the interfaces that match the
pattern, otherwise all the interfaces.
List the interfaces that match the pattern otherwise all the
Echo variables NEWDOMAIN, NEWSEARCH and NEWNS to the console.
This is either a directory where nameserver information can be
stored or a symbolic link to such a directory. Clients should
not make any assumptions about the canonical location of this
directory or the hierarchy that is constructed under it.
Determines the order in which nameserver information records are
processed by resolvconf -l.
File containing basic resolver information. The lines in this
file are included in the resolver configuration file even when
no interfaces are configured.
File to be prepended to the dynamically generated resolver con-
figuration file. Normally this is just a comment line.
File to be appended to the dynamically generated resolver con-
figuration file. To append nothing, make this an empty file.
Currently resolvconf does not check the sanity of the information pro-
vided to it.
Written by Roy Marples <firstname.lastname@example.org>.
Heavily based on Debians resolvconf by Thomas Hood <jdt-
Copyright (C) 2007 Roy Marples
openresolv 9 Nov 2007 RESOLVCONF(8)