0

Basically I issue a query (Type: PTR) from my client for the following

_some-service._tcp.gv.com

In response to that query, I get back

Reply code: No such name (3)

According to this question and rfc

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.

However when I am on my client the domain name does resolve to the correct ip address and I can ping without issue

[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

Why does the DNS response give me the reply code 3 when the domain name resolves for my client?

Could it be that the error occurs because the service I am looking for does not exist in the DNS server?

7
  • 1
    Your question does not make sense to me. What has a ptr on a subdomain got to do with a query to resolve a different subdomain?
    – davidgo
    Feb 20 '20 at 18:11
  • @davidgo I am just explaining the type of query I am issuing to the DNS and the type of query, with respect to my wireshark, is PTR (12) Feb 20 '20 at 18:18
  • A PTR for a SRV record (which is what _some-service._tcp.gv.com appears to be) isn't a common thing (I would say "never", but there might be some use case for such a thing). Normally PTR records would refer to A records. Regardless, you would query an IP address to get the name associated with it. Example: dig -x 192.168.10.10 or if you're a masochist dig 10.10.168.192.in-arpa. PTR (I may not have that format exactly correct) Feb 20 '20 at 19:08
  • I'm integrating software into a system, this software works on my company's network. What is happening now is I am setting up a private network with my own DNS, DHCP servers to exercise the software on a closed network. I can't change the behavior of the system, it's not my code. The software issues PTR qry _some-service._tcp.gv.com then when it gets a response back it issues the SRV qry for _service-1._some-service._tcp.gvc.com to get the ip address for the service it's looking for. @BrandonXavier @Virsacer Feb 20 '20 at 19:35
  • I have a feeling there is an issue with my DNS server configuration for the forwarding of the domain name... Feb 20 '20 at 19:43
3

I am afraid without detail it cannot be answered in the way you would be happy :-(.

In your question I would see some (let say) not common approach. In case it would be just theoretical question (you have mentioned capturing the packets) I would think about misunderstanding of the DNS service...

You have mentioned

_some-service._tcp.gv.com PTR

And later in the question:

ping gw.com

Where is absolutely no relation between it...

Let assume only IPv4 (to reduce set of relevant records only) and domain example.com:

There can be following relevant records (for simplicity "ignoring" zones separation):

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 service (e.g. web browser) usually not using SRV but in theory it could be valid example.

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.

Anyway in case of ping you are requesting simple A record so neither SRV nor PTR is utilized...

In case of MX (Mail eXchange - record used for e-mail delivery) in case of non existence there is defined fall back to A record to where to try to deliver the message...

It is possible that there is PTR record but once it is without success there could be utilized some "standard" A or SRV query. This would be visible in communication visible in Wireshark ;-). Definitely it is about implementation / behaviour of the specific application. This question would be addressed to the authors - why they have utilized the PTR records this way...

13
  • technically yes, in case of private / reserved IPs it make sense but in case of "public" IP it can work for you but the rest of the world will ignore it as there is not NS delegation pointing to your server.
    – Kamil J
    Feb 20 '20 at 21:34
  • Anyway PTR in the structure of SRV record (as you have mentioned in the question) it would be normally in the zone. As I have wrote technically it can be used similar way like CNAME but this usage is not widely utilize - I have never see it to be honest.
    – Kamil J
    Feb 20 '20 at 21:35
  • you need to query what you expect to get as answer... so e.g. dig ptr _http._tcp.example.com. or dig ptr 10.2.0.192.in-addr.arpa. In case you want to see some real output try e.g. google dns - dig ptr 8.8.8.8.in-addr.arpa. ;-).
    – Kamil J
    Feb 20 '20 at 22:08
  • You didn't put . (dot) at the end of the value so it is handled not "absolute" FQDN but "relative" to queried domain.
    – Kamil J
    Feb 20 '20 at 22:35
  • So far I know yes - manually with exception :-) (e.g. Active Directory utilizing DNS and especially SRV records to localize the servers with "internal" services - ldap, kerberos,... - this "internal" records are generated / updated automatically). On the other side the SRV record is defined but actually it is still rarely used on client sides... Nowadays there are still primarily used reserved ports (<1024 - e.g. 80 http, 443 https, 53 dns,...) and regular A / AAAA record (or MX in case of e-mails) to reach the destination system.
    – Kamil J
    Feb 20 '20 at 23:24
0

A PTR is an IP-Address pointing to a domain.

So if you ask the DNS for a domain using a domain instead of an IP you will get NXDOMAIN.

And your client asks the IP for a domain (A-record), so it gets a valid answer and can ping.

So ask for A, AAAA, TXT or whatever record your "service" is and you will get a result

dig _some-service._tcp.gv.com TXT

1
  • unfortunately due to current limitations, I can't change the software from issuing the PTR query... Feb 20 '20 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.