| 1 |
README file for
|
| 2 |
resolvconf
|
| 3 |
|
| 4 |
Contents
|
| 5 |
~~~~~~~~
|
| 6 |
News
|
| 7 |
Introduction
|
| 8 |
Rationale
|
| 9 |
HOWTO
|
| 10 |
Order of entries in resolv.conf
|
| 11 |
Objectives
|
| 12 |
Technical overview
|
| 13 |
Usage information for developers
|
| 14 |
Usage information for administrators
|
| 15 |
FAQ
|
| 16 |
TODO
|
| 17 |
DONE
|
| 18 |
Credits
|
| 19 |
|
| 20 |
News
|
| 21 |
~~~~
|
| 22 |
* Last updated 18 June 2010 for version 1.46 -- Update status of TODO
|
| 23 |
items to reflect progress over past five years
|
| 24 |
|
| 25 |
Introduction
|
| 26 |
~~~~~~~~~~~~
|
| 27 |
Resolvconf is a framework for keeping track of the system's information
|
| 28 |
about currently available nameservers. It sets itself up as the
|
| 29 |
intermediary between programs that supply nameserver information and
|
| 30 |
applications that need nameserver information.
|
| 31 |
|
| 32 |
Rationale
|
| 33 |
~~~~~~~~~
|
| 34 |
/etc/resolv.conf was once a simple static configuration file where the
|
| 35 |
sysadmin placed a few directives that rarely needed to be changed. That
|
| 36 |
changed with the advent of mobile computing: a computer can now move
|
| 37 |
from one network to another quite often. Debian currently includes many
|
| 38 |
packages that alter resolv.conf more or less automatically. Some of
|
| 39 |
them are listed below, along with a short description of what they do
|
| 40 |
which I have tried to keep up to date. (Figures in parentheses show the
|
| 41 |
number of the package's popularity-contest votes as of 5 January 2005.)
|
| 42 |
|
| 43 |
pcmcia-cs (914)
|
| 44 |
Can overwrite resolv.conf with no backup unless (as of 3.2.5-1)
|
| 45 |
resolvconf is installed. By default, doesn't.
|
| 46 |
ppp (4533)
|
| 47 |
pppd optionally overwrites /etc/ppp/resolv.conf . By default, does.
|
| 48 |
pppconfig (3702)
|
| 49 |
Moves resolv.conf out of the way and puts it back when done.
|
| 50 |
pppoeconf (2938)
|
| 51 |
Prior to version 1.0, overwrites resolv.conf, attempting to merge
|
| 52 |
its stuff with the existing contents. Creates a backup in /etc/ but
|
| 53 |
doesn't restore it.
|
| 54 |
gnome-ppp (24)
|
| 55 |
Contains experimental code, currently commented out, that overwrites
|
| 56 |
resolv.conf.
|
| 57 |
gnome-system-tools (1349)
|
| 58 |
Allows the user to write directly to /etc/resolv.conf.
|
| 59 |
systemconfigurator (94)
|
| 60 |
Allows the user to write directly to /etc/resolv.conf.
|
| 61 |
webmin (781)
|
| 62 |
Prior to version 1.150-2, the Network Configuration|DNS Client page
|
| 63 |
can make changes to /etc/resolv.conf. As of 1.150-2 this page is
|
| 64 |
read-only when resolvconf is installed.
|
| 65 |
webmin-wvdial (8)
|
| 66 |
Copies /etc/ppp/resolv.conf over /etc/resolv.conf after PPP
|
| 67 |
connection established unless (as of version 1.160-3) the latter is
|
| 68 |
a symbolic link; restores original contents from backup file when
|
| 69 |
the connection is broken.
|
| 70 |
xisp (1 -- removed)
|
| 71 |
Adds lines to /etc/resolv.conf on PPP interface up and deletes those
|
| 72 |
lines on interface down.
|
| 73 |
totd (5)
|
| 74 |
Prior to 1.4-4, PPP hook scripts can do things to /etc/resolv.conf
|
| 75 |
but SFAICT are effectively no-ops if resolvconf is installed. Hard
|
| 76 |
to tell. Postinst does things to /etc/resolv.conf and also rewrites
|
| 77 |
dhclient_enter_hooks in a way incompatible with resolvconf. As of
|
| 78 |
1.4-4 totd plays nicely with resolvconf.
|
| 79 |
dhcp-client (4005)
|
| 80 |
Prior to version 2.0pl5-17, overwrites resolv.conf without making a
|
| 81 |
backup.
|
| 82 |
dhcp3-client (676)
|
| 83 |
Overwrites resolv.conf unless make_resolv_conf() is redefined.
|
| 84 |
Resolvconf redefines it.
|
| 85 |
dhcpcd (104)
|
| 86 |
Optionally overwrites resolv.conf . Default is not to do so. Prior
|
| 87 |
to version 1:1.3.22pl4-8, hook script overwrites
|
| 88 |
/etc/dhcpc/resolv.conf unless (as of 1:1.3.22pl4-7) resolvconf is
|
| 89 |
installed.
|
| 90 |
pump (734)
|
| 91 |
Prior to version 0.8.15, blindly overwrites resolv.conf unless nodns
|
| 92 |
option is used. No backup. As of version 0.8.15 pump calls
|
| 93 |
resolvconf if it is installed instead of overwriting
|
| 94 |
/etc/resolv.conf.
|
| 95 |
udhcpc (44)
|
| 96 |
Prior to version 0.9.8cvs20050124-2, blindly overwrites resolv.conf
|
| 97 |
without making a backup.
|
| 98 |
netenv (43)
|
| 99 |
Contains sample code that, if uncommented, would overwrite
|
| 100 |
/etc/resolv.conf without backing it up
|
| 101 |
switchconf (12)
|
| 102 |
Forcibly links selected resolv.conf file into place without making a
|
| 103 |
backup.
|
| 104 |
divine (9)
|
| 105 |
Symlinks in a resolv.conf for the selected network. Appears to
|
| 106 |
trash whatever was in resolv.conf when it starts.
|
| 107 |
intuitively (18)
|
| 108 |
If a resolv.conf file is included in /etc/intuitively/NETWORK,
|
| 109 |
blindly overwrites /etc/resolv.conf .
|
| 110 |
laptop-netconf (23)
|
| 111 |
Symlinks in a resolv.conf for the detected network. Seems to make a
|
| 112 |
backup of resolv.conf but doesn't restore it.
|
| 113 |
whereami (23)
|
| 114 |
Contains utility scripts that modify resolv.conf
|
| 115 |
laptop-net (42)
|
| 116 |
Overwrites resolv.conf unless (as of 2.20) resolvconf is installed.
|
| 117 |
|
| 118 |
Several other packages recommend to the user that scripts be written to
|
| 119 |
alter or replace resolv.conf.
|
| 120 |
|
| 121 |
These packages do not cooperate; they simply overwrite one another's
|
| 122 |
changes. Even those that back up and restore the file will corrupt it
|
| 123 |
if interfaces are brought up and down in other than a LIFO order. Few
|
| 124 |
of them support the use of a local DNS cache.
|
| 125 |
|
| 126 |
Resolvconf (555) has been written in order to provide a framework for
|
| 127 |
managing the resolv.conf file in an way that avoids the above problems.
|
| 128 |
|
| 129 |
HOWTO
|
| 130 |
~~~~~
|
| 131 |
Resolvconf works with most interface configurers in Debian
|
| 132 |
('(*)' below meaning "with some manual configuration"):
|
| 133 |
|
| 134 |
ppp
|
| 135 |
dhcp3-client, dhcp-client, dhcpcd, pump, udhcpc
|
| 136 |
ifupdown, laptop-net
|
| 137 |
|
| 138 |
DNS caches:
|
| 139 |
|
| 140 |
bind9(*), djbdns dnscache, dnsmasq, pdnsd, totd
|
| 141 |
|
| 142 |
DNS recursing nameservers:
|
| 143 |
|
| 144 |
bind9(*), pdns-recursor(*)
|
| 145 |
|
| 146 |
and with any program that uses a DNS client library that consults
|
| 147 |
/etc/resolv.conf to obtain its list of nameservers:
|
| 148 |
|
| 149 |
the GNU C Library resolver library
|
| 150 |
adns
|
| 151 |
the djbdns resolver library
|
| 152 |
FireDNS
|
| 153 |
|
| 154 |
Take the following steps to set things up. Unfortunately, it is not
|
| 155 |
always simply a matter of installing the resolvconf package --
|
| 156 |
especially if you have already tried to deal with the above problems
|
| 157 |
locally by customizing your configuration.
|
| 158 |
|
| 159 |
0. You may have already installed resolvconf at this point. OK.
|
| 160 |
1. Stop obsolete programs from writing to /etc/resolv.conf
|
| 161 |
* netenv
|
| 162 |
+ Purge or make sure that /sbin/netenv hasn't been configured such
|
| 163 |
that it overwrites /etc/resolv.conf
|
| 164 |
* switchconf
|
| 165 |
+ Purge or make sure that there are no resolv.conf files under the
|
| 166 |
/etc/switchconf/ directory
|
| 167 |
* xisp
|
| 168 |
+ Purge, or eliminate the parts of /etc/ppp/ip-up.d/0xisp-dns and
|
| 169 |
/etc/ppp/ip-down.d/0xisp-dns that overwrite /etc/resolv.conf .
|
| 170 |
* divine
|
| 171 |
+ Purge
|
| 172 |
* intuitively
|
| 173 |
+ Purge or make sure that there are no resolv.conf files under the
|
| 174 |
/etc/intuitively/ directory
|
| 175 |
* laptop-netconf
|
| 176 |
+ Purge or edit configuration files such as
|
| 177 |
/etc/laptop-netconf/<profile> so that these will not touch
|
| 178 |
/etc/resolv.conf
|
| 179 |
* whereami
|
| 180 |
Purge or make sure that you aren't using the "setresolver",
|
| 181 |
"bind-forwarders" or "setdnsmasq" utility scripts.
|
| 182 |
* etc.
|
| 183 |
Delete or disable local scripts of any kind that futz with
|
| 184 |
/etc/resolv.conf
|
| 185 |
2. Update packages to versions that are compatible with resolvconf
|
| 186 |
* dhcp3-client and dhcp3-common >= 3.0+3.0.1rc11-5
|
| 187 |
Earlier versions lack the hooks required to stop dhclient from
|
| 188 |
overwriting /etc/resolv.conf and to interface with resolvconf.
|
| 189 |
You may need to upgrade samba in order to upgrade dhcp3-*.
|
| 190 |
* dhcp-client >= 2.0pl5-18
|
| 191 |
Earlier versions overwrite the target of /etc/resolv.conf and
|
| 192 |
don't interface with resolvconf
|
| 193 |
* dhcpcd >= 1:1.3.22pl4-7
|
| 194 |
Earlier versions lack the hooks to interface with resolvconf
|
| 195 |
* pump >= 0.8.15-1
|
| 196 |
Earlier versions overwrite the target of /etc/resolv.conf and
|
| 197 |
don't interface with resolvconf
|
| 198 |
* udhcpc >= 0.9.8cvs20050124-3
|
| 199 |
Earlier versions overwrite the target of /etc/resolv.conf and
|
| 200 |
don't interface with resolvconf properly
|
| 201 |
* pcmcia-cs >= 3.2.5-1
|
| 202 |
Earlier versions overwrite /etc/resolv.conf if certain
|
| 203 |
configuration options are enabled in /etc/pcmcia/network.opts
|
| 204 |
* dnsmasq >= 1.18-2
|
| 205 |
Versions earlier than 1.13-2 lack the hooks to interface with
|
| 206 |
resolvconf.
|
| 207 |
Versions earlier than 1.18-2 fail when installed or upgraded
|
| 208 |
at the same time as resolvconf is first installed.
|
| 209 |
* pdnsd >= 1.1.10par-4
|
| 210 |
Versions earlier than 1.1.10par-1 lack the hooks to interface
|
| 211 |
with resolvconf.
|
| 212 |
Versions earlier than 1.1.10par-4 don't interface properly
|
| 213 |
with resolvconf.
|
| 214 |
* totd >= 1.4-4
|
| 215 |
Versions earlier than 1.4-4 had a postinst that wrote to
|
| 216 |
/etc/resolv.conf and that (via the totdconfig program)
|
| 217 |
altered /etc/dhclient-enter-hooks in a way incompatible with
|
| 218 |
resolvconf; these versions did not get their nameserver
|
| 219 |
information from resolvconf
|
| 220 |
* pppconfig >= 2.3.1
|
| 221 |
Some earlier versions contain PPP hook scripts
|
| 222 |
/etc/ppp/ip-up.d/0dns-up
|
| 223 |
/etc/ppp/ip-down.d/0dns-down
|
| 224 |
that futz with /etc/resolv.conf. Make sure that you tell dpkg to
|
| 225 |
install the scripts that ship with the latest version of the
|
| 226 |
package. Also make sure that they have execute permission if you
|
| 227 |
want to use them to incorporate per-provider resolver
|
| 228 |
configuration options into the resolver configuration file.
|
| 229 |
* pppoeconf >= 1.0
|
| 230 |
Earlier versions contain a PPP hook script
|
| 231 |
/etc/ppp/ip-up.d/000usepeerdns
|
| 232 |
that futzes with /etc/resolv.conf. After upgrading pppoeconf make
|
| 233 |
sure that this script is not present. N.B.: The ppp package's
|
| 234 |
/etc/ppp/ip-up.d/0000usepeerdns and
|
| 235 |
/etc/ppp/ip-down.d/0000usepeerdns (with four zeroes) are OK: they
|
| 236 |
disable themselves if resolvconf is installed.
|
| 237 |
* laptop-net >= 2.21-1
|
| 238 |
Earlier versions can't be prevented from overwriting
|
| 239 |
/etc/resolv.conf and don't interface with resolvconf.
|
| 240 |
* webmin-wvdial >= 1.160-3
|
| 241 |
Earlier versions overwrite /etc/resolv.conf even if it is a
|
| 242 |
symbolic link.
|
| 243 |
3. Configure packages not to overwrite /etc/resolv.conf and to work
|
| 244 |
properly with resolvconf
|
| 245 |
3.1 ppp
|
| 246 |
* Make sure that the usepeerdns option is used. With this option,
|
| 247 |
pppd will obtain nameserver addresses from the peer and these will
|
| 248 |
be added to resolvconf's database.
|
| 249 |
3.2 pump
|
| 250 |
* Make sure that neither the nodns nor the noresolvconf option is
|
| 251 |
used -- either in pump.conf or on the command line
|
| 252 |
3.3 dhcpcd
|
| 253 |
* Make sure that SET_DNS is not set anywhere in /etc/dhcpc/config .
|
| 254 |
(In recent versions of dhcpcd, on initial installation, SET_DNS
|
| 255 |
is not set.)
|
| 256 |
3.4 ifupdown
|
| 257 |
* Remove any "up" or "down" commands from /etc/network/interfaces
|
| 258 |
that futz with /etc/resolv.conf and remove any scripts from
|
| 259 |
/etc/network/if-*.d/ that futz with /etc/resolv.conf.
|
| 260 |
* For each inet static logical interface through which a nameserver is
|
| 261 |
accessible, add lines like the following to /etc/network/interfaces .
|
| 262 |
|
| 263 |
dns-nameservers 11.22.33.44 55.66.77.88
|
| 264 |
dns-search foo.org bar.com
|
| 265 |
|
| 266 |
Other recognized option words are 'dns-domain' and 'dns-sortlist'.
|
| 267 |
These option names correspond to the option names used in the
|
| 268 |
resolv.conf file with one exception: whereas one lists several
|
| 269 |
nameserver addresses in /etc/resolv.conf on several "nameserver"
|
| 270 |
lines, here one should list them all on a single "dns-nameservers"
|
| 271 |
line. See resolv.conf(5) for more information. The lines entered
|
| 272 |
in /etc/network/interfaces will be added to the resolver
|
| 273 |
configuration file (without the "dns-" prefix, of course) when a
|
| 274 |
physical interface is brought up as that logical interface.
|
| 275 |
Note that the resolver configuration is updated AFTER all the "up"
|
| 276 |
commands have been run; therefore "up" commands cannot make use of
|
| 277 |
nameservers listed on "dns-nameservers" lines in the same logical
|
| 278 |
interface stanza. Changing this will require modifying ifupdown
|
| 279 |
so that it talks to resolvconf; currently resolvconf hooks into
|
| 280 |
ifupdown using the script /etc/network/if-up.d/000resolvconf. Note
|
| 281 |
too that scripts in /etc/network/if-up.d/ CAN make use of the
|
| 282 |
added nameservers because those scripts run after 000resolvconf.
|
| 283 |
3.5 bind9
|
| 284 |
* Change the /etc/bind/named.conf file so that it includes
|
| 285 |
/var/run/bind/named.options instead of /etc/bind/named.conf.options.
|
| 286 |
The former will be generated from the latter, as needed, by
|
| 287 |
inserting or updating the "forwarders" statement inside the
|
| 288 |
"options" statement with a current list of forwarders.
|
| 289 |
3.6 bind
|
| 290 |
* Change the /etc/bind/named.conf file so that it includes
|
| 291 |
/var/run/bind/named.options instead of /etc/bind/named.conf.options.
|
| 292 |
The former will be generated from the latter, as needed, by
|
| 293 |
inserting or updating the "forwarders" statement inside the
|
| 294 |
"options" statement with a current list of forwarders.
|
| 295 |
* Change /etc/init.d/bind to:
|
| 296 |
+ At the bottom of start(), after the start-stop-daemon line, add:
|
| 297 |
if [ "$?" = 0 ] && [ -x /sbin/resolvconf ] ; then
|
| 298 |
echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.named
|
| 299 |
fi
|
| 300 |
+ At top of stop(), before the start-stop-daemon line, add:
|
| 301 |
if [ -x /sbin/resolvconf ] ; then
|
| 302 |
/sbin/resolvconf -d lo.named
|
| 303 |
fi
|
| 304 |
This tells resolvconf when named is available to resolve names.
|
| 305 |
4. Install the resolvconf package if you have not already done so.
|
| 306 |
If you have already done so then consider dpkg-reconfigure'ing it.
|
| 307 |
Agree to symlink /etc/resolv.conf to /etc/resolvconf/run/resolv.conf.
|
| 308 |
You can decline the offer to append the original static resolver
|
| 309 |
configuration file to the end of the dynamically generated resolver
|
| 310 |
configuration file because you have already modified
|
| 311 |
/etc/network/interfaces as directed above.
|
| 312 |
5. Ifdown and then ifup all interfaces; restart DNS caches.
|
| 313 |
6. Check /etc/resolv.conf to make sure that its contents make sense.
|
| 314 |
|
| 315 |
If /etc/resolv.conf is not symlinked to /etc/resolvconf/run/resolv.conf
|
| 316 |
then a warning message will be printed when /sbin/resolvconf is run.
|
| 317 |
If you want to keep resolvconf installed but for some reason do not want
|
| 318 |
/etc/resolv.conf to be symlinked to /etc/resolvconf/run/resolv.conf then
|
| 319 |
you can disable the warning message by setting REPORT_ABSENT_SYMLINK=no
|
| 320 |
in /etc/default/resolvconf.
|
| 321 |
|
| 322 |
Order of entries in resolv.conf
|
| 323 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 324 |
Some of the information in the resolver configuration file consists of
|
| 325 |
a set of entries whose order is significant. Specifically, the order of
|
| 326 |
nameserver lines
|
| 327 |
|
| 328 |
nameserver x1.x2.x3.x4
|
| 329 |
nameserver y1.y2.y3.y4
|
| 330 |
|
| 331 |
determines the order in which nameservers are consulted and the order of
|
| 332 |
items on the search line
|
| 333 |
|
| 334 |
search da1.da2.org db1.db2.com
|
| 335 |
|
| 336 |
determines the order in which domain names are tried.
|
| 337 |
|
| 338 |
Resolvconf orders these entries according to the names of the interfaces
|
| 339 |
to which they relate. (More truthfully, it orders them according to the
|
| 340 |
record names in which they are stored, but it is a convention that
|
| 341 |
records are named like the interfaces for which they are the records,
|
| 342 |
possibly with a some suffix.) The particular order is determined by the
|
| 343 |
/etc/resolvconf/interface-order file. See interface-order(5) for more
|
| 344 |
information.
|
| 345 |
|
| 346 |
If you use ifrename, nameif or udev in order to assign stable names to
|
| 347 |
your network interfaces, I recommend that you employ names that begin
|
| 348 |
with the traditional pattern but differ from those names that the kernel
|
| 349 |
uses as defaults. E.g., the kernel names Ethernet interfaces 'eth0',
|
| 350 |
'eth1', and so on, so you might rename your Ethernet interfaces to
|
| 351 |
"eth_3com", "eth_cisco", etc.. Similarly you might rename your Wi-Fi
|
| 352 |
interfaces "wlan_airo" and "wlan_atmel". If you follow this advice then
|
| 353 |
you won't have to modify the default interface-order file.
|
| 354 |
|
| 355 |
Using a static file to order the entries is obviously not very flexible;
|
| 356 |
however, it is adequate in most usage situations. Situations for which
|
| 357 |
it is not adequate are generally situations in which it is better to use
|
| 358 |
a local caching nameserver that can do things like monitoring and load
|
| 359 |
balancing.
|
| 360 |
|
| 361 |
Objectives
|
| 362 |
~~~~~~~~~~
|
| 363 |
I hope that resolvconf meets the following objectives
|
| 364 |
* Be opaque
|
| 365 |
Resolvconf must be as opaque as possible. It must have a stable
|
| 366 |
interface and mustn't require that maintainers know about its
|
| 367 |
internals.
|
| 368 |
* Be order-independent
|
| 369 |
Interfaces going up and down in arbitrary order must be handled
|
| 370 |
properly.
|
| 371 |
* Be locally configurable
|
| 372 |
Administrator choices must be respected.
|
| 373 |
* Support DNS caches
|
| 374 |
Local DNS cache programs must be able to arrange for nameserver
|
| 375 |
addresses supplied by interfaces to be passed to them for use as
|
| 376 |
forwarders. The libc resolver should use any local DNS caches that
|
| 377 |
are available.
|
| 378 |
* Be compatible with a read-only root filesystem
|
| 379 |
Variable files must be easily relocated out of /etc/.
|
| 380 |
* Be portable
|
| 381 |
* Be simple
|
| 382 |
|
| 383 |
Technical overview
|
| 384 |
~~~~~~~~~~~~~~~~~~
|
| 385 |
* The /etc/resolvconf/ directory contains:
|
| 386 |
+ resolv.conf.d/
|
| 387 |
Files related to the libc resolv.conf file
|
| 388 |
- resolv.conf.d/head
|
| 389 |
The head of the dynamically generated resolv.conf
|
| 390 |
- resolv.conf.d/tail
|
| 391 |
The tail of the dynamically generated resolv.conf
|
| 392 |
- resolv.conf.d/base
|
| 393 |
Information always included in the resolv.conf file. Dynamic
|
| 394 |
information gets merged with this information. E.g., if base
|
| 395 |
contains 'search a.b.c' and another record is added that contains
|
| 396 |
'search x.y.z' then the resulting file will have
|
| 397 |
'search a.b.c x.y.z'.
|
| 398 |
+ run/
|
| 399 |
Directory where run time files are stored. This can be replaced by
|
| 400 |
a symlink to a directory on another filesystem if the admin so
|
| 401 |
desires -- e.g., to /lib/init/rw/resolvconf/ .
|
| 402 |
+ update.d/
|
| 403 |
Scripts to run when nameserver information is updated
|
| 404 |
+ update-libc.d/
|
| 405 |
Scripts to run when the resolv.conf file changes
|
| 406 |
* Symlink /etc/resolv.conf -> /etc/resolvconf/run/resolv.conf
|
| 407 |
* Configurers of interfaces call /sbin/resolvconf to provide
|
| 408 |
resolv.conf-like information after the interface is brought up. They
|
| 409 |
call it again to delete the information when the interface is brought
|
| 410 |
down. /sbin/resolvconf then does the equivalent of
|
| 411 |
"/etc/init.d/resolvconf reload".
|
| 412 |
* "/etc/init.d/resolvconf reload" calls scripts in
|
| 413 |
/etc/resolvconf/update.d/ which update DNS cache configuration file
|
| 414 |
fragments, reload daemons and regenerate /etc/resolv.conf. If
|
| 415 |
the latter has changed then nscd is restarted and scripts in
|
| 416 |
/etc/resolvconf/update-libc.d/ are run.
|
| 417 |
|
| 418 |
Usage information for developers
|
| 419 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 420 |
Interface configurers send resolver information to resolvconf in the
|
| 421 |
format of the familiar /etc/resolv.conf file. Thus, for example, a
|
| 422 |
program that has configured interface $IFACE would do the following
|
| 423 |
after generating a resolv.conf file named 'new-resolv.conf'.
|
| 424 |
|
| 425 |
resolvconf -a $IFACE < new-resolv.conf
|
| 426 |
|
| 427 |
This command updates the resolver information related to interface
|
| 428 |
$IFACE. Any information previously sent for this interface is
|
| 429 |
overwritten. On bringing the interface down, the configurer would do
|
| 430 |
the following.
|
| 431 |
|
| 432 |
resolvconf -d $IFACE
|
| 433 |
|
| 434 |
For another example, the proxy script for pppd forwards to
|
| 435 |
resolvconf the resolver information that is made available to
|
| 436 |
ip-up.d/ and ip-down.d/ scripts in environment variables DNS1, etc.
|
| 437 |
|
| 438 |
echo "nameserver $DNS1" | resolvconf -a $IFACE
|
| 439 |
|
| 440 |
For additional examples, look at the hook scripts for dhcp3-client
|
| 441 |
and ifupdown. Support for other configurers including dhcpcd, pump,
|
| 442 |
dhcp-client, udhcpc and laptop-net has been added to those packages.
|
| 443 |
|
| 444 |
In general, any package that currently overwrites /etc/resolv.conf
|
| 445 |
can be adapted to work with resolvconf while preserving backward
|
| 446 |
compatibility by introducing a code fragment like the following.
|
| 447 |
|
| 448 |
if [ -x /sbin/resolvconf ] ; then
|
| 449 |
if [ "$DIRECTION" = "up" ] ; then
|
| 450 |
echo -n "$RESOLVINFO" | /sbin/resolvconf -a "$IFACE"
|
| 451 |
else
|
| 452 |
/sbin/resolvconf -d "$IFACE"
|
| 453 |
fi
|
| 454 |
else
|
| 455 |
(... existing resolv.conf cleverness ...)
|
| 456 |
fi
|
| 457 |
|
| 458 |
/sbin/resolvconf stores the information sent to it and then runs the
|
| 459 |
scripts in /etc/resolvconf/update.d/ . One of the latter generates
|
| 460 |
the libc resolver configuration file. Another generates the options
|
| 461 |
portion of the BIND named configuration file, containing a
|
| 462 |
"forwarders" statement listing available nameserver forwarders.
|
| 463 |
(This allows named effectively to be used as a DNS cache on a system
|
| 464 |
whose network environment varies, e.g., on a laptop.) Others
|
| 465 |
generate lists of forwarders for dnsmasq or pdnsd to use. Any other
|
| 466 |
program that needs to take action when resolver information is
|
| 467 |
updated could likewise employ a script in /etc/resolvconf/update.d/ .
|
| 468 |
|
| 469 |
Usage information for administrators
|
| 470 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 471 |
The generation of the resolv.conf file can be controlled by editing
|
| 472 |
/etc/resolvconf/update.d/libc . Different strategies can be
|
| 473 |
followed. E.g., one possible strategy would be to put only the most
|
| 474 |
recently provided information into resolv.conf . The current default
|
| 475 |
strategy is to put *all* available resolver information into
|
| 476 |
resolv.conf, ordered by interface type as follows: lo, eth*, ppp* .
|
| 477 |
|
| 478 |
The admin can of course disable resolv.conf automagic by deleting the
|
| 479 |
/etc/resolv.conf symlink and putting a static file at that location.
|
| 480 |
|
| 481 |
Once you have installed resolvconf properly you don't normally need
|
| 482 |
to run /sbin/resolvconf from the command line. However, I once
|
| 483 |
encountered a situation in which I did that. Perhaps it is a useful
|
| 484 |
illustration. My ISP's nameserver went down and thus my caching
|
| 485 |
nameserver could not resolve names. I knew of another host belonging
|
| 486 |
to by ISP that I could use so I simply did:
|
| 487 |
# echo "nameserver ww.xx.yy.zz" | resolvconf -a dummy
|
| 488 |
This added the necessary nameserver line to /etc/resolv.conf and to
|
| 489 |
dnsmasq's nameserver list. When my ISP's regular nameserver was fixed
|
| 490 |
I did:
|
| 491 |
# resolvconf -d dummy
|
| 492 |
to restore the original situation.
|
| 493 |
|
| 494 |
FAQ
|
| 495 |
~~~
|
| 496 |
Q. Why call it 'resolvconf' instead of 'update-resolver' or so?
|
| 497 |
A. Debian's update-* commands are mostly maintainer programs that update
|
| 498 |
static configuration files in /etc/. Mostly they run at package
|
| 499 |
install time. Resolvconf, in contrast, is a run-time configurer.
|
| 500 |
Q. Why use 'dns-nameservers' instead of 'dns-nameserver' as the option
|
| 501 |
name in /etc/network/interfaces?
|
| 502 |
A. Because 'dns-nameservers' can take several address arguments whereas
|
| 503 |
the 'nameserver' line in /etc/resolv.conf can take only a single
|
| 504 |
argument, and because there can be only one instance of any given
|
| 505 |
option in a logical interface definition.
|
| 506 |
|
| 507 |
TODO
|
| 508 |
~~~~
|
| 509 |
* resolvconf
|
| 510 |
See the Wishlist items at http://bugs.debian.org/resolvconf
|
| 511 |
* gnome-ppp
|
| 512 |
# 258064: Writes to /etc/resolv.conf
|
| 513 |
- NO ACTION for several years
|
| 514 |
* gnome-system-tools
|
| 515 |
# 258553: Incompatible with resolvconf
|
| 516 |
- OKed by maintainer but NO ACTION has been taken for several years
|
| 517 |
* systemconfigurator
|
| 518 |
# 272475: Please support resolvconf
|
| 519 |
- NO REPLY for several years
|
| 520 |
* ppp
|
| 521 |
# 208095: Please suggest resolvconf
|
| 522 |
- WONTFIX
|
| 523 |
* pppconfig
|
| 524 |
# 266819: Please suggest resolvconf
|
| 525 |
- NO REPLY for several years
|
| 526 |
* ifupdown
|
| 527 |
+ Handle dns-* commands natively so that the resolver is configured
|
| 528 |
before "up" commands are run
|
| 529 |
* nscd
|
| 530 |
# 266817: Please suggest resolvconf
|
| 531 |
- WONTFIX
|
| 532 |
* bind
|
| 533 |
+ Drop support for this obsolete version of BIND
|
| 534 |
* bind9
|
| 535 |
+ Adopt /etc/resolvconf/update.d/bind
|
| 536 |
- The right thing to do, in theory. Low priority.
|
| 537 |
+ Automatically use /var/run/bind/named.options if present instead of
|
| 538 |
/etc/bind/named.conf.options
|
| 539 |
* dnscache-run (from djbdns)
|
| 540 |
# 582755: Add resolvconf support
|
| 541 |
- SUBMITTED
|
| 542 |
* maradns
|
| 543 |
+ Add resolvconf support
|
| 544 |
- Needs more investigation
|
| 545 |
- Its initscript should probably do
|
| 546 |
echo "nameserver 127.0.0.1" | resolvconf -a lo.maradns
|
| 547 |
as dnsmasq and pdnsd do.
|
| 548 |
- Could it have an update script that sets the "upstream_servers"
|
| 549 |
variable?
|
| 550 |
* libadns1
|
| 551 |
+ It consults resolv.conf so it should already be supported.
|
| 552 |
However, someone should test it.
|
| 553 |
* libares0
|
| 554 |
+ It consults resolv.conf so it should already be supported.
|
| 555 |
However, someone should test it.
|
| 556 |
* libdjbdns1
|
| 557 |
+ It consults resolv.conf so it should already be supported.
|
| 558 |
However, someone should test it.
|
| 559 |
+ Someone should investigate whether it could be supported better.
|
| 560 |
Perhaps /etc/dnsrewrite should be dynamically updated?
|
| 561 |
* libfiredns0.9
|
| 562 |
+ It consults resolv.conf so it should already be supported.
|
| 563 |
However, someone should test it.
|
| 564 |
+ Someone should investigate whether it could be supported better.
|
| 565 |
Perhaps /etc/firedns.conf should be dynamically updated?
|
| 566 |
* Net::DNS
|
| 567 |
+ It consults resolv.conf so it should already be supported.
|
| 568 |
However, someone should test it.
|
| 569 |
+ Someone should investigate whether it could be supported better.
|
| 570 |
* Users of resolver libraries
|
| 571 |
For any package that contains a program that uses resolver(3) or a
|
| 572 |
compatible library, add a /etc/resolvconf/update-libc.d/ script to
|
| 573 |
notify running instances of the program that the resolver
|
| 574 |
configuration file has changed.
|
| 575 |
|
| 576 |
DONE
|
| 577 |
~~~~
|
| 578 |
* resolvconf
|
| 579 |
+ Created and added to dialup and broadband tasks
|
| 580 |
* ppp
|
| 581 |
+ Use resolvconf via /etc/ppp/ip-(up|down).d/
|
| 582 |
- DONE in resolvconf package
|
| 583 |
* pppconfig
|
| 584 |
# 242092: Disable pppconfig's futzing with /etc/resolv.conf
|
| 585 |
- DONE in 2.3.1
|
| 586 |
* pppoeconf
|
| 587 |
# 212756: Eliminate /etc/ppp/ip-up.d/000usepeerdns
|
| 588 |
- DONE in 1.0
|
| 589 |
* dhcp3-client
|
| 590 |
+ Use resolvconf via /etc/dhcp3/dhclient-enter-hooks
|
| 591 |
- DONE in resolvconf package
|
| 592 |
# 171798: dhclient-script should source hook scripts, not run-parts them
|
| 593 |
- DONE in 3.0+3.0.1rc11-5
|
| 594 |
* dhcp-client
|
| 595 |
# 248399: Needs resolvconf support
|
| 596 |
- DONE in 2.0pl5-18
|
| 597 |
* dhcpcd
|
| 598 |
+ Support resolvconf without requiring local changes
|
| 599 |
- DONE in 1:1.3.22pl4-7
|
| 600 |
* pump
|
| 601 |
# 194204: Please add proper resolvconf support
|
| 602 |
- DONE in 0.8.15-1
|
| 603 |
* udhcpc
|
| 604 |
# 302019: Please use resolvconf
|
| 605 |
- DONE in 0.9.8cvs20050124-3
|
| 606 |
* pcmcia-cs
|
| 607 |
# 212823: pcmcia-cs: please add support for the resolvconf package
|
| 608 |
- DONE in 3.2.5-1
|
| 609 |
* laptop-net
|
| 610 |
+ Use resolvconf instead of overwriting /etc/resolv.conf .
|
| 611 |
- DONE in 2.21-1
|
| 612 |
* ifupdown
|
| 613 |
+ Use resolvconf via /etc/network/if-(up|down).d/
|
| 614 |
- DONE in resolvconf package
|
| 615 |
* debian-installer
|
| 616 |
# 255187: Please add resolvconf support
|
| 617 |
- PENDING
|
| 618 |
* nscd
|
| 619 |
# 252251: Please add resolvconf support
|
| 620 |
- DONE in resolvconf 1.15
|
| 621 |
* bind9
|
| 622 |
+ Create script /etc/resolvconf/update.d/bind to:
|
| 623 |
. Convert /etc/bind/named.options.sed into /var/run/bind/named.options
|
| 624 |
(which is to be included in /etc/bind/named.conf)
|
| 625 |
. Then run "/etc/init.d/bind9 reload" or "/etc/init.d/bind reload"
|
| 626 |
- DONE in resolvconf package
|
| 627 |
# 199255: Please support resolvconf
|
| 628 |
- DONE in 1:9.2.3-1
|
| 629 |
# 252232: Please use 'lo.named' as resolvconf record name
|
| 630 |
- DONE in 1:9.3.2-2
|
| 631 |
# 252285: Please Suggest resolvconf
|
| 632 |
- DONE in 1:9.4.2-2
|
| 633 |
* dnsmasq
|
| 634 |
+ Create script /etc/resolvconf/update.d/dnsmasq to
|
| 635 |
generate /var/run/dnsmasq/resolv.conf
|
| 636 |
- DONE in resolvconf package
|
| 637 |
+ Support resolvconf without requiring local changes
|
| 638 |
- DONE in 1.13-2
|
| 639 |
+ Include /etc/resolvconf/update.d/dnsmasq
|
| 640 |
- DONE in 1.13-3
|
| 641 |
* pdns-recursor
|
| 642 |
# 308677: /etc/init.d/pdns-recursor: Please add resolvconf calls
|
| 643 |
- DONE in 2.9.18-4
|
| 644 |
* pdns-server
|
| 645 |
# 304528: Please add resolvconf update script in order to automate
|
| 646 |
the creation of the recursors list
|
| 647 |
- DONE in 2.9.18-4
|
| 648 |
* pdnsd
|
| 649 |
# 247946: Fix resolvconf support
|
| 650 |
- DONE in pdnsd 1.1.10par-4
|
| 651 |
# 254768: Should conflict with resolvconf << 1.15
|
| 652 |
- NO REPLY
|
| 653 |
* totd
|
| 654 |
+ Use resolvconf to update resolv.conf and to get updated
|
| 655 |
nameserver list
|
| 656 |
* fetchmail
|
| 657 |
+ Use resolvconf to trigger restart on change of nameserver info
|
| 658 |
- DONE in 6.2.5-4
|
| 659 |
* postfix
|
| 660 |
# 212552: Please reload on change of /etc/resolv.conf -- resolvconf hook
|
| 661 |
- DONE in 2.0.16-4
|
| 662 |
* squid
|
| 663 |
# 200572: Please use resolvconf resolver-update notification
|
| 664 |
- DONE in 2.5.3-7
|
| 665 |
* webmin-core
|
| 666 |
# 223483: Please play nicely with resolvconf
|
| 667 |
- DONE in 1.150-2
|
| 668 |
* webmin-wvdial
|
| 669 |
# 288481: Deletes symlink at /etc/resolv.conf
|
| 670 |
- DONE in 1.160-3
|
| 671 |
|
| 672 |
Credits
|
| 673 |
~~~~~~~
|
| 674 |
The basic idea for resolvconf was expressed by Emile van Bergen on
|
| 675 |
debian-devel. I claim any braindamage in the implementation as my own.
|
| 676 |
|
| 677 |
I thank all the maintainers who have helped with this effort by adding
|
| 678 |
resolvconf support to their packages.
|
| 679 |
|
| 680 |
Werner Heuser, Joe Nahmias and Andreas Barth have been helpful sponsors.
|
| 681 |
|
| 682 |
This document was written by Thomas Hood <jdthood_AT_yahoo.co.uk> using
|
| 683 |
some material written by John Hasler.
|
| 684 |
|
| 685 |
This document is part of resolvconf.
|