Bug 2222913 - systemd_myhostname returns ipv6 address for local host even when ipv6 is disabled
Summary: systemd_myhostname returns ipv6 address for local host even when ipv6 is disa...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.8
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: systemd maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-14 13:02 UTC by Carlos Santos
Modified: 2023-07-14 13:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-162380 0 None None None 2023-07-14 13:04:52 UTC

Description Carlos Santos 2023-07-14 13:02:41 UTC
Description of problem:

systemd_myhostname returns ipv6 address for local host even when ipv6 is
disabled

Version-Release number of selected component (if applicable):

glibc-2.28-225.el8.x86_64
systemd-libs-239-74.el8_8.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Disable IPv6

   # sysctl -w net.ipv6.conf.all.disable_ipv6=1

2. Set the host name to something *not* in /etc/hosts nor in DNS

   # hostnamectl set-hostname nowhere
   # hostname
   nowhere
   # hostname -f
   nowhere

3. Query the hosts database using the three services:

   # getent -s files hosts nowhere
   # getent -s dns hosts nowhere
   # getent -s myhostname hosts nowhere

Actual results:

   ::1             nowhere localhost

Expected results:

   The machine IPv4 address, e.g.

   192.168.122.71  nowhere

Additional info:

Same results are seen on RHEL 9. It should not return an IPv6 address with
net.ipv6.conf.all.disable_ipv6=1.

Repeating the same test on a fully updated RHEL 7.9, we get

   # getent -s myhostname hosts nowhere
   192.168.122.71  nowhere


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