RHEL 7/ CentOS 7 有三种定义的主机名: 静态的(static) , 瞬态的(transient)和灵活的(pretty),
在CentOS 7中可以运行hostnamectl,查看或者修改主机名

查看主机名和相关设置

[root@us01 ~]# hostnamectl    
     Static hostname: us10.openos.org
         Icon name: computer-vm
           Chassis: vm
        Machine ID: f0f31005fb5a436d88e3c6cbf54e25aa
           Boot ID: 984ede9b280e42a1bca2a4d3aa4dac40
    Virtualization: kvm   Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 4.14.0-1.el7.elrepo.x86_64
      Architecture: x86-64

分别查看static/transient/pretty

[root@us01 ~]# hostnamectl --static
localhost.localdomain
[root@us01 ~]# hostnamectl --transient
localhost.localdomain
[root@us01 ~]# hostnamectl --pretty

同时修改所有主机名

hostnamectl set-hostname us11.openos.org

把所有主机名修改为:us11.openos.org

再重启

reboot