I run Ubuntu 20.04 based from the cloudimage... so netplan has its 50-cloud-init.yaml which just says .. use dhcp
In the background it uses systemd-networkd as backoffice
But how can I advise ubuntu to set the hostname based on option 12? In the past we used dhclient exit hooks but with netplan and systemd this doesn't work anymore. So how can I do this ?
The UseHostname Option in Section DHCP in /etc/systemd/networkd.conf is not accepted (unknown option)
/etc/hostname
andman hostname
?/etc/systemd/network/10-wan.network
(your10-wan.network
will be whatever for your network) instead of/etc/systemd/networkd.conf
.systemd.network(5)
, theUseHostname
option is supposed to be set in aDHCPV4
section, not aDHCP
section. However, this manpage also specifies that it describes the syntax of.network
files - not of/etc/systemd/networkd.conf
. It does not appear to be possible to setUseHostname
globally for networkd., you need to be able to modify a.network
file to accomplish this.