In newest Fedora and Centos configuration of dns is in /etc/sysconfig/network-scripts/ifcg-eth0 (or other interface config). So what for is still /etc/resolv.conf needed. Since its no longer used. (I tested this on new fedora 18 instalation and putting dns ipis in resolve.conf didn't work only changing the ifcg file and restart network service)

  • I believe that the interface files will overwrite resolv.conf (or update it) as interfaces are called. The settings in the ifcfg are adapter specific whereas resolv.conf is system-wide. However it may be not correct under FC18 as you've tried deleting it! Bear in mind however there is also the ncsd (?) service which will cache DNS results for you, so maybe that is still returning answers. – Dave Mar 14 '13 at 15:01
  • Sorry just read your question in more detail; you should put your IPs in the ifcfg as resolv.conf (which the system uses to lookup) is being overwritten with these values each time the network service is restarted. – Dave Mar 14 '13 at 15:03
  • Right, as @Dave said, /etc/resolv.conf is needed, it is just generated dynamically from the interface config files. – lsd Mar 14 '13 at 15:05

/etc/resolv.conf is the system-wide configuration of where to look for DNS, as used by gethostbyname() etc.


It is generally overwritten by the network service with the adapter-specific settings given in ifcfg (or provided by DHCP).

So any changes to preferred DNS servers should be made in the ifcfg files rather than resolv.conf to avoid over-writing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.