Modify the name of the Centos server host.

Source: Internet
Author: User
Tags centos server

Modify the name of the Centos server host.
1. Temporarily modify the server host name:

Hostname myhost. The host name specified by myhost.


2. Change the host name permanently.

After the Centos server is installed, the default host name is localhost. localdomain: For convenience and management, we need to modify the server host name. The modification takes effect in two configuration files:/etc/sysconfig/network and/etc/hosts, next we will teach you how to do this:

2.1 Modify/etc/sysconfig/network

Modify hostnamevi/etc/sysconfig/network in/etc/sysconfig/networkHOSTNAME = myhos # modify localhost. localdomain to myhost

2.2 Modify/etc/hosts

Vi/etc/hosts

We can do this after opening:


2.3 restart the server

Shutdown-r now


Related Article

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.