/etc/hosts contents

Bob Leigh bobleigh at twomeeps.com
Tue Jul 31 06:07:02 PDT 2007


Chaz Gilbert <chaz_meister_rock at yahoo.com> wrote:
> i've got a 3.9 server behind NAT.  what should my
> /etc/hosts file look like?  i thought i had this
> configured properly, but if i run:
> 
> $ lynx localhost
> i get a 404
> 
> $ lynx 127.0.0.1
> works as expected.

I have this in /etc/hosts:

    ::1 localhost.local localhost
    127.0.0.1 localhost.local localhost

plus a similar 2 lines for "bull.local" (the system's idea of its own name).

Make sure you also have /etc/resolv.conf set up with a valid DNS server,
and also containing this:

    lookup file bind

so that /etc/hosts will (usually) be used before trying a DNS lookup.

-- 
Bob Leigh	bobleigh at twomeeps.com


More information about the Openbsd-newbies mailing list