What is a reverse PTR record?
PTR record or more appropriately a reverse PTR record is a process of resolving an IP address to its associated hostname. This is the exact opposite of the process of resolving a hostname to an IP address.
PTR is generally a concern for mail, as some mail servers will reject mail originating from IP's that don't have a valid PTR.
Example, when you ping a name mail.somedomain.com it will get resolved to the ip address using the DNS to something like 192.168.1.5
Reverse PTR record does the opposite; it looks up the hostname for the given IP address.
In the example above the PTR record for IP address 192.168.1.5 will get resolved to mail.somedomain.com.
Why do you need a reverse PTR record?
The most common use for looking up a PTR record is done by spam filters. Concept behind this idea is that fly by night spammers who send e-mails out using fake domains generally will not have the appropriate reverse PTR setup at the ISP DNS zone.
This criterion is used spam filters to detect spam. If your domain does not have an appropriate reverse PTR record setup then chances are most e-mail spam filtering software will block e-mails from your mail server.
How do you setup a reverse PTR?
You would most likely need to contact your ISP [ BMS technicians generally setup the PTR as soon as they configure your server ].
For example, if your mail server is mail.somedoamin.com then ask your ISP to setup a reverse PTR record 192.168.1.5 (your internet public IP address) in their reverse DNS zone to get resolved to mail.somedomain.com while this target domain mail.somedomain.com should have an A record pointing back to that same IP address.
Bottom Line: If you have a PTR record for your IP address, and the target of the PTR record has an A record pointing back to that same IP address, mail will not be rejected from your server due to an invalid PTR.
Here is a perfect example:
ServerBeach's mail server has an IP address of 220.127.116.11. If you do a PTR lookup on the IP address, you will see that the target of the PTR record is mail.serverbeach.com (18.104.22.168 -> mail.serverbeach.com):
And if you do a DNS query for mail.serverbeach.com, you will see that it has an A record pointing back to 22.214.171.124 (mail.serverbeach.com -> 126.96.36.199):
Mail from mail.serverbeach.com may still be blocked or rejected, but it won't be due to an invalid PTR.
Now, let's look at what happens when a mail server receives mail:
- A mail server receives mail from an IP address.
- The mail server then does a PTR look up on that IP address and retrieves a domain name.
- It then does a DNS lookup on that domain name and retrieves another IP address.
- If that IP address that it retrieves matches the IP address that the mail originated from, the mail passes the Reverse DNS check, and the mail is delivered.
- If the IP's do not match, or a PTR is not set up, or the domain does not resolve, then the mail is not delivered.