What causing resolv.conf overwritten ?
What causing resolv.conf overwritten ?
Hello all,
I search for this issue quite a lot, there are numerous suggestion but cause is still not clear. I just installed the new CentOS release 6.4 (Final) and kernel 2.6.32-358.2.1.el6.x86_64 x86_64 x86_64. Some strange reason or even every now and then my /etc/resolv.conf is overwritten which is causing problem in name resolution. Let me tell you this - I have not installed the network manger on this machine (because many people always pointing to network manger) and not running at all. The interface is not configured to get IP address from DHCP. So there are the configuration :
There are total 6 interface on this machine
eth0
eth1
eth2
eth3
lo
usb0
eth2 is the only up and running
DEVICE=eth2
HWADDR=44:40:b5:b2:73:66
TYPE=Ethernet
UUID=07eec0f5-2936-4151-a1cf-dce0489cabfc
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.1.1
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
DNS1=192.168.1.5
GATEWAY=192.168.1.3
I read this thread but not real answer for the cause
http://lists.centos.org/pipermail/centos/2009-October/083346.html
So what is causing this resolve.conf overwritten ? anybody has clue or this is just a bug in some script ?
K
I search for this issue quite a lot, there are numerous suggestion but cause is still not clear. I just installed the new CentOS release 6.4 (Final) and kernel 2.6.32-358.2.1.el6.x86_64 x86_64 x86_64. Some strange reason or even every now and then my /etc/resolv.conf is overwritten which is causing problem in name resolution. Let me tell you this - I have not installed the network manger on this machine (because many people always pointing to network manger) and not running at all. The interface is not configured to get IP address from DHCP. So there are the configuration :
There are total 6 interface on this machine
eth0
eth1
eth2
eth3
lo
usb0
eth2 is the only up and running
DEVICE=eth2
HWADDR=44:40:b5:b2:73:66
TYPE=Ethernet
UUID=07eec0f5-2936-4151-a1cf-dce0489cabfc
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.1.1
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
DNS1=192.168.1.5
GATEWAY=192.168.1.3
I read this thread but not real answer for the cause
http://lists.centos.org/pipermail/centos/2009-October/083346.html
So what is causing this resolve.conf overwritten ? anybody has clue or this is just a bug in some script ?
K
-
- Posts: 315
- Joined: 2012/09/15 21:06:54
Re: What causing resolv.conf overwritten ?
I would first double check that none of the other interfaces is actually up and getting an IP address from a DHCP server, which then overwrites /etc/resolv.conf
Re: What causing resolv.conf overwritten ?
No, I have checked all the interfaces, only one interface is up is eth2 which has a static IP.
What causing resolv.conf overwritten ?
Have you tried adding "PEERDNS=no"?
Re: What causing resolv.conf overwritten ?
well PEERDNS option is if you interface is set to get IP from dhcp server, isn't it ?
some guys were saying maybe this is related with annaconda ?
###############
From: rhelv6-list-bounces redhat com [mailto:rhelv6-list-bounces redhat com] On Behalf Of Brian Long (brilong)
Sent: Friday, March 16, 2012 4:07 PM
To: Red Hat Enterprise Linux 6 (Santiago) discussion mailing-list
Subject: Re: [rhelv6-list] resolv.conf being overwritten by NetworkManager
Are you certain the comment in /etc/resolv.conf about NetworkManager was not the one written by Anaconda during installation? Even when NetworkManager is not installed on the local disk, this comment will exist because Anaconda has it's own version of NetworkManager.
####################
well, after the installation NM_CONTROLLED was set to yes and I changed to no, But again NM_CONTROLLED is only applies if NetworkManager is installed and started however in my case I have no NetworkManger installed
Regards,
K
some guys were saying maybe this is related with annaconda ?
###############
From: rhelv6-list-bounces redhat com [mailto:rhelv6-list-bounces redhat com] On Behalf Of Brian Long (brilong)
Sent: Friday, March 16, 2012 4:07 PM
To: Red Hat Enterprise Linux 6 (Santiago) discussion mailing-list
Subject: Re: [rhelv6-list] resolv.conf being overwritten by NetworkManager
Are you certain the comment in /etc/resolv.conf about NetworkManager was not the one written by Anaconda during installation? Even when NetworkManager is not installed on the local disk, this comment will exist because Anaconda has it's own version of NetworkManager.
####################
well, after the installation NM_CONTROLLED was set to yes and I changed to no, But again NM_CONTROLLED is only applies if NetworkManager is installed and started however in my case I have no NetworkManger installed
Regards,
K
-
- Posts: 315
- Joined: 2012/09/15 21:06:54
Re: What causing resolv.conf overwritten ?
Let me suggest again that the symptom is entirely consistent with one of the interfaces being configured with dhcp.
Look for an active dhcp client process by running:
[code]
ps -Af | grep dhc
[/code]
This should find either dhclient or dhcpcd if either is running.
Look for an active dhcp client process by running:
[code]
ps -Af | grep dhc
[/code]
This should find either dhclient or dhcpcd if either is running.
-
- Posts: 1
- Joined: 2014/02/07 16:08:08
Re: What causing resolv.conf overwritten ?
I had the same problem. Though its been a while since you posted and have no doubt moved on, I will post my answer in case its useful to someone else.
I'll quote from this doc a few times: https://access.redhat.com/site/document ... faces.html
I didn't even have NetworkManager installed, and all of my interfaces were set to be static. But, my interface files were set to use NetworkManager with this directive
" NM_CONTROLLED=answer
where answer is one of the following:
yes — NetworkManager is permitted to configure this device. This is the default behavior and can be omitted.
no — NetworkManager is not permitted to configure this device. "
Setting it to no didn't change things. But I noticed that like the file contents you pasted in with:
DNS1=192.168.1.5
I also had this DNS directive set to the IP of my DNS server and while the doc says:
"DNS{1,2}=address
where address is a name server address to be placed in /etc/resolv.conf if the PEERDNS directive is set to yes. "
It apparently rewrites /etc/resolv.conf whether PEERDNS is set or not if you have DNS
Also, at boot time the system will overwrite /etc/resolv.conf if you have SEARCH set to anything as well.
Other people also had issues with this:
https://www.redhat.com/archives/rhelv6- ... 00010.html
It looks like its related to these bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=824622
https://bugzilla.redhat.com/show_bug.cgi?id=744177
http://bugs.centos.org/view.php?id=6537
I'll quote from this doc a few times: https://access.redhat.com/site/document ... faces.html
I didn't even have NetworkManager installed, and all of my interfaces were set to be static. But, my interface files were set to use NetworkManager with this directive
" NM_CONTROLLED=answer
where answer is one of the following:
yes — NetworkManager is permitted to configure this device. This is the default behavior and can be omitted.
no — NetworkManager is not permitted to configure this device. "
Setting it to no didn't change things. But I noticed that like the file contents you pasted in with:
DNS1=192.168.1.5
I also had this DNS directive set to the IP of my DNS server and while the doc says:
"DNS{1,2}=address
where address is a name server address to be placed in /etc/resolv.conf if the PEERDNS directive is set to yes. "
It apparently rewrites /etc/resolv.conf whether PEERDNS is set or not if you have DNS
Also, at boot time the system will overwrite /etc/resolv.conf if you have SEARCH set to anything as well.
Other people also had issues with this:
https://www.redhat.com/archives/rhelv6- ... 00010.html
It looks like its related to these bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=824622
https://bugzilla.redhat.com/show_bug.cgi?id=744177
http://bugs.centos.org/view.php?id=6537
Re: What causing resolv.conf overwritten ?
I had this problem and resolved it by adding NM_CONTROLLED=NO to /etc/sysconfig/network-scripts/ifcfg-lo
All the other interfaces had that parameter, didn't dawn n me lo needed it too.
Joe
All the other interfaces had that parameter, didn't dawn n me lo needed it too.
Joe
Re: What causing resolv.conf overwritten ?
I also found the following:
If you really want to set /etc/resolv.conf directly and you want to make sure NetworkManager won't overwrite it, you can set it up in /etc/NetworkManager/NetworkManager.conf.Code: Select all
[main] dns=none