小编dsp*_*pjm的帖子

为什么 nslookup 在 ping 时不使用 mdns?

在 dnsmasq.conf 中:

address=/local/127.0.0.1
Run Code Online (Sandbox Code Playgroud)

在 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
Run Code Online (Sandbox Code Playgroud)

我可以使用 nslookup:

# nslookup www.local
Server:     127.0.0.1
Address:    127.0.0.1#53

Name:   www.local
Address: 127.0.0.1
Run Code Online (Sandbox Code Playgroud)

但我不能使用 ping:

# ping www.local
ping: unknown host www.local
Run Code Online (Sandbox Code Playgroud)

我在 ping www.local 时使用 tcpdump 捕获 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 …
Run Code Online (Sandbox Code Playgroud)

networking domain-name-system resolv.conf ping dnsmasq

9
推荐指数
1
解决办法
3675
查看次数