Published:

Person using a laptop

To change your hostname on a Linux laptop, use the hostnamectl command.

For instance, to vary your laptop’s hostname to myhostname:

$ sudo hostnamectl --static
--transient
--pretty
myhostname

read more