$ hostname node1"; the second one is the command format "hostnamectl".."/> $ hostname node1"; the second one is the command format "hostnamectl"..">

Home >Operation and Maintenance >CentOS >Detailed explanation of how to modify the host name in CentOs7.3

Detailed explanation of how to modify the host name in CentOs7.3

藏色散人
藏色散人forward
2020-04-27 17:03:222758browse

The following column centos tutorial will introduce to you the method of changing the host name in CentOs7.3. I hope it will be helpful to friends in need!

Detailed explanation of how to modify the host name in CentOs7.3

CentOs7.3 Modify the host name

The first

Command format

hostname <hostname>
$ hostname node1

This way, only The temporary host name can be modified. When the machine is restarted, the host name changes back.

Second

Command format

hostnamectl set-hostname <hostname>
$ hostnamectl set-hostname node1

Restart the server

$ reboot

Reconnect the server

$ hostname
node1

Recommended tutorial: " centos

The above is the detailed content of Detailed explanation of how to modify the host name in CentOs7.3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete