Subject: Re: /etc/hosts and DNS
To: Tim Jakobsen <tja@jakobsen.vg>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 01/14/2005 18:48:20
    Date:        Fri, 14 Jan 2005 12:07:38 +0100
    From:        Tim Jakobsen <tja@jakobsen.vg>
    Message-ID:  <20050114110738.GD417@emperor.jakobsen.vg>

  | Now I'd expect the command host somehost to return the ipaddress to me
  | but instead it tries to use the resolver

Yes, the "host" command is specifically a DNS query tool.   It always
queries the DNS, even if your nsswitch.conf says not to use the DNS at
all (as do dig, and nslookup).

That shouldn't affect any "normal" command - they should see the name
in /etc/hosts just fine (but note, you almost certainly don't want the
trailing "." on it, unless you plan on "ssh somehost." rather than the
"ssh somehost" you're probably intending.

  | Anyone that can tell me why it seems like netbsd disregards the
  | /etc/hosts after boot ?

It doesn't.

kre