Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)

share|improve this question
    
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
add comment

1 Answer 1

up vote 4 down vote accepted

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

http://linux.die.net/man/5/resolv.conf

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.

share|improve this answer
add comment

Your Answer

 
discard

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

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