/etc/hosts completely ignored

Scot W. Hetzel hetzels at westbend.net
Wed May 28 10:22:06 PDT 2003


From: "Roberto Nunnari" <nunnari at 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



More information about the freebsd-current mailing list