Mini Guide: DHCP Controlled Hostname on Raspbian
DHCP Controlled Hostname on Raspbian
Note: This note was originally in the Network Booting a Raspberry Pi 3 from an Ubuntu Server post.
In theory the configuration should be as simple as stated below:
{
...
host pi3-1 {
hardware ethernet b8:27:eb:41:8e:fa;
fixed-address 192.168.1.59;
option host-name "pi3-1";
}
host pi3-2 {
hardware ethernet b8:27:eb:1b:3c:41;
fixed-address 192.168.1.58;
option host-name "pi3-2";
}
}
However, it seems that this gets ignored, this article provides one solution that appears to work and does not modify the /etc/hostname
file in the NFS root. As root:
echo localhost >/etc/hostname
Then:
echo unset old_host_name > /etc/dhcp/dhclient-enter-hooks.d/unset_old_hostname
Which seems to work: