How to modify Linux host names

Source: Internet
Author: User

LinuxEverything is troublesome.Host NameIs no exception. The following describes the specific methods.

After Linux is installed, its default host name is localhost. Three steps are required to modify the Linux host name.

Use hostname to modify the current host name.

Hostname new-hostname

Modify the/etc/sysconfig/network configuration file so that the new host name can be used at the next restart.

Open the/etc/sysconfig/network file and modify HOSTNAME = new-hostname.domainname.

The modified/etc/sysconfig/network file is as follows:

NETWORKING = yes

HOSTNAME = new-hostname.localdomain

Modify the local domain name resolution file/etc/hosts so that the local application can resolve the new host name.

Edit the file:/etc/hosts

Modify: xxx. xxx new-hostname.domainname new-hostname

Here xxx represents the network address of the local machine, or the loopback address 127.0.0.1)

The modified/etc/hosts file is as follows:

127.0.0.1 localhost. localdomain localhost

127.0.0.1 new-hostname.localdomain new-hostname

This article describes how to modify the host name in Linux. In fact, it is easy to know how to operate it. I hope this article will help you.

  • Wine that can run Windows software in Linux
  • Ext4 Performance Improvement released in Linux Kernel 2.6.37
  • Suggestions on how to learn about Linux 11
  • Linux Command collection
  • Detail Linux static IP configuration, DNS and host name 1)
  • Detail Linux static IP configuration, DNS setting, and host name 2)
  • 18.4.1 query Host Name

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.