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.

Example

Here, we query for PTR records of the domain 1.0.0.127.in-addr.arpa. 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 127.0.0.1.

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

$ dog PTR 1.0.0.127.in-addr.arpa
PTR 1.0.0.127.in-addr.arpa. 0s   "localhost."