From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E97C71382C5 for ; Wed, 10 Mar 2021 13:27:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A0FD8E083B; Wed, 10 Mar 2021 13:27:37 +0000 (UTC) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 50F55E07AE for ; Wed, 10 Mar 2021 13:27:37 +0000 (UTC) Received: by mail-qt1-x834.google.com with SMTP id 18so12949582qty.3 for ; Wed, 10 Mar 2021 05:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=VvG1rBzJtFoDkyqz/oFhXD8Y4X9B8mxfcYx9Sx8v2D4=; b=hwX2g6GQiBOvldv42AcRSYWj7ZSIHnkspvegi1y0rPlzBswTIVv/xjV4dJ/hnpuvII gAhuIyxlz07W9nqJXl57qR+/jFzO4GjUeLAHmnGapryYEWykuR43dcnf3lP0WumI8iEn CfW3GD4uni8aizoPh0i1ZlXYcLwLAOFIwpnyvTUQsRV6xxoGnFoBxBv8t/Xzlic7N6nS oLv6i7ZyLXhDKUoRZq7WBwIAjiDboxUj0OdT+hubckF+u1pPXgIP4bq8tBv/zMmt0dC7 KUFGNF+cEb7GSmnmhlk+MT3rSoTp09aOK6hniz8pJh0IIykzv8Dj0IgYAIkMM1bxTV2z K5sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=VvG1rBzJtFoDkyqz/oFhXD8Y4X9B8mxfcYx9Sx8v2D4=; b=d/Dc5W+yaspH8cJr+tHIBMYgAMrMIK1EGcHuxAsaKsCszwyXd7Ke2bYXVDrrCmbB9K fajLkBrQFzkZuJyKaMPgQeOFirlC5zi6VYpvSW0bV1fmmo74UvRNP7qMlDqtk2B9/I6q tX/ofMykApu6UJnhIqUnDISqfIG5dKpU1xKZ24JO3WSXfQs+eENYJNpHnuZn6wmo/lyl p2GniqmDAI33CJZ02Md5+jLrdDjzXUGIDVDHG37gI2sMtL1ODmZF7yovcwoyLkT2Yw2Y 0gXf87E/hP5ZFpm5n6exP4pp0/NqQl86zhUwxz6AUMnKc9nIIp7Xi0lAJLjmrOF5o8uI warg== X-Gm-Message-State: AOAM530Yw+bknzVCuW6D5apAAUpgFPisrRmhT3uBCuQQrXkDpJOtRytp UYDfX+YqL3VojQFn6CDkiSu4ujUZpHk+CMro1QoW2EdXwoQahw== X-Google-Smtp-Source: ABdhPJyILv0dx4pm5T7e+eVTmM62ZOFsma4mL57rPasstwQAG64tUpGF38GE4Rpk8bpodw+VhvyPxt2FfejGv3JEIlI= X-Received: by 2002:ac8:6b57:: with SMTP id x23mr2526275qts.278.1615382855876; Wed, 10 Mar 2021 05:27:35 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <65049b74-842b-0211-bbfe-35607c279a75@spamtrap.tnetconsulting.net> <3670ec37-c1ba-2351-9999-11f7ef1917dc@spamtrap.tnetconsulting.net> In-Reply-To: <3670ec37-c1ba-2351-9999-11f7ef1917dc@spamtrap.tnetconsulting.net> From: Mark Knecht Date: Wed, 10 Mar 2021 06:27:24 -0700 Message-ID: Subject: Re: [gentoo-user] Why do we add the local host name to the 127.0.0.1 / ::1 entry in the /etc/hosts file? To: Gentoo User Content-Type: multipart/alternative; boundary="0000000000004d05ab05bd2ea176" X-Archives-Salt: ec1f8047-368e-4dbb-947e-e7c7e2347369 X-Archives-Hash: 5527d618482a66a31d112b814f39644d --0000000000004d05ab05bd2ea176 Content-Type: text/plain; charset="UTF-8" On Tue, Mar 9, 2021 at 10:10 PM Grant Taylor < gtaylor@gentoo.tnetconsulting.net> wrote: > > On 2/21/21 3:23 PM, Grant Taylor wrote: > > Will someone please explain why the Gentoo AMD64 Handbook ~> Gentoo (at > > large) says to add the local host name to the 127.0.0.1 (or ::1) entry > > in the /etc/hosts file? What was the thought process behind that? > > Shameless Bump -- I'm still interested in understanding the logic > behind the choice in the Gentoo Handbook. > > Additional information. > > The Samba Wiki states the following in the Preparing the Installation > section of the Setting up Samba as an Active Directory Domain Controller > document. > > "The host name and FQDN must not resolve to the 127.0.0.1 IP address or > any other IP address than the one used on the LAN interface of the DC." > > Link - Setting up Samba as an Active Directory Domain Controller - > Preparing the Installation > - > https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller#Preparing_the_Installation > AND [quote] I'm reading Kerberos - The Definitive Guide[1] and it makes the following comment: > And to make matters worse, some Unix systems map their own hostname > to 127.0.0.1 (the loopback IP address). [/quote] Caveat - not an expert, just my meager understanding: 1) The name 'localhost' is historically for developers who want to access their own machine _without_ using DNS. 2) By general practice sometime in the deep, dark times 127.0.0.1 was accepted for this purpose. There's nothing special about the address. 3) I read the original quoted comment in the Kerberos Guide as a warning - 'to make matters worse, __SOME__" 4) In my /etc/hosts I do _NOT_ map my machine's name to the same address as localhost, avoiding the Kerberos warning: mark@science:~$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 science # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters mark@science:~$ ping localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms mark@science:~$ ping science PING science (127.0.1.1) 56(84) bytes of data. 64 bytes from science (127.0.1.1): icmp_seq=1 ttl=64 time=0.032 ms mark@science:~$ hostname science mark@science:~$ hostname -I 192.168.86.42 mark@science:~$ hostname -A science.lan mark@science:~$ hostname -f science mark@science:~$ hostname -i 127.0.1.1 mark@science:~$ --0000000000004d05ab05bd2ea176 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Mar 9, 2021 at 10:10 PM Grant Taylor <<= a href=3D"mailto:gtaylor@gentoo.tnetconsulting.net">gtaylor@gentoo.tnetcons= ulting.net> wrote:
>
> On 2/21/21 3:23 PM, Grant Taylor = wrote:
> > Will someone please explain why the Gentoo AMD64 Handbo= ok ~> Gentoo (at
> > large) says to add the local host name to = the 127.0.0.1 (or ::1) entry
> > in the /etc/hosts file?=C2=A0 Wha= t was the thought process behind that?
>
> Shameless Bump =C2= =A0-- =C2=A0I'm still interested in understanding the logic
> beh= ind the choice in the Gentoo Handbook.
>
> Additional informati= on.
>
> The Samba Wiki states the following in the Preparing th= e Installation
> section of the Setting up Samba as an Active Directo= ry Domain Controller
> document.
>
> "The host name = and FQDN must not resolve to the 127.0.0.1 IP address or
> any other = IP address than the one used on the LAN interface of the DC."
><= br>> Link - Setting up Samba as an Active Directory Domain Controller -<= br>> Preparing the Installation
> =C2=A0 -
> https://wiki.samba.org/index.php/Se= tting_up_Samba_as_an_Active_Directory_Domain_Controller#Preparing_the_Insta= llation
>

AND

[quote]
<= div>I'm reading Kerberos - The Definitive Guide[1] and it makes the
= following comment:

> And to make matters worse, some Unix systems= map their own hostname
> to 127.0.0.1 (the loopback IP address).
=
[/quote]

Caveat - not an expert, just m= y meager understanding:

1) The name 'localhost= ' is historically for developers who want to access their own machine _= without_ using DNS.=C2=A0

2) By general practice s= ometime in the deep, dark times 127.0.0.1 was accepted for this purpose. Th= ere's nothing special about the address.

3) I = read the original quoted comment in the Kerberos Guide as a warning - '= to make matters worse, __SOME__"

4) In my /et= c/hosts I do _NOT_ map my machine's name to the same address as localho= st, avoiding the Kerberos warning:

mark@science:~$ cat /etc/hosts
127.0.0.1 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0localhost
127.0.1.1 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0science

# The following lines are desirable for IPv6 capable hosts
::1 =C2=A0=C2=A0=C2=A0=C2=A0ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

mark@science:~$ ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=3D1 ttl=3D64 time=3D0.032= ms

<= /div>
mark@science:~<= span style=3D"color:rgb(0,0,0)">$ ping science
PING science (127.0.1.1) 56(84) bytes of data.
64 bytes from science (127.0.1.1): icmp_seq=3D1 ttl=3D64 time=3D0.032 m= s

mark@science:~$ hostname
science
mark@science:~$ hostname -= I
192.168.86.42 =C2=A0
mark@science:<= span style=3D"font-weight:bold;color:rgb(84,84,255)">~
$ hostname -A
science.lan =C2=A0
mark@science:~$ hostname -f
science
mark@science:~$ hostname -= i
127.0.1.1
mark@science:~$
=
--0000000000004d05ab05bd2ea176--