resolvconf (8) - Linux Manuals
resolvconf: manage nameserver information
NAME
resolvconf - manage nameserver information
SYNOPSIS
cat FILE | resolvconf -a IFACE.PROGresolvconf -d IFACE.PROG
resolvconf -u
resolvconf --enable-updates | --disable-updates | --updates-are-enabled
DESCRIPTION
The resolvconf package comprises a simple database for run-time nameserver information and a simple framework for notifying applications of changes in that information. Resolvconf thus sets itself up as the intermediary between programs that supply nameserver information and applications that use that information.Information is added to or removed from the database using the resolvconf program. See the OPTIONS section below for a discussion of the available options.
SUPPLIERS OF NAMESERVER INFORMATION
Normally the resolvconf program is run only by network interface configuration programs such as ifup(8), ifdown, NetworkManager(8), dhclient(8), and pppd(8); and by local nameservers such as dnsmasq(8). These programs obtain nameserver information from some source and push it to resolvconf.dhclient
The dhclient program, for example, may receive nameserver addresses and domain search list information during its negotiation with the DHCP server; if so, its hook script /etc/dhcp/dhclient-enter-hooks.d/resolvconf pushes this information to resolvconf.ifup
The ifup program can be used to configure network interfaces according to settings in /etc/network/interfaces. To make ifup push nameserver information to resolvconf when it configures an interface the administrator must add dns- option lines to the relevant iface stanza in interfaces(5). The following option names are accepted: dns-nameserver, dns-search, and dns-sortlist.To add a nameserver IP address, add an option line consisting of dns-nameserver and the address. To add multiple nameserver addresses, include multiple such dns-nameserver lines.
To add search domain names, add a line beginning with
dns-search.
The
dns-nameservers
option is also accepted and, unlike
dns-nameserver,
can be given multiple arguments,
separated by spaces.
The
dns-domain
option is deprecated in favor of
dns-search.
The resulting stanza might look like the following example.
N.B.: On a machine where resolvconf
has just been or is about to be installed
and which previously relied on a static
/etc/resolv.conf
file,
The dynamically generated resolver configuration file
always starts with the contents of
/etc/resolvconf/resolv.conf.d/head
and ends with the contents of
/etc/resolvconf/resolv.conf.d/tail.
Between
head
and
tail
the
libc
script inserts
dynamic nameserver information
compiled from,
first,
information provided for configured interfaces;
second,
static information from
/etc/resolvconf/resolv.conf.d/base.
Specifically, it writes:
To make the resolver use
this dynamically generated resolver configuration file
the administrator should ensure that
/etc/resolv.conf
is a symbolic link to
/run/resolvconf/resolv.conf.
This link is normally created on installation of the resolvconf package.
The link is never modified by the
resolvconf
program itself.
If you find that
/etc/resolv.conf
is not being updated,
please check to make sure that the link is intact.
The GNU C Library resolver library isn't the only resolver library available.
However, any resolver library that reads
/etc/resolv.conf
(and most of them do, in order to be compatible)
should work fine with resolvconf.
Subscriber packages that need to know only when the resolver configuration file
has changed should install a script in
/etc/resolvconf/update-libc.d/
rather than in
/etc/resolvconf/update.d/.
(For example, two packages that install
update-libc.d/
hook scripts are
fetchmail
and
squid.)
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/.
The string
IFACE.PROG
may not contain
spaces,
slashes,
an initial dot,
an initial hyphen
or an initial tilde.
It is conventionally formed from
IFACE,
the name of the interface involved,
a dot,
and
IPROG,
the name of the interface configuration program,
e.g., "eth0.dhclient".
Note also that a copy of this file is included in the database
until the first reboot after installation of the resolvconf package;
this ensures that nameservers reachable before installation of resolvconf
are still reachable after installation of resolvconf even though
at that point
not all suppliers of nameserver information may have supplied their
information to
resolvconf(8).
Note also
that the administrator can choose to create a symbolic link in
/etc/resolvconf/resolv.conf.d/
from
tail
to
original
so that the contents of
original
are always added to the end of the
dynamically generated file.
Read the resolvconf package
README
file for more in-depth information.
Command line
The administrator
can
run
resolvconf
from the command line to add or delete nameserver information,
but this is not normally necessary or advisable.
CONSUMERS OF NAMESERVER INFORMATION
Nameserver information provided to
resolvconf
is stored for use by subscribers to
resolvconf's
notification service.
Subscriber packages that need to know when nameserver information has changed
should install a script in
/etc/resolvconf/update.d/
(or in
/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.
Client hook scripts will find the files containing nameserver
information in the current directory.
libc
The most important software package
that subscribes to the notification service
is the GNU C Library
resolver(3).
This library is used by many applications
that need to resolve domain names.
When nameserver information is updated, the script
/etc/resolvconf/update.d/libc
generates a new version of the resolver configuration file,
/run/resolvconf/resolv.conf,
as described below.
If the new version of the file differs
from the previously generated one
then the hook scripts found in
/etc/resolvconf/update-libc.d/
are executed.
OPTIONS
ENVIRONMENT VARIABLES
The following variables can be set in the configuration file
/etc/default/resolvconf.
If the file does not exist you will have to create it.
FILES
BUGS
Currently
resolvconf
does not check the sanity of the information provided to it.
AUTHOR
Written by Thomas Hood <jdthood [at] gmail.com>
with contributions by Nathan Stratton Treadway.
COPYRIGHT
Copyright © 2004-2013 Thomas Hood.
This is free software; see the source for copying conditions.
SEE ALSO
interface-order(5),
resolv.conf(5),
resolver(3).