|
发表于 2004-10-8 19:00:50
|
显示全部楼层
hosts文件是以前比較落後的一種IP與hostname的對照表...比較簡單的格式
network是指定主機名的...
所以兩個文件要統一才是最好的...
HOSTNAME=shlinux.sh.at-scale.com
NETWORKING=yes
GATEWAYDEV=eth0
"/etc/sysconfig/network"
IP地址 為全名 縮寫
192.168.7.113 shlinux.sh.at-scale.com shlinux
127.0.0.1 localhost
192.168.7.109 erp0
192.168.1.6 fileserver
"/etc/hosts"
[root@shlinux root]# hostname
shlinux.sh.at-scale.com
[root@shlinux root]# ping shlinux
PING shlinux.sh.at-scale.com (192.168.7.113) 56(84) bytes of data.
64 bytes from shlinux.sh.at-scale.com (192.168.7.113): icmp_seq=1 ttl=64 time=0.045 ms
[root@shlinux root]# ping shlinux.sh.at-scale.com
PING shlinux.sh.at-scale.com (192.168.7.113) 56(84) bytes of data.
64 bytes from shlinux.sh.at-scale.com (192.168.7.113): icmp_seq=1 ttl=64 time=0.053 ms |
|