Executing the command hostname newHostName
alone, apparently, is not enough.
To change the hostname:
1. Edit /etc/hostname
using your favorite text editor. Mine is vi improved vim
.
2. Change the old host name into the new host name in /etc/hosts
. Usually the second line that states 127.0.0.1 oldHostName
3. Issue the command hostname newHostname
4. Log out and then log back in. No need to restart.
This also works on Debian-based distributions like Ubuntu and Linux Mint.
No comment yet, add your voice below!