LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   resolv.conf keeps changing solution (https://www.linuxquestions.org/questions/linux-networking-3/resolv-conf-keeps-changing-solution-488058/)

cuco76 09-29-2006 01:27 PM

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 ###.##.###.###


rickh 09-29-2006 02:38 PM

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.

bonowax 09-30-2006 03:57 AM

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

cuco76 10-02-2006 12:15 PM

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,

TylerD75 10-02-2006 04:57 PM

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


All times are GMT -5. The time now is 02:15 AM.