Whenever you install the Ubuntu operating system in your computer, the host name is fixed to a default name which may not be desired to you. No worries though, you can change it by editing a couple of files. This tiny article will guide you to change the host name of your Ubuntu system.
Step 1: Check your current host name by running following command in terminal:
|Result : hostname|
Step 2: To change the existing host name, edit /etc/hosts and /etc/hostname files with your favorite text editor.
sudo gedit /etc/hostname /etc/hosts
You will observe two files opened in the text editor. You can edit the underlined part shown in the images below to set the desired host name.
|Edit 'hosts' file|
|Edit 'hostname' file|
Step 3: After editing those files, save them and reboot the system for the changes to take effect.