Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 2000 20:07:49 -0600
From:      Jeremy Falcon <jeremy@intersurf.com>
To:        cbooth@aixx.net
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /etc/host file?
Message-ID:  <00030920563402.00767@local.imputek.com>
References:  <Pine.LNX.4.10.10003091949310.1171-100000@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
The /etc/hosts file is there (it's separate from DNS) to basically
associate words with IPs.  If you want to ping your own box, you can use "ping
localhost" instead of "ping 127.0.0.1".

And, that's pretty much its job, it doesn't deal with your ISP unless you want
it to.  Typically, you'll find people using it for their networks.

Here's an application of /etc/hosts (making up the details)...

Let's say FooBar is your ISP and 223.153.80.10 is the IP for their web server. 
In /etc/hosts you could do this...

myisp	223.153.80.10

... and now, in your web browser type in http://myisp/ to get to their site
instead of using http://www.foobar.com/ or the IP.

Only loopback should be 127.0.0.1.  If FreeBSD associates your machine
itself with 127.0.0.1, I imagine that wouldn't be good.

You don't need a domain, unless you're on a network (LAN, WAN, etc.).  And, it
really doean't have to be *.com, *.net, *.org, etc.  For instance, you could
name your machine FBSD.Beats.Linux, and have Beats.Linux as the domain, while
FBSD is the machine name.  It's up to you.

If want to use a real domain, you can keep it local and not worry about
InterNIC.  So, your machine could be named www.microsoft.com, but if one of
your UNIX buddies saw that, they'd probably kill you.  :o)

If you don't want to bother with this, it's no big deal, but as a rule of thumb
just remember that only your loopback (localhost, lo0) should be 127.0.0.1

Good luck,

Jeremy L. Falcon

 > Thank you, Jeremy:
> 
> I will try that.
> 
> I thought that this is a deprecated solution, since my machine is not
> actually a part of my ISP's domain--my account is dynamic. Do I
> misunderstand?
> 
> Thank you again. I'll see if that works.
> 
> Christopher J. Booth
> cbooth@aixx.net
> 
> On Thu, 9 Mar 2000, Jeremy Falcon wrote:
> 
> > Is camelot the machine name?  If so, your loopback device should point to
> > 127.0.0.1, not your machine name.  Try this instead (in /etc/hosts)....
> > 
> > 127.0.0.1    localhost   localhost.example.com
> > 
> > ...where "example.com" is the domain you specified for the machine during the
> > installation.
> > 
> > This may or may not fix the problem, but at least it'll stop problems in other
> > areas.
> > 
> > Hope this helps,
> > 
> > Jeremy L. Falcon
> >


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00030920563402.00767>