filmov
tv
What is 'hostname' ? How to change hostname of a Linux System

Показать описание
Learn how to change the hostname of a Linux system.
The hostname is a name given to a host or a computer or any other computing machine such as a server, a router, a laptop, an iPad or a tablet-PC, and so on. The hostname is set to identify the device by its name in a network. As a Linux administrator, you are expected that you have the skill to change the hostname of a computer or server or any other computing machine and you will often get the situation at work as well.
Steps
Login to your Linux system, open the bash terminal, and execute the command hostname to know the current hostname set to the system. Also, the name after the ‘@’ symbol refers to the hostname in a Linux system. However, some systems may not display it on the bash terminal until you fire up the hostname command.
To change the hostname, type hostnamectl set-hostname and the new name that you want to set. The hostname should have been changed but you may not see the change propagated on the screen or on the bash terminal. To see it changed, either you need to log out and log in again or you need to execute the command exec bash. That’s it. Now you should see the change propagated on the terminal.
If you fire up the hostname command, you should see the hostname of the Linux system.
The hostname is a name given to a host or a computer or any other computing machine such as a server, a router, a laptop, an iPad or a tablet-PC, and so on. The hostname is set to identify the device by its name in a network. As a Linux administrator, you are expected that you have the skill to change the hostname of a computer or server or any other computing machine and you will often get the situation at work as well.
Steps
Login to your Linux system, open the bash terminal, and execute the command hostname to know the current hostname set to the system. Also, the name after the ‘@’ symbol refers to the hostname in a Linux system. However, some systems may not display it on the bash terminal until you fire up the hostname command.
To change the hostname, type hostnamectl set-hostname and the new name that you want to set. The hostname should have been changed but you may not see the change propagated on the screen or on the bash terminal. To see it changed, either you need to log out and log in again or you need to execute the command exec bash. That’s it. Now you should see the change propagated on the terminal.
If you fire up the hostname command, you should see the hostname of the Linux system.