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 11-29-2004, 02:50 PM   #1
Registered: Oct 2003
Location: Tucson
Distribution: Fedora, RHEL, Ubuntu
Posts: 225

Rep: Reputation: 31
resolv.conf changing everytime network restart


I am running Fedora Core 3. I need to have a few DNS Search Paths in my /etc/resolv.conf. If I add them directly or by way of system-config-redhat they disappear after a reboot or if I do a $service network restart. I believe dhcp is putting the defaul one in and removing the others. Does anyone know of a way around this?

Thanks in advance!

Old 11-29-2004, 02:58 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
yeah this is part of the DHCP specifications, you'll need to add a command line flag to your dhcp client, normally there's a DHCPARGS variable, which you would specificy in /etc/sysconfig/network-scripts/ifcfg-eth0. if you're using dhcpcd, it's the -R option, but this will proabbly vary on othter clients, e.g. pump, dhclient, dhcpxd check tha relevant manpage for your option.
Old 11-29-2004, 02:58 PM   #3
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
Try putting
request subnet-mask, broadcast-address, time-offset, routers;
in your dhclient.conf. Further information can be found in man dhclient.conf
Old 11-29-2004, 03:01 PM   #4
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
The best way is probably to edit your dhclient-script (probably /sbin/dhclient-script) and comment out all the lines in the "make_resolv_conf" function - leave the function itself though.
Old 11-29-2004, 08:19 PM   #5
Registered: Oct 2003
Location: Tucson
Distribution: Fedora, RHEL, Ubuntu
Posts: 225

Original Poster
Rep: Reputation: 31
Thanks David,

I commented the sections relating to make_resolve_conf. Works like a champ. I will just have to keep an eye on the nameservers just in case they change!

Thanks again!


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
at restart resolv.conf it is like it has to be??? meDream Linux - Networking 10 05-27-2005 02:16 AM
/etc/resolv.conf mustangfanatic SUSE / openSUSE 5 10-18-2004 09:28 PM
where does system-config-network put dns info, besides /etc/resolv.conf ? bdp Fedora 1 09-03-2004 12:09 AM
Everytime restart MDK, I have to reconfigure my SBLive 5.1 card to get sound Fear58 Linux - Hardware 3 07-12-2004 09:37 PM
/etc/resolv.conf keeps changing silvercastle Linux - Networking 2 04-15-2004 10:51 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:35 PM.

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