标签:ali kernel local 主机 命令 host 查看 cal mac
[root@localhost ~]# hostname
localhost.localdomain
[root@localhost ~]# hostnamectl
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 90300023da1f4b85b4c7cd89dbb4f1cc
Boot ID: c054f20e33d74e1a8ec29557885c75c6
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.el7.x86_64
Architecture: x86-64
[root@localhost ~]# hostnamectl set-hostname study
127.0.0.1 study.linux.com study
::1 study.linux.com study
重新启动服务器,使用hostname命令和hostnamectl命令查看主机名
[root@study ~]# hostname
study
[root@study ~]# hostname -a
study.linux.com study.linux.com
[root@study ~]# hostnamectl
Static hostname: study
Icon name: computer-vm
Chassis: vm
Machine ID: 90300023da1f4b85b4c7cd89dbb4f1cc
Boot ID: c054f20e33d74e1a8ec29557885c75c6
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.el7.x86_64
Architecture: x86-64
标签:ali kernel local 主机 命令 host 查看 cal mac
原文地址:https://www.cnblogs.com/shijunxian/p/13022540.html