Configure hostname

You can change the hostname of your Linux system using the hostname command:

hostname command

However, the hostname configured this way is not permanent will not survive a reboot of the system. To set up a new hostname permanently, you need to modify the /etc/hostname file. Open this file in a text editor and simpy change the current value to the new hostname:

etc hostname file

You also need to modify the /etc/hosts file and change the value next to 127.0.1.1 to the new hostname:

change hostname hosts file

Reboot your computer. After the reboot, the new hostname should be used by the system:

check new hostname

Subscribe to our Newsletter

Like us on Facebook

top
Geek University 2019