On 2026-09-30 12:31, Chris Green wrote:
I already have the following in /etc/hosts:-
127.0.1.1 t16.zbmc.eu t16
That's the method recommended by the Debian's administrator handbook.
This works for me. I'm using systemd-networkd and systemd-resolved,
FWIW.
but this doesn't seem to have the required effect.
What does not work exactly?
The name in /etc/hostname must match one of the aliases, for the system
to match up the FQDN.
Is there a reason you use 127.0.1.1 instead of the more commonly used
value 127.0.0.1?
Having said all this, the host name is a property of the host, while the
domainname is more a property of the network you are connected to (and
may even vary, depending on which route you use to connect to the host).
So it should ideally be obtained from the network, e.g. from DHCP.
That's not always an option, in which case the /etc/hosts method is a
perfectly reasonable way to do so.
Thomas