Confused on how to properly set /etc/hosts

Darrin Chandler dwchandler at stilyagin.com
Sun Aug 6 13:51:36 UTC 2006


On Sun, Aug 06, 2006 at 09:24:59AM -0400, Ro BGCT wrote:
> 
> I am new to FreeBSD and am wondering if someone couldt tell me how to
> properly set /etc/hosts.  Right now it is:
> 
> 127.0.0.1 localhost localhost.my.domain
> 
> It says to replace "my.domain" with the domain name of my machine.  If
> I am using this box remotely and its hostname is "web1.server.net",
> would I make the change like:
> 
> 127.0.0.1 localhost web1.server.net
> 
> Or am I doing it wrong?

You should only replace the "my.domain" part with the 2nd level domain,
so it would be:

127.0.0.1 localhost localhost.server.net

You *may* also have an entry for web1, but it would normally contain
your assigned IP address:

10.10.10.115 web1 web1.server.net

But you may not want anything except localhost, depending on your DNS
setup. In fact, stick with localhost only until and unless you have a
reason to add more to /etc/hosts.

-- 
Darrin Chandler            |  Phoenix BSD Users Group
dwchandler at stilyagin.com   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |


More information about the freebsd-questions mailing list