This content has been marked as final. Show 4 replies
I'm not sure I understand all of this about the DNS change but with respect to reading /etc/hosts before the DNS you should check the "hosts" line in the /etc/nsswitch.conf file. If "files" appears before dns in that line, the system should consult the /etc/hosts file before the DNS. The manual nsswitch.conf manual page describes this file in detail. Perhaps more detail than you'd like in fact.
You should also be aware that there is a name service cache which can satisfy requests before consulting any name service. If you change the nsswitch.conf file the cache may still contain data from the old configuration. If you change the nsswitch.conf "hosts" line, you may need to do a "nscd -i hosts" command to clear the hosts cache before you can see the result of the change.
I have finally received feedback from my collegues.
It seems that the permissions of the file "/etc/nsswitch.conf" were wrong, causing the machine not to read that file.
So it seems that the following happened:
User requested "ping <other_machine>", and the machine did the following:
- First try to read /etc/nsswitch.conf. As the permissions were wrong, this did not succeed
- Then read the /etc/resolv.conf file. As this file existed, the DNS was used for retrieving the mentioned <other_machine>, which failed.
- The "ping" command failed.
Now the problem is solved by setting the permissions of "/etc/nsswitch.conf" to:
Thanks again for your support
-rw-r--r-- 1 root root 1696 Jan 3 2012 /etc/nsswitch.conf