在Linux7.x 版本中,临时设置主机名称使用指令:hostnamectrl set-name 主机名称

 1 [root@localhost ~]# hostname
 2 gongziyuan.com
 3 [root@localhost ~]# hostnamectl set-hostname localhost
 4 [root@localhost ~]# 
 5 [root@localhost ~]# hostname
 6 localhost
 7 [root@localhost ~]# hostnamectl set-hostname gongziyuan.com
 8 [root@localhost ~]# 
 9 [root@localhost ~]# 
10 [root@localhost ~]# hostname
11 gongziyuan.com
12 [root@localhost ~]# 

Linux 7.x 设置主机名称

 

如有问题,欢迎纠正!!!

如有转载,请标明源处: https://www.cnblogs.com/Charles-Yuan/p/9853724.html

 

相关文章:

  • 2022-03-09
  • 2021-11-13
  • 2021-07-25
  • 2022-01-28
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-02-11
  • 2021-12-28
  • 2022-12-23
相关资源
相似解决方案