2

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)

Flup
  • 7,978
  • 2
  • 32
  • 43
B14D3
  • 5,188
  • 15
  • 64
  • 83
  • 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

1 Answers1

4

/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.

Dave
  • 355
  • 1
  • 2
  • 12