Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-28 Thread Manoj Srivastava
On Fri, 26 Sep 2003 21:37:21 +0200, Thomas Hood [EMAIL PROTECTED] said: 

 On Fri, 2003-09-26 at 20:25, Manoj Srivastava wrote:
 I have a laptop that sometimes is on fixed ip wireless
 networks. Since dhcp is not involved, there is nothing that updates
 resolvconf, which could be pointing to an inaccurate set of
 servers.

 If you bring the interface up with ifup then the solution is to put
 the nameserver address on a dns-nameservers line in the interface
 definition stanza.  E.g.,

I use that for my non-pcmcia interface.

 You must be referring to /etc/pcmcia/network.opts here.  Hmm, yes.
 If you are using the /etc/pcmcia/ stuff to configure PCMCIA network
 interfaces then this is a sensible thing to do.

Well, I've been using pcmcia way before there was hotplug, but
 I'm willing to learn.


 My own preference is to disable everything in
 /etc/pcmcia/network.opts and set things up so that hotplug does ifup
 and ifup configures the interface in the standard way.  Then I can
 use dns-nameservers lines for PCMCIA network interfaces too.

I would be interested in knowing how you set it up  equivalent
 to cardctl scheme allows me to set up pcmcia networks. Please mail e
 offlist if you wish.

manoj
-- 
In a great romance, each person basically plays a part that the other
really likes. Elizabeth Ashley
Manoj Srivastava   [EMAIL PROTECTED]  http://www.debian.org/%7Esrivasta/
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-28 Thread Neil Roeth
On Sep 28, Manoj Srivastava ([EMAIL PROTECTED]) wrote:
  On Fri, 26 Sep 2003 21:37:21 +0200, Thomas Hood [EMAIL PROTECTED] said: 
  
   On Fri, 2003-09-26 at 20:25, Manoj Srivastava wrote:
   I have a laptop that sometimes is on fixed ip wireless
   networks. Since dhcp is not involved, there is nothing that updates
   resolvconf, which could be pointing to an inaccurate set of
   servers.
  
   If you bring the interface up with ifup then the solution is to put
   the nameserver address on a dns-nameservers line in the interface
   definition stanza.  E.g.,
  
   I use that for my non-pcmcia interface.
  
   You must be referring to /etc/pcmcia/network.opts here.  Hmm, yes.
   If you are using the /etc/pcmcia/ stuff to configure PCMCIA network
   interfaces then this is a sensible thing to do.
  
   Well, I've been using pcmcia way before there was hotplug, but
   I'm willing to learn.
  
  
   My own preference is to disable everything in
   /etc/pcmcia/network.opts and set things up so that hotplug does ifup
   and ifup configures the interface in the standard way.  Then I can
   use dns-nameservers lines for PCMCIA network interfaces too.
  
   I would be interested in knowing how you set it up  equivalent
   to cardctl scheme allows me to set up pcmcia networks. Please mail e
   offlist if you wish.

I switched from using cardctl to hotplug earlier this year.  I didn't care to
use any of the packages that do automatic detection of the network, so I set
up a system just like cardctl scheme that allows me to choose which scheme to
use manually.  I no longer have pcmcia-cs installed at all.  I just execute
hpscheme default or hpscheme bs9 and then plug the card in.  It works from
there (don't expect any beeps, though).

I put this in /etc/network/interfaces:


mapping hotplug
script /usr/local/bin/map-scheme

iface default inet static
address ppp.ppp.ppp.ppp
netmask 255.255.255.0
gateway qqq.qqq.qqq.qqq

iface bs9 inet static
address nnn.nnn.nnn.nnn
netmask 255.255.255.128
gateway mmm.mmm.mmm.mmm

iface dhcp inet dhcp


The mapping stanza is what figures out which interface to associate with
eth0, i.e., default, bs9, or dhcp.  Here is the script
/usr/local/bin/map-scheme:


#!/bin/bash

# Used with /etc/network/interfaces mapping function, which passes the
# interface name as the first argument.

/usr/local/bin/hpscheme get


Here is the script /usr/local/bin/hpscheme:


#!/bin/bash -e

# Set or display a scheme, used by my hotplug setup to choose network settings
# for PCMCIA card.  Similar to what 'cardctl scheme' did in old pcmcia-cs pkg.

DIR=/var/lib/hpscheme
FL=${DIR}/scheme
[ -d ${DIR} ] || mkdir -p ${DIR}
[ -f ${FL} ] || echo default${FL}

USAGE=USAGE: $(basename $0) {get|put scheme}

if [ $# -lt 1 ]; then
echo $USAGE
exit 1
elif [ $1 = get ]; then
cat ${FL}
elif [ $1 = put ]; then
echo Current scheme is '$(cat ${FL})'; setting to '$2'  echo $2${FL}
else
echo $USAGE
exit 1
fi


You can also add dns-search and dns-nameservers lines to the stanzas in
/etc/network/interfaces if you are using resolvconf, or add scripts to
if-up.d/ and if-down.d/ to muck about with resolv.conf, or whatever you like.
I've done both, though I just switched to resolvconf (thanks, Thomas!).

In addition, of course, you need to set up hotplug, i.e., compile your kernel
with the appropriate options and drivers, etc.

-- 
Neil Roeth




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-28 Thread Thomas Hood
Manoj wrote:
  I would be interested in knowing how you set it up  equivalent
  to cardctl scheme allows me to set up pcmcia networks.

cardmgr's system of configuring things dependently upon
scheme,socket,instance,hwaddr is quite powerful but it is
possible to configure interfaces dependently on these variables
using ifupdown too (... though not so conveniently).  See below.

On Sun, 2003-09-28 at 21:03, Neil Roeth wrote:
 I switched from using cardctl to hotplug earlier this year.  I didn't care to
 use any of the packages that do automatic detection of the network, so I set
 up a system just like cardctl scheme that allows me to choose which scheme to
 use manually.  I no longer have pcmcia-cs installed at all.  I just execute
 hpscheme default or hpscheme bs9 and then plug the card in.  It works from
 there (don't expect any beeps, though).

The simplest way to activate hotplug control of network interfaces
is to add this stanza to /etc/network/interfaces:

mapping hotplug
script echo

This makes ifup eth0=hotplug equivalent to ifup eth0.  Once this
is added you can add mapping stanzas that cause a logical interface
to be chosen according to the network environment (as guessnet and
ifscout[1] do), according to a scheme (as your script and ifscout do),
according to hwaddr (as /usr/share/doc/ifupdown/examples/get-mac-address.sh
does), and so on.

mapping eth0
script guessnet
map foo
map bar

iface foo inet static
...

iface bar inet dhcp

[1] http://panopticon.csustan.edu/thood/ifupdown-roam.html
--
Thomas





Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-28 Thread Manoj Srivastava
On Sun, 28 Sep 2003 21:49:28 +0200, Thomas Hood [EMAIL PROTECTED] said: 

 Manoj wrote:
  I would be interested in knowing how you set it up equivalent to
  cardctl scheme allows me to set up pcmcia networks.

 cardmgr's system of configuring things dependently upon
 scheme,socket,instance,hwaddr is quite powerful but it is possible
 to configure interfaces dependently on these variables using
 ifupdown too (... though not so conveniently).  See below.

One can also modify  /etc/pcmcia/network; line 109:

  cat $RESOLV  $RESOLV.N; mv $RESOLV.N $RESOLV
  cat $RESOLV  $RESOLV.N; resolvconf -a $DEVICE  $RESOLV.N

Anyway, I think I am goinf to use start_fn and stop_fn in
 /etc/pcmcia/network.opts instead of using either hotplug or modifying
 /etc/pcmcia/network;  I am already comfortable with my network.opts,
 and it is all working together very nicely now.

Thanks for resolvconf.

manoj
-- 
Wow, I'm being shot at from both sides.  That means I *must* be right.
:-) Larry Wall in [EMAIL PROTECTED]
Manoj Srivastava   [EMAIL PROTECTED]  http://www.debian.org/%7Esrivasta/
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-27 Thread Manoj Srivastava
Hi,

I have a laptop that sometimes is on fixed ip wireless
 networks. Since dhcp is not involved, there is nothing that updates
 resolvconf, which could be pointing to an inaccurate set of servers.

The solution, in my case, was to  add the following star and
 stop functions to the relevant stanza's (edit for the  static dns
 servers) 

  # Extra stuff to do after setting up the interface
  start_fn () {
[ -x /sbin/resolvconf ]   \
   echo nameserver 127.0.0.1| /sbin/resolvconf -a $DEVICE;
[ -x /sbin/resolvconf ]   \
   echo nameserver 192.168.1.10 | /sbin/resolvconf -a $DEVICE;
[ -x /sbin/resolvconf ]   \
   echo nameserver 198.6.1.4| /sbin/resolvconf -a $DEVICE;
  }
  # Extra stuff to do before shutting down the interface
  stop_fn () { [ -x /sbin/resolvconf ]   /sbin/resolvconf -d $DEVICE; }

manoj
-- 
What's love but a second-hand emotion? Tina Turner
Manoj Srivastava   [EMAIL PROTECTED]  http://www.debian.org/%7Esrivasta/
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-26 Thread Thomas Hood
On Fri, 2003-09-26 at 20:25, Manoj Srivastava wrote:
   I have a laptop that sometimes is on fixed ip wireless
  networks. Since dhcp is not involved, there is nothing that updates
  resolvconf, which could be pointing to an inaccurate set of servers.

If you bring the interface up with ifup then the solution is
to put the nameserver address on a dns-nameservers line in
the interface definition stanza.  E.g.,

iface eth0-home inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
dns-nameservers 192.168.1.1

When this interface is ifupped, 192.168.1.1 will be added to the
list of nameservers in /etc/resolv.conf (and to the nameserver 
list for dnsmasq if you are using dnsmasq, and to the forwarder
list if you are using bind9).

   The solution, in my case, was to add the following start and
  stop functions to the relevant stanza's (edit for the  static dns
  servers) 
 
   # Extra stuff to do after setting up the interface
   start_fn () {
 [ -x /sbin/resolvconf ]   \
echo nameserver 127.0.0.1| /sbin/resolvconf -a $DEVICE;
 [ -x /sbin/resolvconf ]   \
echo nameserver 192.168.1.10 | /sbin/resolvconf -a $DEVICE;
 [ -x /sbin/resolvconf ]   \
echo nameserver 198.6.1.4| /sbin/resolvconf -a $DEVICE;
   }
   # Extra stuff to do before shutting down the interface
   stop_fn () { [ -x /sbin/resolvconf ]   /sbin/resolvconf -d $DEVICE; }

You must be referring to /etc/pcmcia/network.opts here.  Hmm, yes.
If you are using the /etc/pcmcia/ stuff to configure PCMCIA network
interfaces then this is a sensible thing to do.

My own preference is to disable everything in /etc/pcmcia/network.opts
and set things up so that hotplug does ifup and ifup configures the
interface in the standard way.  Then I can use dns-nameservers lines
for PCMCIA network interfaces too.

-- 
Thomas Hood [EMAIL PROTECTED]




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-25 Thread Jerry Haltom
Are there plans to run up commands in interfaces after
dns-nameservers? Some of my up commands, and probably others, consist of
setting up static routes to other boxes. It is nice to be able to
specify these other boxes by name, and have it resolved using the name
servers set up by the resolvconf routine.

Also, this may seem a LITTLE bit silly, but can dns-domainnames be
provided with a name, which is then resolved into an IP and added to
resolvconf? This may seem a little pointless at first glance, but I (and
maybe others) run our own personal DNS servers at my house (on a dynamic
address), that I would like added into the resolv sequence, as a
secondary resolver, after the IPs my DHCP server gives me. It's amazing
what some people do to run a semi-functional network behind Comcast
cable! Yes, this obviously won't work for most of the names entered with
dns-nameservers, but not adding if not successfully resolved is a
perfectly acceptable fallback in this case. It doesn't take a whole lot
of time, and might be useful for somebody.

Awesome package. It has caused me to delete all of my dhclient-exit-hook
edits.

On Wed, 2003-09-24 at 22:27, Thomas Hood wrote:
 The resolvconf package provides a framework for dynamic updating
 of /etc/resolv.conf and other nameserver lists.  (See the long
 description at packages.debian.org/resolvconf .)
 
 The resolvconf package is now at version 0.44 in unstable.
 
 If you are interested in the package and haven't tested it in a while
 then now is a good time to test it again.  In order to test the
 installation procedure please purge any old version of resolvconf
 first.  Please report any bugs via the BTS.
 
 If no significant bugs are reported and if support is added to
 bind and bind9 (#199255) in time then I'll consider letting
 resolvconf migrate into sarge by closing #209265 with a 1.0
 release.
 
 -- 
 Thomas Hood [EMAIL PROTECTED]




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-09-25 Thread Thomas Hood
On Thu, 2003-09-25 at 07:29, Jerry Haltom wrote:
 Are there plans to run up commands in interfaces after
 dns-nameservers?

That would be desirable.  It would require a change to the
ifupdown package.

 Also, this may seem a LITTLE bit silly, but can dns-domainnames be
 provided with a name, which is then resolved into an IP and added to
 resolvconf?

That idea seems a bit esoteric.  You could set this up manually
by putting a script in /etc/network/if-up.d/ which does something
like this (untested):

  #!/bin/sh
  [ $DNS_DOMAINNAMES ] || exit 0
  X=$DNS_DOMAINNAMES
  N=$(host $X | grep -v 'not found' | sed 's/.*has address //')
  [ $N ]  echo nameserver $N | resolvconf -a 000${IFACE}-extra

The script should be named something later than 'resolvconf',
for obvious reasons.  Its if-down.d companion would be something
like:

  #!/bin/sh
  [ $DNS_DOMAINNAMES ] || exit 0
  resolvconf -d 000${IFACE}-extra

-- 
Thomas Hood [EMAIL PROTECTED]




Resolvconf -- a package to manage /etc/resolv.conf

2003-09-24 Thread Thomas Hood
The resolvconf package provides a framework for dynamic updating
of /etc/resolv.conf and other nameserver lists.  (See the long
description at packages.debian.org/resolvconf .)

The resolvconf package is now at version 0.44 in unstable.

If you are interested in the package and haven't tested it in a while
then now is a good time to test it again.  In order to test the
installation procedure please purge any old version of resolvconf
first.  Please report any bugs via the BTS.

If no significant bugs are reported and if support is added to
bind and bind9 (#199255) in time then I'll consider letting
resolvconf migrate into sarge by closing #209265 with a 1.0
release.

-- 
Thomas Hood [EMAIL PROTECTED]




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-07 Thread Goswin Brederlow
Thomas Hood [EMAIL PROTECTED] writes:

 On Sun, 2003-07-06 at 01:00, Goswin Brederlow wrote:
  You should think of a mechanism for daemons to get notified about
  changes in resolv.conf.
 
 There is already such a mechanism.  See below.
 
  Like providing a function to register a script
  and a list of arguments (like the PID of the program to
  notify). Whenever the resolv.conf changes all currently registered
  scripts would be called with their respective arguments.
  
  The simplest form would be:
  
  resolv.conf-register /etc/init.d/squid reload
  
  That would make squid to reload its config each time a nameserver is
  added or removed.
 
 Currently, scripts in /etc/resolvconf/update.d/ get run when
 resolver information changes.  So, would it suffice to create
 /etc/resolvconf/update.d/squid containing the following?
 #!/bin/sh
 /etc/init.d/squid reload
 
 --
 Thomas Hood

Great.

MfG
Goswin




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
On Sat, 2003-07-05 at 22:40, Simon Hürlimann wrote:
 I'd prefer update-resolv like
  update-alternatives update-initrd
  update-catalog  update-ispell-dictionary
  update-default-aspell   update-menus
  update-default-ispell   update-mime
 to name just a few.

Resolvconf isn't really comparable to the update-* utilities.
Unlike them, resolvconf takes information on its standard input.
And unlike them, it run during normal use of the machine, not
at administration time.  The update-* programs usually modify
files in /etc/, whereas one of the reasons for creating
resolvconf is to avoid modifying files in /etc/.

--
Thomas Hood




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
On Sun, 2003-07-06 at 01:00, Goswin Brederlow wrote:
 You should think of a mechanism for daemons to get notified about
 changes in resolv.conf.

There is already such a mechanism.  See below.

 Like providing a function to register a script
 and a list of arguments (like the PID of the program to
 notify). Whenever the resolv.conf changes all currently registered
 scripts would be called with their respective arguments.
 
 The simplest form would be:
 
 resolv.conf-register /etc/init.d/squid reload
 
 That would make squid to reload its config each time a nameserver is
 added or removed.

Currently, scripts in /etc/resolvconf/update.d/ get run when
resolver information changes.  So, would it suffice to create
/etc/resolvconf/update.d/squid containing the following?
#!/bin/sh
/etc/init.d/squid reload

--
Thomas Hood




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
On Sun, 2003-07-06 at 01:32, Marco d'Itri wrote:
 On Jul 05, Thomas Hood [EMAIL PROTECTED] wrote:
  * Before entering the Debian archive it would be nice if resolvconf
were supported by all packages that currently futz with
/etc/resolv.conf, including pump and bind.
 If you mean that if should be mandatory to install this package on every
 name server, then it would not be nice at all.

No, I meant that before entering the Debian archive it would
be nice if resolvconf were supported by all packages that
currently futz with /etc/resolv.conf, including pump and bind.

--
Thomas Hood




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Eduard Bloch
#include hallo.h
* Thomas Hood [Sat, Jul 05 2003, 09:51:56PM]:
 Summary
 ~~~
 Resolvconf is a proposed standard framework for updating the
 system's information about currently available nameservers.
 
 Most importantly, it manages /etc/resolv.conf , but it does 
 a bit more than that.

The Idea is great, it would solve the long outstanding dispute between
me (pppoeconf) and pppconfig maintainer. Please, would you consider to
add another feature: priorising some entries depending on the source.
That means: 

pppoeconf's and pppconfig's script run the tool with parameter --class
dialup, dhcp clients with --class dynamic and the default class would
be static. In some config file, the user defines that dialup gets
priority one, dynamic two and static three (for example), and
resolvconf merges the existing dns entries in the appropriate order.

Please also note that it would (IMHO) be a good idea to manage the
search list with a similar priority table, so the provider's domain is
appended or prepended (as user wishes it).

MfG,
Eduard.
-- 
housetier isga: versuch mal 'apt-cache search girl friend'  :-) du wirst
überrascht sein




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
 On Sun, 2003-07-06 at 12:13, Thomas Hood wrote:
  No, I meant that before entering the Debian archive it would
  be nice if resolvconf were supported by all packages that
  currently futz with /etc/resolv.conf, including pump and bind.
 Which other packages?

I guess I need to explain more clearly.  First.  Currently,
making certain packages work with resolvconf requires some
manual changes to configuration files.  The changes are not
large: just adding a couple of lines to initscripts and such.
Still, I think it would be nice if such packages worked with
resolvconf -- if resolvconf happens to be installed -- without
requiring any manual changes.  I won't explain here how this
can be done; please see the announcement and bug reports
#194204 and #199255 for details.

At the moment, the only packages I know of that need some
adaptation are pump and bind.  There are probably others.
Someone has mentioned squid, so I will investigate squid
later today, but at first glance it looks as if no changes
to squid will be required.

Second, resolvconf's usefulness in allowing the relocation of
variable files out of /etc/ will be greatest if packages that
currently write resolver information into files in /etc/ , such
as pump, are changed so that when resolvconf is installed they
send that information to resolvconf instead.  Again, please see
#194204.

My aim is not to make resolvconf mandatory; it is to have
packages work properly with resolvconf *if* resolvconf is
installed.  When resolvconf is not installed, other packages
should continue to do what they did before.

--
Thomas Hood




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
On Sun, 2003-07-06 at 12:42, Eduard Bloch wrote:
 Please, would you consider to add another feature: priorising some
 entries depending on the source.  That means:

 pppoeconf's and pppconfig's script run the tool with parameter --class
 dialup, dhcp clients with --class dynamic and the default class would
 be static. In some config file, the user defines that dialup gets
 priority one, dynamic two and static three (for example), and
 resolvconf merges the existing dns entries in the appropriate order.

Let me start by saying that resolv.conf is generated by
/etc/resolvconf/update.d/libc , which, being a conffile,
can be customized by the admin.

Your idea strikes me as a good one.  It would add some
complexity to the system, but it would provide more
information for /etc/resolvconf/update.d/libc to use when
it generates the resolv.conf file.  Currently the script
discriminates only on the basis of interface type (i.e.,
lo, ppp or eth).

However, I would only want to add this feature if we were
certain that it was needed.

--
Thomas Hood




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-06 Thread Thomas Hood
On Sun, 2003-07-06 at 01:52, Nick Phillips wrote:
 Actually I think the simplest form would be to have /etc/resolvconf/notify.d
 and run all scripts in there at the relevant times, with any necessary
 arguments (which would be standard).

Please take a look at how resolvconf runs the scripts in 
/etc/resolvconf/update.d/ and let me know if you think
anything else is needed.

Alioth was down for a while but I just checked and the deb
is once again available (in the resolvconf section of the
update-resolv project).
  http://alioth.debian.org/project/showfiles.php?group_id=1227

--
Thomas






Resolvconf -- a package to manage /etc/resolv.conf

2003-07-05 Thread Thomas Hood
Summary
~~~
Resolvconf is a proposed standard framework for updating the
system's information about currently available nameservers.

Most importantly, it manages /etc/resolv.conf , but it does 
a bit more than that.

Background and rationale

During the long discussion on debian-devel about making it possible
to mount the root filesystem read-only, it was pointed out that one
of variable files standing in the way is the libc resolver
configuration file, /etc/resolv.conf .  Several programs modify this
file as network interfaces are brought up and down.  This situation
is undesirable not only because it stands in the way of a read-only
rootfs but also because it prevents the user from running more than
one configurer at a time: the second process would overwrite the
first process's changes to resolv.conf.  The latter problem could
be addressed by making configurers cooperate somehow; but this would
not meet another major need: the need to supply resolver information
to DNS cache programs such as named and dnsmasq.  Various packages
have addressed these issues, but only partially and
idiosyncratically.  Resolvconf aims to solve the problem simply and
completely.

Resolvconf
~~
/sbin/resolvconf is a short sh script which I have packaged together
with some hook scripts in a package also called 'resolvconf'.
Resolvconf mediates between programs that supply resolver information
(mainly interface configurers) and those that consume resolver
information (the libc resolver and DNS caches).

Please read the package README file for detailed information.
Here is a summary of how resolvconf works.

Usage
~
Interface configurers send resolver information to resolvconf in the
format of the familiar /etc/resolv.conf file.  Thus, for example,
a program that has configured interface $IFACE would do the following
after generating a resolv.conf file named 'new-resolv.conf'.

  resolvconf -a $IFACE  new-resolv.conf

This command updates the resolver information related to interface
$IFACE.  Any information previously sent for this interface is
overwritten.  On bringing the interface down, the configurer would
do the following.  

  resolvconf -d $IFACE

For another example, a proxy script for pppd could forward to
resolvconf the resolver information that is made available to
ip-up.d/ and ip-down.d/ scripts in environment variables DNS1, etc.

  echo nameserver $DNS1 | resolvconf -a $IFACE

These are just examples.  Appropriate hook scripts are included in
the resolvconf package for ppp, dhcp3-client, pump and ifupdown
(for static inet ifaces).  Support for other configurers including
dhcpcd and laptop-net has been added to scripts belonging to those
packages.

/sbin/resolvconf stores the information sent to it and then runs the
scripts in /etc/resolvconf/update.d/ .  One of the latter generates
the libc resolver configuration file.  Another generates the options
portion of the BIND named configuration file, containing a
forwarders statement listing available nameserver forwarders.
(This allows named effectively to be used as a DNS cache on a system
whose network environment varies, e.g., on a laptop.)  Another
generates a list of forwarders for dnsmasq to use.  Any other program
that needs to take action when resolver information is updated could
likewise employ a script in /etc/resolvconf/update.d/ .

The generation of the resolv.conf file (actually stored at
/var/run/resolvconf/resolv.conf , to which /etc/resolv.conf is
to be symlinked) can be controlled by the admin by editing
/etc/resolvconf/update.d/libc .  Different strategies can be
implemented: e.g., one possible strategy would be to put only the most
recently provided information into resolv.conf .  The current default
strategy is to put *all* available resolver information into
resolv.conf, ordered by interface type as follows: lo, eth*, ppp* .
This strategy will need to be refined, I know, but it works for me
in its current form.

The admin can of course disable resolv.conf automagic by deleting the
/etc/resolv.conf symlink and putting a static file at that location.

Compatibility
~
When installed, resolvconf works properly with the very latest ppp
(and pppconfig), dchp3-client and dhcpcd packages without further ado:
the resolvconf package includes hook scripts for them which make the
appropriate /sbin/resolvconf calls.  Likewise resolvconf works
properly with the very latest dnsmasq package without further ado:
the resolvconf package includes an update script to generate the
list of nameservers it can use, and dnsmasq uses the latter list if it
is available.

My thanks go to the maintainers of the dhcp3-client, dhcpcd, dnsmasq,
laptop-net and pppconfig packages for their cooperation.

With some local configuration, resolvconf also works properly with
configurers pump, udhcpc and ifupdown, and DNS cache bind.  See the
HOWTO section of the README file for instructions on how to configure
these 

Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-05 Thread Simon Hürlimann
Am Samstag, 5. Juli 2003 21.51 schrieb Thomas Hood:
 Summary
 ~~~
 Resolvconf is a proposed standard framework for updating the
 system's information about currently available nameservers.
Cool, I really like this idea.

 the need to supply resolver information
 to DNS cache programs such as named and dnsmasq.
Firewalls could use this stuff too, I guess.

 Resolvconf
 ~~
 /sbin/resolvconf is a short sh script which I have packaged together
 with some hook scripts in a package also called 'resolvconf'.
I'd prefer update-resolv like
 update-alternatives update-initrd
 update-catalog  update-ispell-dictionary
 update-default-aspell   update-menus
 update-default-ispell   update-mime
to name just a few.

 Credit
 ~~
 The basic idea for resolvconf originally came from Emile van Bergen.
 I claim any braindamage in the implementation as my own.
Thanx to both of you:-)

Regards
Simon




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-05 Thread Goswin Brederlow
Thomas Hood [EMAIL PROTECTED] writes:

 Summary
 ~~~
 Resolvconf is a proposed standard framework for updating the
 system's information about currently available nameservers.
 
 Most importantly, it manages /etc/resolv.conf , but it does 
 a bit more than that.

You should think of a mechanism for daemons to get notified about
changes in resolv.conf. Like providing a function to register a script
and a list of arguments (like the PID of the program to
notify). Whenever the resolv.conf changes all currently registered
scripts would be called with their respective arguments.

The simplest form would be:

resolv.conf-register /etc/init.d/squid reload

That would make squid to reload its config each time a nameserver is
added or removed.

MfG,
Goswin




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-05 Thread Nick Phillips
On Sun, Jul 06, 2003 at 01:00:20AM +0200, Goswin Brederlow wrote:

 The simplest form would be:
 
 resolv.conf-register /etc/init.d/squid reload

Actually I think the simplest form would be to have /etc/resolvconf/notify.d
and run all scripts in there at the relevant times, with any necessary
arguments (which would be standard).


Cheers,


Nick
-- 
Nick Phillips -- [EMAIL PROTECTED]
You can rent this space for only $5 a week.




Re: Resolvconf -- a package to manage /etc/resolv.conf

2003-07-05 Thread Marco d'Itri
On Jul 05, Thomas Hood [EMAIL PROTECTED] wrote:

 * Before entering the Debian archive it would be nice if resolvconf
   were supported by all packages that currently futz with
   /etc/resolv.conf, including pump and bind.
If you mean that if should be mandatory to install this package on every
name server, then it would not be nice at all.

-- 
ciao, |
Marco | [691 co3tqxghU7k.s]