Daily Ubuntu Tips – Change Computer Name

This post is part of our new series called Daily Ubuntu Tips where we show students and new users how to do basic tasks on Ubuntu. This series is geared towards newbies who want to learn how to manage Ubuntu systems.

The first post in the in this series is how to change Ubuntu computer name. This should apply to all versions of Ubuntu including, Ubuntu 17.04 / 17.10 and future releases.

Folks get the chance to add the system name during Ubuntu installation. The name assigned at installation will stay in place until you change it. To change it, use the guide below.

Changing Ubuntu system name isn’t necessary. However, to learn how to manage Ubuntu, new users may want to learn the basics. Changing Ubuntu system name won’t hurt anything as well, and you can change it as many times as you’d like. You can also keep the computer name in place for ever without changing it.

To change your computer name, run the commands below to open the computer hostname file.

sudo nano /etc/hostname

When the file opens, replace the name in the file with its replacement (new name) and save.


Next, run the commands below to open the hosts file.

sudo nano /etc/hosts

Then change the line that corresponds to the hostname above.                                    localhost                                    ubuntu1704

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Save the file and exit.

Restart your computer for the changes to apply.

Congratulations! You’ve just learned how to change Ubuntu system name.


This post shows students and new users how to change Ubuntu system name. The post is intended for newbies who just want to learn some basic tasks in Ubuntu.

When the changes are done above, restart and your computer should now be recognize by its new name.


You may also like the post below:

Setup Passwordless Login with PuTTY and Connect to Ubuntu 17.04 / 17.10