Thursday, January 24, 2008

dhclient-resolv.conf

dhclient writing my /etc/resolv.conf so here how to add extra stuff into resolv.conf
gedit /etc/dhcp3/dhclient.conf and add
prepend domain-name-servers 192.168.1.1 (router)
then run
dhclient
check /etc/resolv.conf for 192.168.1.1
(ubuntu run dhclient from /etc/dhcp3)
man dhclient-script for more details

if wlan0 then resolv.conf
search phub.net.x.x.com
nameserver 192.x.2.1 (cable modem)
nameserver 192.x.1.1 (router)
nameserver 64.71.255.x

if eth0 then resolv.conf (via XP)
search mshome.net
nameserver 192.x.1.1
nameserver 192.x.0.1

all done automatic by dhclient
kill -9 dhclient (if want to run again it shows error already pid file /var/run/dhclient.pid)

2 comments:

Thomas Alva Tran said...

IT SEEMS BOTH DHCP from XP and ROUTER WAP write into resolv.conf file.

Thomas Alva Tran said...

I have to unplugged ethernet between ubuntu and XP let the wlan0 is on which connected to WAP and let its DHCP writes into resolv.conf. And it is alway has resolv.conf from WAP. As soon as I plugged the ethernet, this resolv.conf will be overwritten by DHCP of XP and wireless LAN lossing it is router (search phub.net.x.x.com of router replaced by mshone.com of XP)