LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-29-2006, 01:27 PM   #1
cuco76
Member
 
Registered: Oct 2003
Location: Tucson
Distribution: Fedora, RHEL, Ubuntu
Posts: 225

Rep: Reputation: 31
resolv.conf keeps changing solution


Hello,

I just wanted to pass this on in case some one else has this issue. I am running FC5 on a corp network and everytime i use the Fedora system-config-network and add in my corp DNS Search path it would get overwritten on boot. Everywhere i read people warned about changing the dhclient-script but I found this workaround! I don't remember where I found it but it works!

In order for me to keep these settings I edited my /etc/dhclient-eth0.conf and added the line:

Code:
supersede domain-name "1stlocal.search.com 2ndlocal.search.com 3rdlocal.search.com";
/etc/dhclient-eth0.conf
Code:
supersede domain-name "1stlocal.search.com 2ndlocal.search.com 3rdlocal.search.com";
send host-name "hostname.whatever.com";  # temporary RHL ifup addition
This prevents dhclient scripts from chaning the search line in resolv.conf and this is how my resolv.conf looks everytime:

Code:
; generated by /sbin/dhclient-script
search 1stlocal.search.com 2ndlocal.search.com 3rdlocal.search.com
nameserver ###.##.#.##
nameserver ###.##.###.###
 
Old 09-29-2006, 02:38 PM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
This is all well and good, as long as you stay at home, but if you take your laptop out and log on to a new network, I would assume that you do need resolv.conf overwritten.

I have this problem with my daughters computer. Unfortunately, she lives 250 miles away, and I don't get a lot of time to experiment. At the moment, I have a script set up to replace the overwritten resolv.conf file with one that works, at her home, after she boots, but it's not a very satisfactory solution.

A lot of people, including my daughter, using dsl seem to have the problem; which is that the dns servers don't get loaded correctly into resolv.conf. I would certainly like a definitive solution. The really exasperating thing is that windows handles it perfectly. There has got to be an explanation, but I haven't encountered it yet.
 
Old 09-30-2006, 03:57 AM   #3
bonowax
Member
 
Registered: Jul 2006
Location: Suburbs of Lisbon, Portugal
Distribution: Slackware, FreeBSD
Posts: 75

Rep: Reputation: 16
Hello there;

Just thought I'd add a couple lines to this thread since I once applied the same workaround that Cuco did...
I only had to do it because *I* wanted to use my own dns server, otherwise I can think of no reason why one should not stick the DHCP provided dns servers (unless they're broken, of course)...
I never faced a situation, using ADSL or cable connections, in which the ISP's DHCP assigned configuration would work in windows but no in Linux... Hell, even my corporate 'bloze2000/3 DHCP servers spew out correct configs for my linux boxes when needed...
Slackware's dhcpcd DHCP client seems to work reliabily, as did the versions of ISC's dhclient that I tried a couple years ago... MAybe you should try to use a different DHCP client on your daughters box...?

Cheers
 
Old 10-02-2006, 12:15 PM   #4
cuco76
Member
 
Registered: Oct 2003
Location: Tucson
Distribution: Fedora, RHEL, Ubuntu
Posts: 225

Original Poster
Rep: Reputation: 31
Thanks for the comments guys. One thing I want to clear up is that on my corp network DHCP isn't setup properly and only spits out one nameserver. The IT folks have to add in the nameservers manually on a new windows installation. Hence the issue I have is that if I add it manually DHCP-script overwrites it! Hope this clarifies!


Thanks,
 
Old 10-02-2006, 04:57 PM   #5
TylerD75
Member
 
Registered: Aug 2004
Location: Norway
Distribution: Gentoo
Posts: 96

Rep: Reputation: 18
You might try to add this to /etc/dhcp/dhclient.conf (or where ever you keep it :

prepend domain-name-servers <ip or name>

I believe you can have more than one entry, so you could put it below prepend domain-name-servers 127.0.0.1?

This should retrieve the dhcp DNS, and add the other one as well.

Cheers,
TylerD75
 
  


Reply



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
/etc/resolv.conf lordra Red Hat 1 05-05-2006 06:54 AM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
resolv.conf stanleytiew Linux - Newbie 2 05-13-2005 04:25 PM
resolv.conf changing everytime network restart cuco76 Linux - Networking 4 11-29-2004 08:19 PM
/etc/resolv.conf keeps changing silvercastle Linux - Networking 2 04-15-2004 10:51 PM

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

All times are GMT -5. The time now is 10:54 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