RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1980395 - systemd-resolve of own ip address is short uniquely
Summary: systemd-resolve of own ip address is short uniquely
Keywords:
Status: CLOSED DUPLICATE of bug 1739689
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Jacek Migacz
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-08 14:48 UTC by Steve Traylen
Modified: 2022-03-17 15:50 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-17 15:49:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Steve Traylen 2021-07-08 14:48:48 UTC
Description of problem:


systemd-resolve 10.0.0.1

returns long hosts names with the exception of the nodes own ip address
which returns a short hostname.

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

systemd-239-48.el8.x86_64

How reproducible:

Every time

Steps to Reproduce:
1.  systemctl start systemd-resolved
2.  systemd-resolve $(hostname -i)


Actual results:

A short hostname is returned e.g 'bag8' 


2002:1448:d10:3f::100:3c4%eth0: bag8

-- Information acquired via protocol LLMNR/IPv6 in 1.8ms.
-- Data is authenticated: yes
187.184.84.112%eth0: bag8

-- Information acquired via protocol LLMNR/IPv4 in 762us.
-- Data is authenticated: yes



Expected results:

The long hostname is returned e.g. 'bag8.mydomain'


Additional info:

As commented this is only for the ip of the machine. When you run it
the lookup for any other ip address in the world including machines
in the same dns domain then the long name is returned.

This results in weirdness like this in python for instance.

python 3.6.8 (default, May  8 2021, 09:11:34) 
[GCC 8.4.1 20210423 (Red Hat 8.4.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getfqdn()
'bag8'
>>> socket.gethostname()
'bag8.mydomain'


For completeness on this node

hostname 

is returning the full name.

I also tested a fedora rawhide node and this does behave itself
so I assume something fixed in systemd at some point.

Below full names are returned.


[root@rawhide ~]# systemd-resolve $(hostname -i)
fe80::f816:3eff:feb3:2db9%2: rawhide.mydomain.ch   -- link: eth0
                             rawhide           -- link: eth0
                             rawhide.local     -- link: eth0

-- Information acquired via protocol DNS in 118.3ms.
-- Data is authenticated: yes; Data was acquired via local or encrypted transport: yes                                                          
-- Data from: synthetic
2002:1558:d01:59::100:22c: rawhide.ipv6.mydomain.ch -- link: eth0

-- Information acquired via protocol DNS in 1.4ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no                                                            
-- Data from: network
188.18.121.31: rawhide.mydomain.ch                -- link: eth0

-- Information acquired via protocol DNS in 990us.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no                                                            
-- Data from: network

Comment 1 Steve Traylen 2021-07-08 17:27:48 UTC
Did try to check if anything changed with the situation in the CentOS stream 9 snapshot but could not find the systemd-resolved package.

Comment 2 Steve Traylen 2021-10-13 09:15:52 UTC
As a workaround adding

2002:1448:d10:3f::100:3c4 bag8.example.org
187.184.84.112 bag8.example.org

to /etc/hosts just avoids the problem by avoiding the systemd-resolvd lookup for the configured ip address.

Not ideal for a DHCP configured box where /etc/hosts is configured with the local hostname.

Comment 3 Steve Traylen 2021-11-15 10:43:58 UTC
Can confirm now that C9 and https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20211111.1.x86_64.qcow2 this problem is fixed.

Comment 4 David Tardon 2022-03-17 15:49:58 UTC

*** This bug has been marked as a duplicate of bug 1739689 ***


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