Changing the computer name on Ubuntu

Linux, Ubuntu, 2015-06-16 23:36:06 UTC

To change the computer name in Ubuntu, follow these steps;

1. Open /etc/hostname

you@computer:~$ sudo nano /etc/hostname

And give the name you want (in /etc/hostname);


2. Open /etc/hosts

you@computer:~$ sudo nano /etc/hosts

And change the name as you type above;       localhost       ubuntu-RV

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

3. Restart hostname service;

you@computer:~$ sudo /etc/init.d/hostname restart


sudo service hostname restart

4. Open new terminal tab, now you can see new name