Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 12:21:57 -0500
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        "Roberto Nunnari" <nunnari@die.supsi.ch>, "freebsd-current" <freebsd-current@freebsd.org>
Subject:   Re: /etc/hosts completely ignored
Message-ID:  <066101c3253d$a4dfa9a0$13fd2fd8@Admin02>
References:  <3ED4E9CA.8000309@die.supsi.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Roberto Nunnari" <nunnari@die.supsi.ch>
> -bash-2.05b# cat /etc/hosts
> 127.0.0.1               localhost.noonlights.net localhost
> 192.168.1.5             jupiter.noonlights.net jupiter
> 192.168.1.5             jupiter.noonlights.net.
> 193.5.56.6              www.freebsd.org myfreebsd
>
> note the wrong IP for www.freebsd.org!! just for testing purposes!

>
> -bash-2.05b# cat /etc/host.conf
> hosts
> bind
>
>

> -bash-2.05b# host localhost
> Host not found.
>
> -bash-2.05b# host localhost.noonlights.net
> Host not found.
>

> See? /etc/hosts is completely ignored..
>
> If I missed something, I'd be grateful if somebody could
> let me know... for I'm new to /etc/nsswitch.conf.. but after
> reading the manpage I have no clue left.. just an idea that
> is a bug..
>
I get the same results on 4-STABLE with the "host" command.  Looking at the
host man pages, it states host does the lookups using domain servers.

        host - look up host names using domain server

Try ping, telnet, ftp, or ssh, as they should consult the hosts table before
checking with a domain servers.

Scot



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?066101c3253d$a4dfa9a0$13fd2fd8>