The Linux host name is set during the installation of the Linux operating system and is the only identifier of a host on the network. However, if you want to modify the host name after installing the Linux system, what should I do? This article describes how to use Ubuntu Desktop 9.04.
1. view the host name quickly
In ubuntu, there are two methods to quickly view the Host Name: one is to open a gnome terminal window, you can see the host name in the command prompt, the host name is usually located after the "@" symbol; 2. Enter the hostname or uname-N command in the terminal window to view the current host name.
2. Temporarily modify the Host Name
The fastest way to modify the host name is to use the command "new host name hostname" to change the current host name. The "New Host Name" can be expressed by any valid string. However, in this way, the new host name is not stored in the system. After the system is restarted, the host name will be restored to the original host name.
3. Change the host name permanently.
It is also easy to change the host name permanently in Ubuntu. The host name is stored in the/etc/hostname file. When modifying the host name, edit the hostname file, enter a new host name in the file, and save the file. After the system is restarted, check whether the host name is successfully modified by referring to the method described above to quickly check the host name.
It is worth noting that not all other Linux distributions have the/etc/hostname file. For example, the ora release stores the host name in the/etc/sysconfig/network file. Therefore, when modifying the host name, you should be aware of the Linux release.