/etc/hosts resolving before DNS resolving ?
I am running RED HAT 8.
I have 2 ethernet interfaces.
-1 eth interface is a DHCP client (and gets IP + DNS entries via DHCP). This interface is connected to an antranet with DNS servers on.
-1 eth interface has a static ip address. This interface is connected to a small LAN
In /etc/hosts, I created some entries that make part of the LAN that is connected to the static interface :
when I do : ping server2
I notice that the RED HAT sends out a DNS request via the DHCP interface.
Off course there is no reply from that server.
then I got reply message from 127.0.0.1 !!!
I see that no ping request goes out on my static eth interface !!
So, I have following questions :
1. Why does the RED HAT does not look in my /etc/hosts file ?
2. Is there a possibility to first look in /etc/hosts before sending a DNS request ?