How to change hostname in linux

In this article let’s discuss about How to change hostname in linux. Let’s go through the following methods without any delay.

Method 1:

sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

FIRST GIVE ROOT PERMISSION
	sudo su

gedit /etc/hosts
gedit /etc/hostname 

Hope the above solution works.

Realted Posts : Ubuntu dock not showing