What is a PTR Record and How to Do Reverse IP Lookup?

What is a PTR Record and How to Do Reverse IP Lookup?

There are many types of DNS records and it can be overwhelming for beginners to understand which DNS record is necessary or how to setup one. In this tutorial you will learn what a PTR record is and how to check if it’s set for an IP address.

What is a PTR Record

In short a PTR record is like a reverse version of A record. A record maps domain name to an IP address, PTR maps an IP address to a hostname. However, these two records are independent. For example, A record of hostinger.com can point to 21.21.128.xx IP address, while 23.23.128.xx can be mapped to a totally different hostname.

Why you need a PTR Record

It’s useful for outgoing mail servers. This record adds reliability for sending server and allows receiving end to check the hostname of an IP address. This is a great way of protection against all sort of spammers who use fraudulent domain names to send spam. That’s why some major email providers like yahoo.com, gmail.com do a reverse DNS lookup before accepting incoming emails.

What you’ll need

Before you begin this guide, you’ll need the following:

  • Access to your computer console (optional)

Method 1 – Checking PTR with nslookup or dig

Windows and Unix like systems (Linux, MacOS) have inbuilt tools to check DNS records. If you are a Windows user, follow the steps bellow:

  1. Access Windows start menu, type in cmd and press ENTER.
  2. You should now see a black Command Prompt window.
    Windows Command Prompt
  3. Type in the following command to get the hostname of the IP address (remember to change IP_ADDESS to real IP):
    nslookup IP_ADDRESS
  4. For example, if you would want to check PTR record of 54.243.154.xx, you would see a result similar to this one:
C:\Users\Tom>nslookup 54.243.154.xxx
Server:  server1.yourisp.com
Address:  121.91.3.xx

Name:    ec2-54-243-154-49.hostinger.com
Address:  54.243.154.xx

As you can see, PTR record is ec2-54-243-154-49.hostinger.com.

For Linux and Mac users the process is similar:

  1. On MacOS, access terminal from launcher (F4). Most of Linux distributions allow to open terminal by pressing Ctrl+Alt+T keys at the same time.
  2. Use the following command to check the record (remember to change IP_ADDRESS to real IP):
    dig -x IP_ADDRESS
  3. For example, checking PTR record of 54.243.154.xx IP address would print similar results:
dmins-Mac-mini:~ domantas$ dig -x  54.243.154.xx

; <<>> DiG 9.8.3-P1 <<>> -x  54.243.154.xx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26997
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;xx.154.243.54.in-addr.arpa.    IN  PTR

xx.154.243.54.in-addr.arpa. 250 IN  PTR  ec2-54-243-154-49.hostinger.com

;; Query time: 34 msec
;; SERVER: 351.91.3.242#53(
;; WHEN: Fri Dec 30 11:38:29 2016
;; MSG SIZE  rcvd: 99

From the ANSWER SECTION you can see that PTR record is ec2-54-243-154-49.hostinger.com

Method 2 – Using Online Tools

Yet, another way to find out the hostname of the IP address is to use online reverse lookup tools like MxToolBox. All you need to do is enter the IP address in the field and press Reverse Lookup button.

MxToolBox Reverse Lookup


Unfortunately, if lookup shows that the record is not set for an IP address, in most cases, you will have to contact your hosting provider or ISP with a request to create one. However, you now know what PTR record is and how to check whether IP address has one. This is useful if you experience DNS errors and bounce backs while trying to send emails as it will help you to troubleshoot the issue.

The Author


Domantas G. / @domantas

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

Related tutorials

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Become a part of Hostinger now!

More in DNS
How to Check if Domain is Correctly Pointed