Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
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?
Date: Wed, 10 Mar 2021 17:07:16
Message-Id: f6093b54-465d-5921-9a0a-87a2fc12f1d5@spamtrap.tnetconsulting.net
In Reply to: Re: [gentoo-user] Why do we add the local host name to the 127.0.0.1 / ::1 entry in the /etc/hosts file? by Michael
1 On 3/10/21 9:38 AM, Michael wrote:
2 > I always thought the localhost class A addresses were from days of old
3 > 'inter- network' era. The difference with 127.0.0.1 and a private
4 > LAN address is the 127.0.0.1 does not reach the data link layer,
5 > but loops-back at IP layer 3 and responds to any applications on the
6 > local PC. So, I understood this to mean it never went through the
7 > whole network stack, as it does when you ping a remote host.
8
9 The 127/8 (formerly called a class A) network is reserved / allocated
10 for a host to communicate with itself.
11
12 However, /how/ local addresses are used is entirely implementation
13 specific. This goes for both 127.0.0.1 and other addresses bound to
14 local network cards.
15
16 Linux will not send traffic to the local LAN IP to the NIC either. But
17 that's a /Linux/ /implementation/ detail. Other OSs, e.g. Windows,
18 don't use a loopback adapter for 127.0.0.1. Instead it's purely a
19 software construct. But that's a /Windows/ /implementation/ detail.
20
21 Aside: Windows (2k and onward) does have a loopback adapter that you
22 can optionally install. However you /can't/ assign 127.0.0.1 (or any
23 127/8) to it. It is meant to be used like Linux uses the dummy adapter.
24
25
26
27 --
28 Grant. . . .
29 unix || die