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

Reply via email to