Votes: 0Posted On: Oct 03, 2017 05:52:22
"Hostname" is the name of your device that the network identifies with. The hostname is stored locally in the file "/etc/hostname". It is mapped to the network for communication. Please follow the following steps to change the hostname of your system.
1. Check in your hostname by running the command "hostname" on your terminal.
2. Edit the "/etc/hostname" file in which the hostname is stored in your system. Provide any hostname of your choice. You can use the following command to edit the file.
(Note: You will need root permission to edit the file)
(Note: In this case, we are using the "vi" editor to edit the file. However, you can choose any text editor of your liking.)
3. Once you have saved the file with your new hostname, run the command "hostname" to confirm. The new hostname should be displayed on the screen.
4. Check the "/etc/hosts" file and edit the hostname same as in "/etc/hostname". The "hosts" file maps the hostname to IP address. Hence, it is very important that you edit the hostname in the file. Please edit the hostname mapped with the IP address "127.0.1.1".
5. Any changes made in the files do not take effect until the system is rebooted. So, please reboot the system for the changes to take effect.