dog, the command-line DNS client

The PTR record

The PTR (pointer) record holds a pointer to a canonical name. This is most often used for reverse DNS lookups.


Here, we query for PTR records of the domain This unusual-looking domain name represents a reverse DNS lookup: instead of finding the IP for a domain name, we are asking for the hostname of an IP — in this case, the IP address

As expected, the DNS server responds with "localhost".

$ dog PTR
PTR 0s   "localhost."