Bug 208279 - hosts man page inaccurately states "For each host a single line should be present" while there can be 2 lines, IPv4 and IPv6
Summary: hosts man page inaccurately states "For each host a single line should be pre...
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
Depends on:
Reported: 2020-06-22 10:55 UTC by Jernej Jakob
Modified: 2020-06-30 07:48 UTC (History)
1 user (show)

See Also:
Kernel Version:
Tree: Mainline
Regression: No


Description Jernej Jakob 2020-06-22 10:55:27 UTC
A single hostname can have 2 lines, one for IPv4 and one for IPv6. The man page should be updated to reflect that.
Comment 1 Michael Kerrisk 2020-06-30 07:48:03 UTC
I think this report has been addressed by the following patch from Thomas Bartelsmeier, so I'm closing this.

diff --git a/man5/hosts.5 b/man5/hosts.5
index cb055f5f6..1230f9303 100644
--- a/man5/hosts.5
+++ b/man5/hosts.5
@@ -42,6 +42,7 @@ 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
@@ -53,6 +54,8 @@ alphabetic character and end with an alphanumeric character.
 Optional aliases provide for name changes, alternate spellings,
 shorter hostnames, or generic hostnames (for example,
 .IR localhost ).
+If required, a host may have two separate entries in this file;
+one for each version of the Internet Protocol (IPv4 and IPv6).
 The Berkeley Internet Name Domain (BIND) Server implements the
 Internet name server for UNIX systems.

Note You need to log in before you can comment on or make changes to this bug.