Bug 2246220 - /etc/hosts uses a real domain name as an example, and not a IANA special-use domain name
Summary: /etc/hosts uses a real domain name as an example, and not a IANA special-use ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: setup
Version: 38
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Martin Osvald 🛹
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-25 20:21 UTC by Jeffrey Walton
Modified: 2023-11-29 12:57 UTC (History)
5 users (show)

Fixed In Version: setup-2.14.5-1.fc40
Clone Of:
Environment:
Last Closed: 2023-11-29 12:57:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jeffrey Walton 2023-10-25 20:21:14 UTC
Hi Everyone,

This came up on a Debian mailing list, but it applies to Fedora. And perhaps Red Hat, too.

My /etc/hosts has the following entries and comments. I added the 127.0.1.1 entry manually.

   $ cat /etc/hosts
   # Loopback entries; do not change.
   # For historical reasons, localhost precedes localhost.localdomain:
   127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
   ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

   # 127.0.1.1 is often used for the FQDN of the machine
   127.0.1.1   skylake.home.arpa skylake

   # See hosts(5) for proper format and other examples:
   # 192.168.1.10 foo.mydomain.org foo
   # 192.168.1.13 bar.mydomain.org bar

The problem is, someone owns mydomain.org. It is a real domain.

   $ whois mydomain.org | grep -E 'Name|ID'
   Domain Name: mydomain.org
   Registry Domain ID: 43938f3b31594bc394234043672173ed-LROR
   Registrar IANA ID: 228
   ...

I believe it would be much better if Fedora's /etc/hosts template used example.{com|net|org}, or home.arpa. home.arpa is a recent addition (circa 2018) to IANA's special-use domains. Cf., <https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml>.

I would also suggest to add a comment to /etc/hosts that tells a reader to check IANA's document in addition to the documentation for hosts(5).

-----

This happened on Fedora 38, x86_64, fully patched.

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 38 (Thirty Eight)
Release:        38
Codename:       ThirtyEight

-----

And /etc/hosts belongs to setup-2.14.3-2.fc38 on this machine.

$ dnf whatprovides /etc/hosts
setup-2.14.3-2.fc38.noarch : A set of system configuration and setup files
Repo        : @System
Matched from:
Filename    : /etc/hosts

setup-2.14.3-2.fc38.noarch : A set of system configuration and setup files
Repo        : fedora
Matched from:
Filename    : /etc/hosts

Comment 1 Martin Osvald 🛹 2023-10-26 06:56:07 UTC
Thank you for reporting this problem and your suggestions!

Indeed, example.org instead of mydomain.org should be used. I took the examples directly from the hosts man page and at that time it still contained the mydomain.org there. I can see it is no longer the case:

https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man5/hosts.5?id=2cc1bc67f9aabbfb4ae8c7f6d3082a22bddd63ab

I will fix this in the upcoming setup version.

Comment 2 Jeffrey Walton 2023-10-26 09:30:11 UTC
Thanks Martin.

In case you are interested... www.opensource.org does not seem to be at 209.237.226.90. Or not according to nslookup from the eastern US. I would probably remove www.opensource.org from the example.

Comment 3 Fedora Update System 2023-11-29 11:17:47 UTC
FEDORA-2023-77891d238e has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-77891d238e

Comment 4 Fedora Update System 2023-11-29 12:57:48 UTC
FEDORA-2023-77891d238e has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


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