Bug 1478453 - NetworkManager changes FQDN rhv host to 'localhost.localdomain'
NetworkManager changes FQDN rhv host to 'localhost.localdomain'
Status: CLOSED DUPLICATE of bug 1419906
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Francesco Giudici
Desktop QE
Depends On:
Blocks: 1475943
  Show dependency treegraph
Reported: 2017-08-04 11:06 EDT by Bill Sanford
Modified: 2017-08-16 09:32 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-16 09:32:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
The messages file on the rhv-m host (406.80 KB, text/plain)
2017-08-04 11:06 EDT, Bill Sanford
no flags Details

  None (edit)
Description Bill Sanford 2017-08-04 11:06:25 EDT
Created attachment 1309101 [details]
The messages file on the rhv-m host

Description of problem:
Installing RHEL 7.4 for RHV host results in NetworkManager changing the FQDN to 'localhost.localdomain'

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

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:
Comment 2 Francesco Giudici 2017-08-08 12:52:14 EDT
(In reply to Bill Sanford from comment #0)
> Created attachment 1309101 [details]
> The messages file on the rhv-m host
> Description of problem:
> Installing RHEL 7.4 for RHV host results in NetworkManager changing the FQDN
> to 'localhost.localdomain'

As shown in the log, NetworkManager start and activates connection "enp30s0".
The IP address is taken from a dhcp server, but no hostname is provided in the offer.
When this happens, if no static hostname is provided, NetworkManager will try to do a reverse lookup on the ip received (if the connection provides also a default gateway). In this case it is exactly what happens: the hostname "corrin.spice.ml2.eng.bos.redhat.com" is retrieved by reverse lookup and
set as the transient hostname by NetworkManager.

Later, the "enp30s0" connection is deleted: NetworkManager will then kill the associated dhcp client and reset the transient hostname to the one it was before (was unset, so it is reset to localhost.localdomain).
A new connection "System enp30s0" is created on the same device but with "NM_CONTROLLED=no", so NetworkManager will no more take care of starting the dhcp nor to do the reverse lookup to update the hostname.

This is the expected NetworkManager behavior.

Note that also if NetworkManager would not reset the hostname, after the first reboot the hostname would be back to localhost, and no one would provide the update via reverse lookup.
The hostname retrieval via reverse lookup can be disabled by adding "hostname-mode=dhcp" in the NetworkManager configuration file.

I cannot see any flaw in NetworkManager behavior, I think this issue is already tracked in RHEV bug 1419906.
While waiting for it, a workaround would be to set a static hostname on the host. Once a static hostname is set it will not be updated by transient ones and will also survive reboot.
Comment 3 Francesco Giudici 2017-08-11 10:08:32 EDT
Hi Bill,
  I would advice to stay tuned on bug 1419906 and in the meanwhile assign a static hostname to your host to workaround the issue.
Please let me know if there is something you would like NetworkManager to do different or if you want for any reason keep this open maybe changing the component... otherwise I'm going to close this bug.
Thank you.
Comment 4 Bill Sanford 2017-08-16 09:32:32 EDT

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

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