Skip to Content

Edit hostname on Ubuntu

Learn how to edit hostname on Ubuntu

karchunt

Kar Chun Tan

Creator

Metadata

Fri Mar 28 2025

1 min read

19 words

Edit hostname on Ubuntu

Edit /etc/hostname

sudo nano /etc/hostname

Replace any hostname you like. Save the file.

/etc/hostname
hello-laptop

Reboot the system

sudo reboot

Check your hostname

hostname
Last updated on