Modify host name in Ubuntu

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.