Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Scientific Linux 5.5, /etc/resolv.conf is continually overwritten and so DNS is broken. If I delete or change it, it instantly reverts to its former state. Writing over it with: cp /etc/NEWresolve.conf /etc/resolv.conf && chattr +i /etc/resolv.conf just results in an immutable copy of the original resolv.conf with no changes. I'm running as root (not sudo) and Avahi and NetworkManager are not running.

Any ideas? There's no DHCP anywhere on this machine, and even if there were, I can't imagine it'd overwrite the file so quickly.


Some ancillary info: uname -a Linux localhost.localdomain 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:12:32 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux Intel I340 (82580) NIC

share|improve this question

migrated from Jul 10 '11 at 3:47

This question came from our site for professional and enthusiast programmers.

what is the output of: lsof /etc/resolv.conf ? – Corey Henderson Jul 10 '11 at 2:07
lsof /etc/resolv.conf is blank – user837237 Jul 10 '11 at 2:10
If you are at the console, try rebooting into single user mode and editing the file. If you still have the same problem, I suspect there may be a kernel module on your server that is doint this. – Corey Henderson Jul 10 '11 at 2:18
Are you running resolvconf? – Jodie C Jul 10 '11 at 4:31
A kernel module that modifies resolv.conf? Incredibly unlikely. – womble Jul 10 '11 at 5:19

NetworkManager is a likely culprit. NetworkManager will overwrite /etc/resolv.conf, and could explain the behavior you are seeing. However, I think NetworkManager typically adds a warning to the file like # Managed by NetworkManager, do not edit.

From the GUI, you can configure NetworkManager to not overwrite /etc/resolve.conf .

NetworkManager is considered harmful on many systems (Servers, virtualization hosts) because it overwrites your manual settings without warning you, and it doesn't support advanced networking features. You might want to to just shut down the service and prevent it from starting at next reboot.

share|improve this answer
If you really need NM you can mark interfaces as NM_CONTROLLED=no in their respective /etc/sysconfig/network-scripts/ifcfg-* files. You can also set the nameservers there. – AndreasM Jul 15 '11 at 20:00
find /etc -inum `ls -i /etc/resolv.conf | awk '{print $1}'`

and see how modifies the other files

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.