设置hostname # 使用这个命令会立即生效且重启也生效 hostnamectl set-hostname centos7-106 或者修改文件vim /etc/hostname需要执行systemctl restart network生效 修改文件vim /etc/hosts 给127.0.0.1添加centos7-106