DNS

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

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

Introduction

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):
  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:
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):
  3. For example, checking PTR record of 54.243.154.xx IP address would print similar results:
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

Conclusion

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.

Add Comment

Click here to post a comment

Join thousands of subscribers worldwide

and get awesome deals & the newest tutorials to your email

Please wait...

Thank you for sign up!

Share this