在dnsmasq.conf中:
address=/local/127.0.0.1
在resolv.conf中:
# Generated by NetworkManager
domain example.com
search example.com
nameserver 127.0.0.1
nameserver 10.66.127.17
nameserver 10.68.5.26
我可以使用nslookup:
# nslookup www.local
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: www.local
Address: 127.0.0.1
但我不能使用ping:
# ping www.local
ping: unknown host www.local
我使用tcpdump来捕获ping lo.local时的lo,没有数据包,而像
# tcpdump -i em1 -n | grep local
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 65535 bytes
20:14:38.189335 IP 10.66.65.188.mdns > 224.0.0.251.mdns: 0 A (QM)? www.local. (27)
20:14:39.190700 IP 10.66.65.188.mdns > 224.0.0.251.mdns: 0 A (QM)? www.local. (27)
20:14:41.192979 IP 10.66.65.188.mdns > 224.0.0.251.mdns: 0 A (QM)? www.local. (27)
从物理界面出现。
这意味着ping正在使用Mdns,但是为什么nslookup不使用mdns?当mdns不返回有用信息时,为什么ping不使用普通dns?
谢谢。