ping -a 192.168.99.3
不解析主机名vcl.nailit.lab
,但解析网络上的其他主机名,如pfsense.nailit.lab
。
nslookup vcl.nailit.lab
并ping vcl.nailit.lab
正常工作。查看输出:
C:\Users\Administrator.NAILIT>ping -a 192.168.99.3
Pinging 192.168.99.3 with 32 bytes of data:
Reply from 192.168.99.3: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.99.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\Administrator.NAILIT>ping vcl.nailit.lab
Pinging vcl.nailit.lab [192.168.99.3] with 32 bytes of data:
Reply from 192.168.99.3: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.99.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\Administrator.NAILIT>nslookup vcl.nailit.lab
Server: UnKnown
Address: 192.168.99.13
Name: vcl.nailit.lab
Address: 192.168.99.3
C:\Users\Administrator.NAILIT>ping -a 192.168.99.1
Pinging pfsense.nailit.lab [192.168.99.1] with 32 bytes of data:
Reply from 192.168.99.1: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.99.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms**
DNS 记录似乎没问题 - pfsense 和 vcl 相同。DNS 在 MS Server 2012 上
ping -a 究竟如何解析主机名?为什么除了 'ping -a 192.168.99.3' 之外的所有命令都正常工作?
答案1
ping -a 究竟如何解析主机名?
这称为反向 DNS。正向 DNS 将名称解析为 IP 地址。反向 DNS 将 IP 地址解析为名称。当您ping -a 1.2.3.4
在计算机中输入时,它会发出 DNS 查询PTR 4.3.2.1.in-addr.arpa
。PTR 代表指针记录。
为什么除了‘ping -a 192.168.99.3’之外的所有操作都正常工作?
我的直觉告诉我,您缺少该 IP 地址的 PTR 记录。在您的 DNS 服务器上,您应该看到所谓的反向查找区域,如168.192.in-addr.arpa
。那里应该有该网络上所有设备的 PTR 记录。Windows 设备通常会尝试注册自己的正向和反向 DNS 记录,但如果缺少整个反向查找区域,它们就无法这样做。