FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-22-2009, 10:51 PM
tyler
 
Default dhclient not updating /etc/resolv.conf

Hi,

I lug my laptop back and forth between work, where I connect to a
ethernet cable on eth0, and home, where I use wireless on ath0. I have
two scripts that I run, depending on where I am, to reconfigure. This
works fine when I switch to the wired network, but for some reason, when
I switch back to wireless, /etc/resolv.conf stays pointed to the dns
server at work. The same scripts *used* to work, and I haven't changed
them or the files they point to, so I'm not sure what I'm doing wrong.

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---

The different scripts I use make symlinks to different files that differ
only in the smarthost they point to.

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.

--8<---------------cut here---------------start------------->8---
# Configuration file for /sbin/dhclient, which is included in Debian's
# dhcp3-client package.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes;

--8<---------------cut here---------------end--------------->8---

Thanks,

Tyler


--
I never loan my books, for people never return them. The only books
remaining in my library are those I’ve borrowed from others.

--unknown


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-23-2009, 07:14 AM
Stefan Monnier
 
Default 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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-23-2009, 12:39 PM
tyler
 
Default dhclient not updating /etc/resolv.conf

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>
> 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.

Thanks, I'll look into this.

>
>> 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?
>

I don't think I changed the defaults, and I do get an IP address on
ath0, but it doesn't do me any good until I manually correct the
resolv.conf file to point at the dns server on my router. The strange
thing is, dhclient *does* modify resolv.conf, changing the search line
from

search SMUNET.SMU.CA

to

search SMUNET.SMU.CA, no-domain-set.aliant

which is, it adds my home domain, but doesn't delete my work domain, and
it leaves the nameserver lines pointing at my work dns.

??

Thanks,

Tyler


--
Research is what I'm doing when I don't know what I'm doing.
--Wernher von Braun


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 10:27 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org