On 1/16/22 15:00, Peter Boy wrote:
Do you want to set the hostname at every boot?
Usually you set the static hostname once using "hostnamectl set-hostname
<FQDN>“. „fedora“ is the transient hostname. DHCP client uses the static hostname
to request an IP.
But maybe I didn't get what exactly you want to do.
I have DNS set up such that every host that gets a dynamic address gets
the hostname
hostXXX.tc.camerontech.com, like this:
172.31.100.100
host100.tc.camerontech.com
172.31.100.101
host101.tc.camerontech.com
172.31.100.102
host102.tc.camerontech.com
172.31.100.103
host103.tc.camerontech.com
and so on. For RHEL 6, 7, 8, and 9 beta, along with the last MANY
versions of Fedora, when a new virtual machine boots up using KVM
virtualization, the system hostname is set to whatever the reverse IP
address of the instance. So if the VM gets 172.31.100.150, the hostname
is set to
host150.tc.camerontech.com. It's worked this way for years and
years.
All of a sudden with F35, no matter what the address of the VM is, its
hostname is set to fedora. Just fedora. Not
fedora.tc.camerontech.com.
I want F35 to have the same behavior as previous versions of Fedora and
RHEL and Ubuntu and so on. I don't want to manually set /etc/hostname
and monkey with hostnamectl because if the VM gets a new address, I
don't want to have to go and change /etc/hostname or anything.
I've been poking around with /etc/NetworkManager/NetworkManager.conf -
it seems like I should be able to set :
[main]
#plugins=keyfile,ifcfg-rh
hostname-mode=default
but that doesn't work. When I first ssh into the VM, the hostname is set
to "fedora" again. If I restart NetworkManager.service, THEN the
hostname is changed to whatever the reverse DNS name is.
I have a few setup scripts which really need an accurate hostname value
set, so this is really frustrating.
Make sense?
Thomas