Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2000 16:53:45 +0100
From:      cam (Camille HUOT) <cam@bsdfr.org>
To:        Tim Ayers <tayers@bridge.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: /etc/hosts and including domains
Message-ID:  <20001222165345.1b395da9.cam@bsdfr.org>
In-Reply-To: <8zp835yf.fsf@tim.bridge.com>
References:  <8zp835yf.fsf@tim.bridge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 22 Dec 2000 08:07:20 -0600
Tim Ayers <tayers@bridge.com> wrote:

> I am curious about the default contents of /etc/hosts. Right after I
> install FreeBSD-4.1.1, I look in /etc/hosts and it contains something
> like
> 
>   127.0.0.1               localhost
>   192.168.196.2           janis.quaday.com janis
>   192.168.196.2           janis.quaday.com.
> 
> I understand the localhost line. But I don't know the reasoning for
> including "janis.quaday.com". Is the domain defined explicitly
> anywhere when using DNS or is this (and the hostname= line in
> /etc/rc.conf) the place where my domain is specified?
> 
> And I really don't understand what the "janis.quaday.com." is
> doing. Why have the name including DNS 'root'? And why on a separate
> line instead of just another alias on the same line?
> 
> Finally, what's the correct way to add the other local hosts to my
> /etc/hosts? Like
> 
>   192.168.196.3           joan
> 
> or
> 
>   192.168.196.3           joan.quaday.com joan
> 
> Thanks for the enlightenment. Now back to figuring out my real
> problems. ;-)
> 
> Hope you have a very nice day, :-)
> Tim Ayers (tayers@bridge.com)

this file describe some kind of "shortcuts" to hosts. you can put a line like this
10.1.1.2  joe
for example and do "ssh joe" instead of doing "ssh pcjoe.quaday.com"

this file is less important when you have a dns server on your machine, but not all
people have it, and since the /etc/hosts file is read *before* doing a dns request
(you can change it), it is fast.

on a simple line you have to put 1 IP address, then as many names you want, 
in the default file, the system put
192.168.196.3           joan.quaday.com joan
to bypass the dns procedure. (faster)

I advise you to fill this file with the hosts you often contact to go faster
just be careful that their IP address don't change ...


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?20001222165345.1b395da9.cam>