Am 25.01.2022 um 18:46 schrieb Thomas Cameron
<thomas.cameron(a)camerontech.com>:
I just did a fresh kickstart of F35 Server. I didn't do anything to set the hostname
during installation.
At first boot, I could see that the hostname was set to the reverse DNS-provided hostname
"hostxxx.tc.camerontech.com" - this is normal and expected.
When I log in via ssh or on the KVM console, the hostname is
hostxxx.tc.camerontech.com
UNITL I REBOOT.
Once I reboot, the hostname is set up "fedora" with no FQDN. I am assuming
it's somehow being set because of the lines in /etc/profile where the hostname is set,
but I'm not sure.
Disabling systemd-resolved might not be the best idea. That makes you a good candidate for
surprise follow-up problems elsewhere.
I’m wondering, if something is wrong with your DHCP / DNS service.
systemd-resolved „knows“ there kind of hostnames:
If you don’t touch the hostname during installation, you get a „transient hostname“ with
fallback „fedora“, if the system get’s no hostname from DHCP, or a similar service. The
transient hostname is evaluated at each boot time. If your DHCP service provides a
hostname, it is used. Otherwise - just as a fallback - fedora is used.
As soon as you define a „static hostname“, that hostname is fixed and will not be changed
in the future (unless you change it explicitly), regardless what your DHCP server might
deliver. If I remember correctly, the static hostname is synchronised with the classic
/etc/hostname. Or maybe, it is a one-time action.
And that is exactly the way, F35 works. I just tested the setup. (Usually I go the other
path and define a static hostname in the installation process and the DHCP server picks
that hostname and creates an DNS entry).
(For details see
https://www.freedesktop.org/software/systemd/man/hostnamectl.html)
Best
Peter