There are many types of DNS records. It may be difficult for beginners to determine which DNS record is required or how it is set up. In this article, you will learn how to check the PTR record and whether it is set for an IP address.
What is PTR recording?
In short, the PTR record is like an inverted version of the A record. A record maps the domain name to an IP address. PTR maps the IP address to a hostname. However, these two records are independent. For example, a record of hostinger.com may point to the IP address 21.21.128.xx, while 23.23.128.xx can be mapped to a completely different hostname.
Why do you need PTR registration?
Useful for outgoing mail servers. This register adds reliability to the sending server and allows the receiving party to check which host the IP address belongs to. This is an excellent form of protection against fraud domain names that use to send spam. Therefore, some major email providers, such as yahoo.com, gmail.com, perform a reverse DNS lookup before accepting incoming emails.
What will you need?
Before you begin this guide, you need the following:
- Access your computer console (preference)
Method 1 – Query PTR with nslookup or dig
Windows and Unix-like systems (Linux, macOS) include built-in tools for checking DNS records. If you are a Windows user, follow these steps:
1. Open the Windows Start menu,
cmdtype, and then press ENTER.
2. You should now see the Command Line window with a black background.
3. Run the following command to obtain the hostname of an IP address.
4. For example, if you wanted to check the PTR record of the IP address 54.243.154.xx, you would see an output like the one below.
C: \ Users \ Tom> nslookup 54.243.154.xxx
As you can see, the PTR record is ec2-54-243-154-49.hostinger.com.
The process is similar for Linux and Mac users.
1. In macOS, open Terminal. On most Linux operating systems, you can open the Terminal by pressing Ctrl + Alt + T.
2. Use the following command to check the PTR recording.
dig -x IP_ADDRESS
3. For example, the output of the IP address 54.243.154.xx would be as follows.
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.arp to. IN PTR
;; ANSWER SECTION:
xx.154.243.54.in-addr.arp to. 250 IN PTR ec2-54-243-154-49.hostinger.com
;; Query time: 34 msec
;; SERVER: 322.214.171.124 # 53 (126.96.36.199)
;; WHEN: Fri Dec 30 11:38:29 2016
;; MSG SIZE rcvd: 99
You can see the PTR record in the ANSWER SECTION as ec2-54-243-154-49.hostinger.com.
Method 2 – PTR query with online tools
I hope it has been a useful article.