Red Hat Bugzilla – Bug 1478453
NetworkManager changes FQDN rhv host to 'localhost.localdomain'
Last modified: 2017-08-16 09:32:32 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):
Steps to Reproduce:
(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.
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.
*** This bug has been marked as a duplicate of bug 1419906 ***