name resolution puzzle

Matthew Seaman matthew at FreeBSD.org
Sat Aug 4 06:03:01 UTC 2018


On 03/08/2018 22:41, Valeri Galtsev wrote:
> So, it appears, that the commands "host" and "nslookup" go directly to
> DNS server, and do not look into /etc/hosts first which I have expected.


host(1), dig(1), delv(1), drill(1) and nslookup(1) are all specifically
tools for doing lookups in the DNS.  That's the only place they look.

If you want to replicate the full hostname resolution process using all
the facilities enabled in your nsswitch.conf, use getent(1) like so:

    getent hosts freefall.freebsd.org

	Cheers,

	Matthew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20180804/a367a15b/attachment.sig>


More information about the freebsd-questions mailing list