/etc/hosts not working

Olivier Nicole on at cs.ait.ac.th
Fri Sep 12 03:50:24 UTC 2008


> `ping google.com' actually pings 127.0.0.1 but `host google' returns 
> the actual IP addresses for google.  

ping will resolve the name using the mecanism defined in
/etc/nsswitch.conf, usually:

   hosts: files dns nis

try first /etc/hosts, then DNS, then NIS

But host(1) command is designed to query DNS exclusively.

Hence the different recults.

Olivier


More information about the freebsd-questions mailing list