Ubuntu – /etc/hosts file not being used before DNS server query

dnshosts

I have upgraded to Ubuntu 12.10 and I have made entries in /etc/hosts, but instead of looking into the hosts file, queries to my configured DNS server are being made first.

How can I make Ubuntu query the /etc/hosts file first?

Thanks.

Best Answer

Turns out I am a massive buffoon;

The host command just seems to ignore the /etc/hosts file and perform queries against your configured DNS servers directly. If I ping www.somesite.com I am using my /etc/hosts file entry, and after installing wireshark I can see that chrome is too.

Hope that helps someone!