Howto use dig check PTR record

dig (as known as “domain internet groper”) is a utility that can talk directly to name servers in order to gather detailed domain name related information.

DNS is used to resolve a host name or alias into IP address,so that your computer can find the resource you’re looking for. However, it’s also possible to supply reverse information — to find the host name associated with a numeric IP address. This is called “reverse-resolving” or “reverse DNS” or “PTR” record. PTR is much helpful when you are sending out mails, some anti-spam gateways check PTR records to identify spamers.

We can use dig to find out whether any given IP address has a PTR record or not. To do a PTR lookup with dig, we must first convert the IP address into a host-name-like construct by reversing the order of the octets and then appending a suffix “.in-addr.arpa” — for example, given the address 201.202.203.204 we transform this address into a strings “204.203.202.201.in-addr.arpa” and then use it with the “dig ptr” command:

admon:~ google$ dig ptr 204.203.202.201.in-addr.arpa

[…bla bla bla…]

;; ANSWER SECTION:
204.203.202.201.in-addr.arpa. 1200 IN PTR linux.www.admon.org.

[…bla bla bla…]

We got our answer in the answer section: linux.www.admon.org.

If you use command “host”, things may be much easier, and the command is: “host 201.202.203.204”

Share Button

5 thoughts on “Howto use dig check PTR record

  1. In this case, the command host would be much easier. You just need to run “host 123.123.123.123”

  2. While searching for Blogs about Howto use dig check PTR record | Planet Admon I found your site. Thank you for the effort you have put in.

  3. I’m now not positive where you are getting your info, however good topic. I must spend a while learning more or figuring out more. Thank you for fantastic info I used to be searching for this info for my mission.

Leave a comment

Your email address will not be published. Required fields are marked *