From owner-freebsd-questions Fri Dec 22 8: 0:24 2000 From owner-freebsd-questions@FreeBSD.ORG Fri Dec 22 08:00:22 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mailhost.esil.univ-mrs.fr (jiyu.esil.univ-mrs.fr [139.124.44.249]) by hub.freebsd.org (Postfix) with ESMTP id 8DC2437B400 for ; Fri, 22 Dec 2000 08:00:21 -0800 (PST) Received: from fraternidad (cam@fraternidad.esil.univ-mrs.fr [139.124.21.253]) by mailhost.esil.univ-mrs.fr (8.9.3/ESIL/jtpda-5.3.1) with SMTP id QAA22134 ; Fri, 22 Dec 2000 16:53:46 +0100 (CET) Date: Fri, 22 Dec 2000 16:53:45 +0100 From: cam (Camille HUOT) To: Tim Ayers 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> X-Mailer: Sylpheed version 0.4.8 (GTK+ 1.2.8; Linux 2.2.14; i686) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22 Dec 2000 08:07:20 -0600 Tim Ayers 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