This is quite simple to do, you just need to edit 2 files. Let’s start!

First, edit the hostname file with the command below and replace what is there with your new name.

sudo nano /etc/hostname

Second, edit the hosts file and replace any occurrence of the old name with your new name.

sudo nano /etc/hosts

It’s always good to do a restart.

sudo reboot

That it, clean and simple. Why not check out some of the other tutorials on this site.

Share this content: