How to nslookup on an IP address return NXDOMAIN but I can still ping it

domain-name-systemreverse-dns

I was trying to do some reverse DNS lookups on some IP addresses I see in my traceroute (ultimately to figure out roughly geographically where my path is going through), but I often get results that look like:

> nslookup 209.85.251.242 
Server:     192.168.1.1
Address:    192.168.1.1#53

** server can't find 242.251.85.209.in-addr.arpa.: NXDOMAIN

Similarly, dig gives:

dig -x 209.85.251.242

; <<>> DiG 9.8.5-P1 <<>> -x 209.85.251.242
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 14592
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;242.251.85.209.in-addr.arpa.   IN  PTR

;; AUTHORITY SECTION:
251.85.209.in-addr.arpa. 60 IN  SOA ns1.google.com. dns-admin.google.com. 1540420 21600 3600 1209600 10800

;; Query time: 67 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Dec 07 02:13:46 CET 2013
;; MSG SIZE  rcvd: 105

This suggested to me that no PTR record exists for this IP address, but I am able to ping the address.

I think I don't understand well enough how DNS works to see what's going on here. In what circumstances can this happen?

Best Answer

PTR records are entirely optional, and have no bearing on the ability to communicate with a specific address or netblock. Expanding on that thought, DNS as a whole doesn't have any bearing on this ability either. Basic DNS queries (A, CNAME, PTR, etc.) function solely to map a name to an IP address.

Related Topic