
To change your hostname on a Linux computer, use the hostnamectl
command.
For example, to change your computer's hostname to myhostname
:
$ sudo hostnamectl --static \
--transient \
--pretty \
myhostname
--transient \
--pretty \
myhostname