|
我的/etc/hosts设置如下
127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.0.1 hwy.local/wp 127.0.0.1 hwy.local/test
本机ip是192.168.1.101。 ping hwy.local/wp PING hwy.local/wp (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.029 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.035 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms 64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.034 ms 64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.037 ms ^C --- hwy.local/wp ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.029/0.034/0.037/0.002 ms root@hwy:/home/debian8# ping hwy.local/test PING hwy.local/test (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.114 ms 64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.031 ms 64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.040 ms 64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.038 ms 64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.041 ms 64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.036 ms ^C --- hwy.local/test ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5000ms rtt min/avg/max/mdev = 0.031/0.050/0.114/0.028 ms root@hwy:/home/debian8# ping hwy.local PING hwy.local (192.168.1.101) 56(84) bytes of data. 64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=0.026 ms 64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=0.028 ms 64 bytes from 192.168.1.101: icmp_seq=3 ttl=64 time=0.032 ms
为何 ping hwy.local 不会解析成 127.0.0.1 ?
|