[systemd-devel] How do you set the machine's domain name with systemd?

Adam Nielsen a.nielsen at shikadi.net
Tue Feb 12 11:42:41 PST 2013


> Use hostnamectl, assuming your systemd version is new enough:
>
> http://www.freedesktop.org/software/systemd/man/hostnamectl.html

Thanks for the suggestion, but unfortunately this doesn't seem to work:

$ hostnamectl set-hostname korath.my.domain.com

$ cat /etc/hostname
korathmydomaincom

$ pacman -Qi systemd | grep Ver
Version        : 197-4

At a suggestion from my distro's discussion forum, manually editing 
/etc/hostname and putting the FQDN back in there works.  So I'm not sure 
whether this is a bug in hostnamectl or whether editing /etc/hostname is still 
the preferred way to set a machine's FQDN.

Also for the record the "localhost.localdomain" was because my short hostname 
was listed against 127.0.0.1 in /etc/hosts.  Removing that fixed that issue.

Thanks,
Adam.




More information about the systemd-devel mailing list