Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
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 16:39:24
Message-Id: 3035421.5fSG56mABF@lenovo.localdomain
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 Mark Knecht
1 On Wednesday, 10 March 2021 16:00:19 GMT Mark Knecht wrote:
2 > <SNIP>
3 >
4 > > mark@science:~$ cat /etc/hosts
5 > > 127.0.0.1 localhost
6 > > 127.0.1.1 science
7 >
8 > <SNIP>
9 > <SNIP
10 > I think this is relevant to DNS resolution of/with domain controllers and
11 > may
12 > depend on the AD/DC topology. The idea is to use the LAN address of the box
13 > as the first address in /etc/hosts and use 127.0.0.1 as the second address
14 > in
15 > the file. If more AD/DNS servers exist in the network, then 127.0.0.1 could
16 > be even further down the list.
17 >
18 > https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-se
19 > rver-2008-R2-and-2008/ff807362(v=ws.10)?redirectedfrom=MSDN
20 >
21 > I haven't over-thought this and there may be more to it, but on a pure linux
22 > environment I expect this would not be a requirement, hence the handbook
23 > approach.
24 > <SNIP>
25 >
26 > It could very well be but I have vague memories when I first started
27 > getting
28 > interested in Linux, circa 1996-97 with Redhat, that I would buy books that
29 > liberally sprinkled http://localhost or ping localhost sorts of lines in
30 > the text and
31 > examples.
32 >
33 > My undocumented (and unsupported by data) opinion is that this localhost
34 > thing has been around a long, long time - possibly longer than Linux for
35 > all I know. Check out
36 >
37 > http://acme.com
38 >
39 > I have no real admin experience with any version of Windows. Even though
40 > I wrote, published and made a tiny bit of money selling a Windows program
41 > written in Turbo Pascal in those days I didn't even have networking.
42 > Everything was passed around on floppies.
43
44 I always thought the localhost class A addresses were from days of old 'inter-
45 network' era. The difference with 127.0.0.1 and a private LAN address is the
46 127.0.0.1 does not reach the data link layer, but loops-back at IP layer 3 and
47 responds to any applications on the local PC. So, I understood this to mean
48 it never went through the whole network stack, as it does when you ping a
49 remote host.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Why do we add the local host name to the 127.0.0.1 / ::1 entry in the /etc/hosts file? Grant Taylor <gtaylor@×××××××××××××××××××××.net>