Peter Boy writes:
> Am 17.01.2022 um 16:22 schrieb Sam Varshavchik
<mrsam(a)courier-mta.com>:
>
> Peter Boy writes:
>
>> 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.
>
> dhcpd's configuration file uses MAC addresses to assign reserved IP
addresses to specific DHCP clients. It doesn't matter what hostname the
client sends.
Yes, my wording was way too short. It uses the static hostname to enter the
IP generated for the MAC address along with the hostname into the DNS part
(in dnsmasq, which is used in Fedora KVM/libwirt) that is used to retrieve
the hostname.
Ok, so this is basically trusted DDNS stacked on top of DHCP.
But Thomas uses a static host table, so the DNS delivered hostname is
independent from any MAC address and any transient or static hostname of the
client.
It should be possible to hack up a script that gets run when an IP address
is assigned that does a reverse IP lookup and sets the hostname. However
that should be done in a manner that does not permanently save the hostname
so that it gets reverted to a static stub name on the next reboot.