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

Re: dhclient not updating /etc/resolv.conf



> The script to switch to wireless is (run as root):

> --8<---------------cut here---------------start------------->8---
> #! /bin/bash

> cd /etc/exim4/
> rm /etc/exim4/update-exim4.conf.conf
> ln -s sympatico.conf.conf update-exim4.conf.conf
> dpkg-reconfigure -u exim4-config
> --8<---------------cut here---------------end--------------->8---

I recommend you install resolvconf (maybe it's installed already) and
then you can place a script in /etc/resolvconf/update-libc.d which will
be run whenever your resolv.conf file is modified (by getting some data
from DHCP typically).  I use this to automatically switch my Postfix
smarthost depending on where I am.

This way I don't need to run any script: ifplugd automatically runs
dhclient when I plug in an ethernet cable which then causes my postfix
script to be run when dhclient gets an answer.
Similarly I use wpa-roam (in /etc/network/interfaces) so the wireless
network is automatically selected whenever it's available, at which
point dhclient is run etc...

> Even after I explicitly call dhclient ath0 the contents of
> /etc/resolv.conf stay pointed at the dns servers for my work server. Any
> tips as to why this doesn't work anymore? I've posted my dhclient config
> below, in case that's helpful.

No idea, have you changed dhclient's config from the stock
Debian config?  Do you get an IP address via your ath0 interface?


        Stefan


Reply to: