Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2008 10:50:19 +0700 (ICT)
From:      Olivier Nicole <on@cs.ait.ac.th>
To:        freebsd-questions@freebsd.org
Subject:   Re: /etc/hosts not working
Message-ID:  <200809120350.m8C3oJfx070824@banyan.cs.ait.ac.th>
In-Reply-To: <20080912034117.GA48495@shepherd> (message from Sahil Tandon on Thu, 11 Sep 2008 23:41:17 -0400)
References:  <200809112249.05138.naylor.b.david@gmail.com> <20080912034117.GA48495@shepherd>

next in thread | previous in thread | raw e-mail | index | archive | help
> `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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809120350.m8C3oJfx070824>