Home >Operation and Maintenance >CentOS >How to change the host name in CentOs7.3

How to change the host name in CentOs7.3

藏色散人
藏色散人forward
2020-05-12 16:35:481636browse

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

How to change the host name in CentOs7.3

The first

command format

hostname <hostname>
$ hostname node1

In this way, only the temporary host name can be modified. After restarting the machine, The host name has changed again.

Second

Command format

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

Restart the server

$ reboot

Reconnect the server

$ hostname
node1

For more centos technical articles, please When centos uses the tutorial column!

The above is the detailed content of How to change 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