public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Grant Taylor <gtaylor@gentoo.tnetconsulting.net>
To: gentoo-user@lists.gentoo.org
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: Thu, 11 Mar 2021 10:04:50 -0700	[thread overview]
Message-ID: <f4607a94-07fa-de41-affe-d051d0015753@spamtrap.tnetconsulting.net> (raw)
In-Reply-To: <2405026.4XsnlVU6TS@lenovo.localdomain>

On 3/11/21 6:38 AM, Michael wrote:
> The syntax is:
> 
> IP_address canonical_hostname [aliases...]

The man page for hosts has the following to say:

> DESCRIPTION
> This  manual  page  describes  the format of the /etc/hosts file. 
> This file is a simple text file that associates IP addresses with 
> hostnames, one line per IP address.  For each host a single line 
> should be present with the following information:
> 
>      IP_address canonical_hostname [aliases...]
> 
> The IP address can conform to either IPv4 or IPv6.  Fields of the 
> entry are separated by any number of blanks and/or tab characters. 
> Text from a "#" character until the end of the line is a comment, and 
> is ignored.  Host names may contain only alphanumeric characters, minus 
> signs ("-"), and periods (".").  They must begin with an alphabetic 
> character and end with an alphanumeric character.  Optional aliases 
> provide for name changes, alternate spellings, shorter hostnames, 
> or generic hostnames (for example, localhost).  If required, a host 
> may have two separate entries in this file; one for each version of 
> the Internet Protocol (IPv4 and IPv6).

I want to call out "For /each/ /host/ a *single* *line* should be 
present" and "a host /may/ /have/ *two* /separate/ /entries/ in this 
file; *one* /for/ /each/ /version/ /of/ /the/ /Internet/ /Protocol/".

I interpret this to mean that any given host name (alias or canonical) 
should appear on at most one line per protocol family.

As such, having the local host's name, qualified or not, appear on 
multiple lines for the same protocol is contrary to what the man page 
states.



-- 
Grant. . . .
unix || die


  parent reply	other threads:[~2021-03-11 17:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 22:23 [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
2021-02-22  6:20 ` Andrew Udvare
2021-02-25  2:37 ` Peter Humphrey
2021-02-25  2:50   ` Grant Taylor
2021-02-25  7:02     ` Arve Barsnes
2021-02-25  7:33       ` Grant Taylor
2021-03-10  5:09 ` Grant Taylor
2021-03-10 13:27   ` Mark Knecht
2021-03-10 15:25     ` Michael
2021-03-10 16:00       ` Mark Knecht
2021-03-10 16:38         ` Michael
2021-03-10 17:07           ` Grant Taylor
2021-03-10 17:01         ` Grant Taylor
2021-03-10 16:58       ` Grant Taylor
2021-03-11 13:38         ` Michael
2021-03-11 16:50           ` Grant Taylor
2021-03-12 19:04             ` Michael
2021-03-13 19:01               ` Grant Taylor
2021-03-16 12:16                 ` Michael
2021-03-16 12:33                   ` Peter Humphrey
2021-03-16 18:54                   ` Grant Taylor
2021-03-11 17:04           ` Grant Taylor [this message]
2021-03-10 16:44     ` Grant Taylor
2021-03-10 17:43       ` Mark Knecht
2021-03-10 18:37         ` Grant Taylor
2021-03-11 10:54           ` Wols Lists

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4607a94-07fa-de41-affe-d051d0015753@spamtrap.tnetconsulting.net \
    --to=gtaylor@gentoo.tnetconsulting.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox