From owner-freebsd-stable Mon May 13 15: 6:52 2002 Delivered-To: freebsd-stable@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id ABAAA37B407 for ; Mon, 13 May 2002 15:06:46 -0700 (PDT) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id g4DM6jw14064; Mon, 13 May 2002 15:06:45 -0700 Date: Mon, 13 May 2002 15:06:45 -0700 From: Brooks Davis To: "Philip J. Koenig" Cc: stable@FreeBSD.ORG Subject: Re: hosts file question Message-ID: <20020513150645.A10211@Odin.AC.HMC.Edu> References: <20020513214315231.AAA1067@empty1.ekahuna.com@pc02.ekahuna.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020513214315231.AAA1067@empty1.ekahuna.com@pc02.ekahuna.com>; from pjklist@ekahuna.com on Mon, May 13, 2002 at 02:43:14PM -0700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2002 at 02:43:14PM -0700, Philip J. Koenig wrote: >=20 > I'd like to clarify this. In upgrading a 4.3-Stable box yesterday, I=20 > noted that there seems to be conflicting info in the hosts file about=20 > how to format the localhost entry. >=20 > Stranger yet, the syntax for regular entries seems to be reversed=20 > from the localhost syntax. (ie the 'friendly name for localhost comes=20 > first in the template, last for regular hostnames?) >=20 >=20 > This is the template from 4.5/4.6-PR: >=20 > # ::1 localhost localhost.my.domain > # 127.0.0.1 localhost localhost.my.domain > # > # Imaginary network. > #10.0.0.2 myname.my.domain myname > #10.0.0.3 myfriend.my.domain myfriend =46rom personal experince I'd say this is the most likely to work. The issue is a large number of applications only look at the name field they get hack from gethost*() and ignore the aliases when doing host based auth of various sorts. As a result, the first entry should be your fqdn since that should be your hostname and thus be what gets passed around. The localhost entries are an exception because you don't really refer to localhost.domain very often and instead call it localhost which means you want that first. Failure to scan the hostent's h_aliases array is certaintly a bug, but that doesn't prevent it from being fairly common. :( -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --UugvWAfsgieZRqgk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE84DjyXY6L6fI4GtQRAl3oAKCo6tyFZOQP9jDzHZjLRjEBloPoZQCeOYF+ zcfnIOM/ZrHh/Hpt4/naoL8= =01KL -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message