Re: hostname-mode=default and hostname set outside NM



On 4/22/20 8:18 PM, Thomas HUMMEL wrote:
Hello,

using NetworkManager-1.20.0-5.el8_1.x86_64 on CentOS 8.1 I tried to figure out the hostname-mode semantics beyond what the manual says (I've got another thread for this but somehow unrelated to the following question).
What's not clear to me is : what if the transient hostname is changed outside NetworkManager after hostname-original gets read at NM start ? Let's say someone issues hostname foobar (instead of hostnamctl --transient set-hostname foobar) while the DHCP connection is still up : would that become the new set-out-of-NM hostname wich would be restored when the connection is deactivated ?
Technically NM could notice it directly issuing gethostname(3) but my 
understanding is that it would rather rely on systemd-hostnamed/dbus for 
that. The latter seems to have in some cases some delay to catch up with 
transient hostanme.
On a related subjet :

I notices that

hostnamectl --static set-hostname <newhostname>

behavior was not the same according to the value of hostname-mode setting :

- if set to 'none' : there's a delay for the transient hostname to be automatically set to the manually set static one
- if set to 'dhcp' : the transient hostname is instantly aligned with 
the new static one.
Is this expected ?

Thanks

--
TH


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]