通过修改文件 修改文件 vi /etc/hostname 添加主机名 test1 vi /etc/sysconfig/network 添加IP和hostname对应关系 192.168.X.X test1 重启reboot生效