On Sun, 2022-01-16 at 23:25 -0600, Thomas Cameron wrote:
As a dirty hack, I created a file /etc/profile.d/hostname.sh: MYIP=`hostname -I` MYHOSTNAME=`host $MYIP | awk '{ print $NF }' | sed "s/.$//"` echo $MYHOSTNAME > /etc/hostname hostnamectl hostname $MYHOSTNAME That sets the hostname correctly but it's a dirty hack in that it requires someone to actually log in to run the trigger the profile.d stuff. I am trying to find where in the dhclient stuff I should work to have the hostname set correctly from dhcp/dns resolution. It's frustrating that with F34 and F35, the systemd-hostnamed.service is supposed to do this but I'm not seeing where to make it do what I want it to. I've played with the /etc/NetworkManager/NetworkManager.conf file setting the hostname- mode=default in [main] but it's not working.
Any useful clues from these pages: https://forum.manjaro.org/t/how-to-set-the-hostname-assigned-by-dhcp-server/... https://www.linuxsecrets.com/1675-configure-linux-to-broadcast-dhcp-client-h... https://askubuntu.com/questions/104918/how-to-get-the-hostname-from-a-dhcp-s... https://www.google.com/search?q=fedora+dhcp+client+accepting+hostname+from+s...
What we've been discussing is something I've often meant to get around to doing, myself. But I just persevere with manually adjusting a few things, here. I only have a small network, so it hasn't bugged me sufficiently, yet. And my brain is going on strike, at the moment (migraine brain fog). But the first link I supplied suggested simply delete /etc/hostname