You are not logged in.
Whenever I connect to some corporate Wi-Fi (I'm using the default NetworkManager), the machine hostname automatically changes, and that breaks X applications.
I already figure out
how to change the hostname back (temporarily)
how to fix the magic cookie to make apps work with the new hostname
how to avoid changing the hostname automatically (didn't test?)
But why would the default be changing hostname automatically, if it breaks every X apps?
-----
Update:
The default hostname is archlinux if there's no /etc/hostname. Indeed putting in any valid hostname (even the default archlinux, although it's obviously not recommended) will prevent the hostname from changing, even without hostname-mode=none.
Last edited by k395 (2021-12-26 08:35:27)
Offline
Correctly setting your hostname should prevent NM from using a transient one.
hostname-mode
Set the management mode of the hostname. This parameter will affect only the transient hostname. If a valid static hostname is set, NetworkManager will skip the update of the hostname despite the value of this option. An hostname empty or equal to 'localhost', 'localhost6', 'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
Offline
But why would the default be changing hostname automatically
To answer the original question of "why is that" - the hostname is communicated to your dhcp server (your router) and can be used by a local dns server (your router) to resolve local network hostnames.
That doesn't work if every expert wants to use the hostname "localhost".
If you had installed arfch following the wiki installation guide, you'd have come across https://wiki.archlinux.org/title/Networ … e_hostname …
Online