Person using a laptop

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

Read more from our friends at Opensource.com