[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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 <jdthood@yahoo.co.uk>



Reply to: