Discussion:
/usr/bin/host localhost
Petar Bogdanovic
2014-10-07 20:58:06 UTC
Permalink
Hi,

while moving from 6.0.5_PATCH to 6.0.6_PATCH and from 2014Q2 to 2014Q3
I noticed this:

$ host localhost
Host localhost not found: 3(NXDOMAIN)

I can't resolve localhost with `host' and `pkg_add' while `ping',
`telnet' and `ftp' seem to honor /etc/hosts.

Both /etc/hosts and /etc/nsswitch.conf are untouched copies from cvs.

When installing packages, I usually do

$ PKG_PATH=http://localhost/(...) pkg_add (...)

and that's how I actually noticed this. Therefore I'm not 100% sure if
`host' was always behaving like that.

Thanks,

Petar Bogdanovic
Michael van Elst
2014-10-08 00:23:10 UTC
Permalink
Post by Petar Bogdanovic
$ host localhost
Host localhost not found: 3(NXDOMAIN)
and that's how I actually noticed this. Therefore I'm not 100% sure if
`host' was always behaving like that.
'host' is a DNS tool, it does nameserver queries.

On some other systems, 'host' also knows how to resolve names
from other sources like /etc/hosts, but on most it does not.

There is the command 'getent' that can be used to query the
nameservice databases. It will do the same kind of lookup
that is used by ping, telnet, ssh, etc..
Petar Bogdanovic
2014-10-08 08:16:22 UTC
Permalink
Post by Michael van Elst
'host' is a DNS tool, it does nameserver queries.
Oh, thanks, that never occurred to me even though it being part of
external/bsd/bind is a strong indicator.

What still confuses me is this:

# PKG_PATH=http://localhost/(...)/All pkg_add libmilter
pkg_add: Can't process http://localhost:80/(...)/All/libmilter*: Host not found
pkg_add: no pkg found for 'libmilter', sorry.
pkg_add: 1 package addition failed

This is something I've been doing every few months for at least two
years and I always use the exact same line from HISTFILE..

Loading...