查看主机名
[[email protected] Desktop]# hostname
localhost.localdomain
更新network文件
[[email protected] Desktop]# vi /etc/sysconfig/network
[[email protected] Desktop]#
更新hosts文件
输入:vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
改成
127.0.0.1 localhost sxl133 localhost4 localhost4.localdomain4
:: localhost sxl133 localhost6 localhost6.localdomain6
保存成功退出(同上面的第2步)
reboot重启服务器,同时查询主机名
[root@sxl133 Desktop]# reboot
[root@sxl133 Desktop]# hostname