分页: 1 / 1

域名解析的问题

发表于 : 2016-04-07 15:30
罗非鱼
我的/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 ?

Re: 域名解析的问题

发表于 : 2016-04-07 16:06
oneleaf
127.0.0.1 hwy.local 才会将 hwy.local 解析为 127.0.0.1

后面的域名必需完整和规范,你上面的配置带路径,是错的。

Re: 域名解析的问题

发表于 : 2016-04-07 17:27
罗非鱼
为何 ping hwy.local 被解析成 192.168.1.101?

Re: 域名解析的问题

发表于 : 2016-04-07 18:00
oneleaf
需要去查你的上一级dns服务器。

Re: 域名解析的问题

发表于 : 2016-04-08 8:47
罗非鱼
谢谢,上层绑定。