Linux 修改主機名(hostname)

1.查看原機器名vim

# hostname
localhost.localdomain

2.修改新機器名(localhost.localdomain 改成 新機器名.localdomain)bash

# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

3.重啓系統dom

# reboot
或
# shutdown -r now
相關文章
相關標籤/搜索