Bug 1478453

Summary: NetworkManager changes FQDN rhv host to 'localhost.localdomain'
Product: Red Hat Enterprise Linux 7 Reporter: Bill Sanford <bsanford>
Component: NetworkManagerAssignee: Francesco Giudici <fgiudici>
Status: CLOSED DUPLICATE QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: aloughla, astepano, atragler, bgalvani, bsanford, djasa, fgiudici, lrintel, rduda, rkhan, sukulkar, thaller, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-16 13:32:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1475943    
Attachments:
Description Flags
The messages file on the rhv-m host none

Description Bill Sanford 2017-08-04 15:06:25 UTC
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):
RHEL-7.4-20170727.1
rhv-4.1.5-1

How reproducible:
100%

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Francesco Giudici 2017-08-08 16:52:14 UTC
(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 14:08:32 UTC
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 13:32:32 UTC

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