LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Resolv.conf Fedora-10 (https://www.linuxquestions.org/questions/linux-software-2/resolv-conf-fedora-10-a-784607/)

tommy991 01-25-2010 09:39 AM

Resolv.conf Fedora-10
 
Same issue as posted. Wont stay set. reboot clears entry's. I been through all the threads and I can't seem to fix it. This is painfull,
Any new ideas ?

MS3FGX 01-25-2010 09:44 AM

If you are using DHCP, resolv.conf will always be reset at boot time. If you want to keep it and still use DHCP, you would need to modify the boot scripts. Unless there is a Fedora specific configuration for that, I don't personally know.

r3sistance 01-25-2010 10:29 AM

I just placed what I previously wrote in code tags as I have now figured out the answer... at least for CentOS...

Code:

Before you follow what I say, ensure that you back up the dhclient script in case you need to restore it later on. Also I am doing this from CentOS and not Fedora, I am hoping they are the same here.

In /sbin/dhclient, you should find a line that is like

if [ "${PEERDNS}" == "no" ]

change this to

if [ "no" == "no" ]

And this should fix this issue but it is only a temporary fix and probably not recommended, I am currently trying to figure out where it's drawing ${PEERDNS} from.

EDIT: Here is how I figured to stop it in CentOS, this should work in Fedora too but I am not 100% on this.

In CentOS the answer is to set "PEERDNS=no" in the device file in /etc/sysconfig/network-scripts/

So if the device is eth0 then open the file /etc/sysconfig/network-scripts/ifcfg-eth0 and add the line
PEERDNS=no

This should stop this behavior, as a result in the investigation of this caused a bug where the DNS settings revert when I do enable dhcp to their initial pre-dhclient values after about a minute... but meh, I don't use dhcp anyway.

tommy991 01-26-2010 08:43 AM

Nope, Still not working. This is Fedora - 10. Can I disable dhcp ? I remember during the install process that DHCP was enabled. After the install process, I changed the address and made the the interface static, So I thought.Is the information seeded from a default location? Can I change the way the Network starts up?
Thanks for helping

r3sistance 01-26-2010 10:47 AM

you should be able to change the network type by going into /etc/sysconfig/network-scripts/ifcfg-eth0 and changing BOOTPROTO from dhcp to static, however you will have to add a whole load of other information. Here is a sample device, note that I have switched all IP information to an internal range and Xed out the hardware address, the HWADDR should already be set and should not be edited unless you know what you are doing.

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=xx:xx:xx:xx:xx:xx
IPADDR=192.168.0.25
GATEWAY=192.168.0.1
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes

tommy991 01-26-2010 04:01 PM

Here is how it reads:
cat ifcfg-eth1
# Intel Corporation 82557/8/9/0/1 Ethernet Pro 100
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:02:55:6d:13:24
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.200
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
MTU=1500
GATEWAY=192.168.1.1
TYPE=Ethernet

I made the change to

BOOTPROTO=Static

I will give it a try. Thanks

r3sistance 01-26-2010 04:34 PM

Why is PEERDNS set to yes? You might want to set that back to no.

tommy991 01-27-2010 08:05 AM

Made the change. Still no effect. Frustrating....

tommy991 02-05-2010 07:53 AM

I still struggle w/this. Does anyone else have ideas.
Thanks in advance ...:scratch:

r3sistance 02-05-2010 08:09 PM

Did you try the script changes above that I put in the code tags... I don't have fedora and it's the last thing I have, it's gunna need manual reconfiguring of scripts I believe.

tommy991 02-06-2010 02:28 PM

I made the change. When I reboot it reverts back. Do you know what script that generates these files:
[root@tbhomeserv network-scripts]# ll
total 236
-rw-r--r-- 3 root root 250 2010-02-06 15:14 ifcfg-eth0
-rw-r--r-- 3 root root 253 2010-02-06 15:14 ifcfg-eth1
This gets generated at boot time.If I could find the scripts that run, I can change their behaviour and fix this.
Thanks for helping


All times are GMT -5. The time now is 06:17 PM.