February 4, 2019
3 min Read
February 4, 2019
3 min Read
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.
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.
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.
Before you begin this guide, you’ll need the following:
Windows and Unix like systems (Linux, MacOS) have inbuilt tools to check DNS records. If you are a Windows user, follow the steps bellow:
cmdand press ENTER.
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:
dig -x IP_ADDRESS
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 ;; QUESTION SECTION: ;xx.154.243.54.in-addr.arpa. IN PTR ;; ANSWER SECTION: xx.154.243.54.in-addr.arpa. 250 IN PTR ec2-54-243-154-49.hostinger.com ;; Query time: 34 msec ;; SERVER: 3188.8.131.52#53(184.108.40.206) ;; 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
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.
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.