# 使用这个命令会立即生效且重启也生效
hostnamectl set-hostname centos77.magedu.com

# 查看结果
hostname
#编辑下hosts文件, 给127.0.0.1添加hostname
vim /etc/hosts

内容如下

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 centos77.magedu.com
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

相关文章:

  • 2021-12-06
猜你喜欢
  • 2021-07-26
  • 2022-02-12
  • 2021-10-09
  • 2021-08-18
  • 2021-12-01
  • 2021-12-13
相关资源
相似解决方案