基本上,我从我的客户端发出一个查询(Type: PTR),用于以下内容
_some-service._tcp.gv.com
作为对这个问题的回应,我回来了
Reply code: No such name (3)
3 Name Error - Meaningful only for
responses from an authoritative name
server, this code signifies that the
domain name referenced in the query does
not exist.
然而,当我在我的客户端时,域名确实会解析到正确的ip地址,并且我可以在没有问题的情况下进行ping。
[root@client/]# ping gv.com
PING gv.com (192.168.10.10) 56(84) bytes of data.
64 bytes from gv.com (192.168.10.10): icmp_seq=1 ttl=64 time=0.308 ms
64 bytes from gv.com (192.168.10.10): icmp_seq=2 ttl=64 time=0.329 ms
64 bytes from gv.com (192.168.10.10): icmp_seq=3 ttl=64 time=0.330 ms
64 bytes from gv.com (192.168.10.10): icmp_seq=4 ttl=64 time=0.306 ms
^C
--- gv.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
为什么当域名为我的客户端解析时,DNS响应会给我回复代码3?
是否因为我正在寻找的服务在DNS服务器中不存在,所以会发生错误?
发布于 2020-02-20 21:18:59
我担心如果没有细节,就不能以你高兴的方式来回答这个问题。
在你的问题中,我会看到一些(比方说)不常见的方法。如果这只是一个理论问题(您已经提到捕获数据包),我会考虑对DNS服务的误解.
你说过
_some-service._tcp.gv.com PTR
在后面的问题中:
ping gw.com
绝对没有关系的地方.
假设只有IPv4 (仅减少相关记录集)和域example.com:
可以有以下相关记录(为了简单“忽略”区域分离):
example.com. IN A 192.0.2.10
www.example.com. IN A 192.0.2.20
web.example.com. IN CNAME www.example.com.
_http._tcp.example.com. IN SRV 10 10 80 www.example.com.
10.2.0.192.in-addr.arpa. IN PTR example.com.
20.2.0.192.in-addr.arpa. IN PTR www.example.com.
Http服务(如web浏览器)通常不使用SRV,但理论上可以是一个有效的例子。
A ... "translate" FQDN to IPv4 address
SRV ... SeRVice record - can have wight and priority.
Pointing the location of the service with posibility of "alternative" endpoints.
CNAME ... Cannonical name - targeting other DNS record. With the answer
the recursion (following query) is utilized.
PTR ... PoinTeR to cannonical name - usually used for reverse records but
by the definition it can be used in the similar way like CNAME just
without recursion.
无论如何,在ping情况下,您请求的是简单的A记录,所以没有使用SRV或PTR .
如果是MX (用于电子邮件传递的邮件eXchange -记录),在不存在的情况下,定义为回到A记录以尝试传递消息的位置.
有可能有PTR记录,但是一旦没有成功,就可以使用一些“标准”的A或SRV查询。这在Wireshark的通信中是可见的;-)。当然,它是关于特定应用程序的实现/行为的。这个问题将向提交人提出--为什么他们以这种方式使用PTR记录.
发布于 2020-02-20 19:16:34
PTR是指向域的IP地址.
因此,如果您使用域而不是IP向DNS请求域,您将得到NXDOMAIN。
您的客户端向IP请求一个域(A-record),这样它就得到了一个有效的答案并可以进行ping操作。
因此,询问A、AAAA、TXT或任何您的“服务”记录,您就会得到一个结果。
dig _some-service._tcp.gv.com TXT
https://serverfault.com/questions/1003932
复制相似问题