LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problem with resolv.conf (https://www.linuxquestions.org/questions/linux-networking-3/problem-with-resolv-conf-348226/)

divdude 07-29-2005 11:10 PM

Problem with resolv.conf
 
I am using fedora core 4 . I created a resolv.conf file but
the system keeps overwriting it. How can i prevent this.
Thanks in advance.

adz 07-30-2005 02:38 AM

If you're using DHCP then it will get overwritten. If there's no problem with your connectivity then leave it. If you need to change it, either change the nameserver settings on your DHCP server (assuming you have access) or go static.

divdude 07-30-2005 11:49 AM

thanks a lot

MensaWater 07-30-2005 07:48 PM

I ran into this on my Debian client. Found there is a file called /etc/dhclient-conf which by default has all entries commented out.

I uncommented and modified the line that specified the hosts to for name resolution:

supersede domain-name "domain1.com domain2.net domain3.dmz.com";

On my RedHat boxes I'm not doing DHCP but just did a man on dhclient and dhclient.conf and see both man pages are there so it seems likely the same works for Fedora. However they don't have a default dhclient.conf so far as I could see.

Anyway by doing the above on my Debian workstation I am able to use DHCP but keep it from overwriting resolv.conf.

divdude 07-31-2005 06:38 AM

I also tried to do something like that. There is such a file in
SuSe too.
When I googled I found that there is a file called dhclient.conf
in /etc but none was in mine. I ran man dhclinet.conf too and it
gave me results too showing how to configure it bit not the location.
I tried file search to find such a file but could not find. Maybe it is
is under slightly different name. I think I should try with some
wildcards.
Thanks for your suggestion.

MensaWater 08-01-2005 07:17 AM

No problem.

It seems likely it belongs in /etc on RedHat/Fedora. The difference is probably they just don't ship you one - they expect you to create it from scratch. The man page for dhclient (not dhclient.conf) on my RedHat specifically indicates /etc/dhclient.conf as the location. However it does mention this location can be changed by /sbin/dhclient-script. You can view this script to see if it does override defaults.

Since essentially the one on Debian only has the line I show uncommented I think you should just be able to create a one line file called /etc/dhclient.conf. Insert the line shown in my prior post. (Of course you'd change domain1, domain2 and domain3 to those appropriate for your environment.) I don't think it would hurt to try this as at worst it simply wouldn't read the file.

divdude 08-01-2005 09:43 PM

Thanks a lot for the suggestion.


All times are GMT -5. The time now is 04:06 AM.