Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-07-2006, 07:52 AM   #1
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?


Old 03-07-2006, 06:54 PM   #2
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, 01:10 AM   #3
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, 06:25 PM   #4
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
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;" in the section concerning your NIC... that should be it. More info on man dhclient.conf


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 12:51 PM
DHCP update resolv.conf forrestevans Linux - Networking 0 11-03-2004 10:12 PM
dhcp and resolv.conf naflan Linux - Networking 2 10-04-2004 08:48 PM
/etc/resolv.conf and dhcp client win32sux Linux - Networking 2 07-29-2004 09:19 AM
resolv.conf gets modified when dialing... jaitropfaim Linux - Networking 2 02-16-2003 03:26 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:42 AM.

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