Large mailbox providers look up the PTR record of the IP that delivers a message. If it is missing, generic, or does not match a hostname that points back to the same IP, mail goes to spam or bounces. This guide is the hands-on check-and-fix; the concept is explained in what is reverse DNS.
Before you start
- A server that sends mail directly (a VPS or dedicated server). On MdmHost shared and reseller hosting, rDNS for the server IP is already managed for you.
- A hostname you control, such as
mail.example.comorserver1.example.com. - Access to the zone for that domain (Zone Editor) and to your VPS panel or support.
Find the IP your mail is sent from
Send a message to a Gmail account, open it, choose Show original and look at the first Received: from line added by Google. The IP there is your sending IP. On the server you can also check:
curl -4 ifconfig.me
curl -6 ifconfig.meNote: If the server has IPv6, Gmail will often receive over IPv6. Then the IPv6 address needs a PTR too, or you must make the mail server send over IPv4 only.
Check the current PTR
dig +short -x 203.0.113.25A good result is a real hostname like mail.example.com.. Bad results are an empty answer or a generic name like 203-0-113-25.provider.net.
Make forward and reverse DNS match (FCrDNS)
- Create the A record: in your DNS zone add
mail.example.com→203.0.113.25(and an AAAA record for IPv6 if used). - Set the PTR: only the owner of the IP block can do this. In Virtualizor use the rDNS option (set reverse DNS in Virtualizor); otherwise open a ticket with the IP and the hostname.
- Set the server hostname to the same name and use it as the mail server's HELO name (set hostname and reverse DNS). In WHM, the hostname is under Networking Setup → Change Hostname.
Verify
dig +short -x 203.0.113.25
dig +short mail.example.com AThe first must return mail.example.com., the second 203.0.113.25. Then test the SMTP banner:
telnet mail.example.com 25The 220 greeting should show the same hostname. PTR changes can take a few hours to be seen everywhere because of caching.
Do not forget SPF, DKIM and DMARC
rDNS is only one part of sender trust. Publish SPF, DKIM and DMARC too: set up SPF, DKIM and DMARC in cPanel.
Troubleshooting
- Bounce says "PTR record setup" or "550 5.7.25": the IPv6 address lacks a PTR. Add one or force IPv4 for SMTP.
- PTR correct but mail still in spam: check the IP on blocklists and your authentication results in the message headers.
- Several domains on one server: a PTR holds one hostname. Use the server hostname, not each customer domain.
