hosts file seems to be ignored
With this configuration, most applications will happily work with your entry from
host doesn't look at
/etc/nsswitch.conf. That is by design, not by accident, since
host is specifically a DNS lookup program.
/etc/hosts is not DNS, it's (mostly) what we used before we had DNS.
The same is also true for
nslookup - they're DNS specific too.
host command (along with
nslookup) is part of the
bind DNS utilities. As a DNS resolver utility, it does DNS resolution alone.
If you're interested in fetching an entry from any
libnss-driven data store, you can use the
getent program. To get a hosts entry, for example, use it like this:
getent hosts google.com
This follows the resolution order set out under
/etc/nsswitch.conf in order, which includes
/etc/hosts if "files" is lised as one of the options.