LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2006, 06:52 AM   #1
septanla
Member
 
Registered: Sep 2003
Posts: 69

Rep: Reputation: 15
how to avoid resolv.conf been modified by dhcp-client


everytime i reboot, the nameserver in resolv.conf was modified. I checked the threads and it was said dhcp-client get something from dhcp-server and prepend those info in resolv.conf.

It keeps irrating me since I had to change the nameserver to a working one in order to access internet. can anyone tell me where is the source for the information dhcp-client get from dhcp-server? or is there anyway I can forbid dhcp-client modifying resolv.conf?

Thanks

Septanla
 
Old 03-07-2006, 05:54 PM   #2
arno
Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: fedora core 8, suse 10.3, ubuntu 7.10, kamikaze 7.09
Posts: 515

Rep: Reputation: 30
It depends on your linux distro since you dont name one i canīt give you an answer.
 
Old 03-18-2006, 12:10 AM   #3
shaunw
Member
 
Registered: Dec 2005
Posts: 77

Rep: Reputation: 15
Smile Dhcp

If you are using DHCP to get IP addresses and nameserver
addresses then everytime you boot it will write a temporary
resolve.conf file. It has to do this to write in the nameserver
addresses obtained through DHCP since these might change. If you
want to change something in resolve.conf then turn off DHCP
make your changes and turn it on again.
DHCP can be configured to obtain
1. Your computers IP address
2. Your hostname
3. Nameserver IP addresses.
You should also be able to turn off any of these parts of the
DHCP service without effecting the others. How you do this
depends upon your linux distribution.
Many distibutions also have a resolve.conf.local file for
adding in information you don't want to change.
 
Old 03-18-2006, 05:25 PM   #4
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,
you can edit/create a /etc/dhclient.conf to explicitly tell which parameter you want to set up through dhcp queries...
remove the domain-name-servers value from the require and request strings, and add a line like "option domain-name-servers 127.0.0.1;" in the section concerning your NIC... that should be it. More info on man dhclient.conf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP client overwriting resolv.conf... how to stop it? gauge73 Linux - Networking 6 05-04-2005 11:51 AM
DHCP update resolv.conf forrestevans Linux - Networking 0 11-03-2004 09:12 PM
dhcp and resolv.conf naflan Linux - Networking 2 10-04-2004 07:48 PM
/etc/resolv.conf and dhcp client win32sux Linux - Networking 2 07-29-2004 08:19 AM
resolv.conf gets modified when dialing... jaitropfaim Linux - Networking 2 02-16-2003 02:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration