Reverse DNS and PTR records explained: why your mail server needs one
TL;DR: Normal DNS turns a name into an IP address. Reverse DNS does the opposite, using a PTR record. If you run a mail server on a VPS, receiving servers often look up the PTR record for your sending IP and expect it to point to a real hostname that resolves back to the same IP. You cannot set a PTR record in your own DNS panel, because the owner of the IP address controls it, which is your VPS provider. Set the hostname, create the matching A record, ask your provider to set the PTR and test it.
Forward and reverse DNS
When you open a website, DNS translates example.com into an IP address with an A record (or AAAA for IPv6). That is forward DNS.
Reverse DNS goes the other way. Given an IP address, it returns a hostname. The record that stores that answer is a PTR record (pointer record). Our guide to DNS record types covers A, MX, TXT and CNAME. PTR is the one that is easy to overlook, because you rarely touch it.
How a PTR record works
PTR records live in a special reverse zone. For IPv4, the address is written backwards and placed under in-addr.arpa. The IP 203.0.113.10 becomes:
10.113.0.203.in-addr.arpa. IN PTR mail.example.com.
For IPv6, a similar structure uses ip6.arpa. You do not need to build these names by hand, because tools and provider panels do it for you.
Why mail servers check it
Spammers often send from IP addresses with no reverse DNS, or with generic names like 203-0-113-10.dynamic.isp.example. Receiving servers therefore treat a missing or generic PTR as a warning sign.
Large providers are explicit. Gmail's sender guidelines list valid reverse DNS for sending IPs among their requirements, alongside SPF, DKIM and DMARC authentication. Other providers apply similar checks, sometimes silently, by raising your spam score.
The strongest setup is called forward-confirmed reverse DNS (FCrDNS):
- Your IP's PTR record points to a hostname, for example
mail.example.com. - That hostname's A record points back to the same IP.
When both directions agree, the receiver can trust that the IP and name belong together. This is also the name your server should announce in its SMTP greeting (the HELO or EHLO), so the three line up.
Who controls your PTR record
This is the part that confuses people. You cannot add a PTR record in your domain's DNS panel, because the reverse zone belongs to whoever owns the IP address block. That is your hosting or VPS provider, which in turn gets it from a regional internet registry.
So the process is:
- You control the forward record: the A record for
mail.example.com. - Your provider controls the reverse record: the PTR for your IP.
Most VPS providers offer a setting in the control panel, often labelled "reverse DNS", "rDNS" or "PTR". Others require you to open a support ticket. If your provider offers neither, you cannot run a reliable mail server on that IP.
How to set up reverse DNS on a VPS
- Choose a hostname for the mail server, such as
mail.example.com. Use a hostname under a domain you control, not a generic one. - Create the A record. In your DNS panel, point
mail.example.comto the server's IPv4 address. If you use IPv6, add an AAAA record too. - Set the system hostname on the server so the SMTP greeting uses it:
sudo hostnamectl set-hostname mail.example.com
- Ask your provider to set the PTR for the IP to
mail.example.com, through the control panel or a ticket. For IPv6, set the PTR for that address as well. - Wait for DNS to update, usually minutes but sometimes longer. See how long DNS changes take.
- Check it using the commands below.
- Finish email authentication. A PTR record is only one part. Make sure SPF, DKIM and DMARC are in place, as explained in why business emails go to spam.
How to check it
From any machine with dig or nslookup:
dig -x 203.0.113.10 +short
dig mail.example.com +short
The first command should return mail.example.com. and the second should return 203.0.113.10. If they match, forward-confirmed reverse DNS is working.
On Windows:
nslookup 203.0.113.10
You can also send a test message to a Gmail address and read the headers, or use an online mail tester that reports PTR status. If your outgoing mail still fails, review the full set of records in our email deliverability guides.
Common problems
- No PTR at all. The provider never set one. Request it.
- Generic PTR. It still shows something like
vps123.provider.example. Replace it with your own hostname. - PTR does not match the A record. The name points to one IP, but the IP points to a different name. Align both.
- Several domains on one IP. An IP can only have one PTR hostname normally. Pick a neutral one, such as the mail server's own name, and use SPF and DKIM per domain.
- HELO name does not match. Set your mail software to announce the same hostname.
- IPv6 ignored. If your server sends over IPv6, it needs its own PTR. Many problems come from the IPv6 path having none.
- Shared or blocklisted IP. A perfect PTR cannot fix a bad IP reputation. Check the IP on blocklists.
Do websites need a PTR record?
Not for ordinary web traffic. Browsers do not check reverse DNS. A website on a shared plan works fine with whatever PTR the provider uses. PTR matters when your server sends mail directly, and in some logging, monitoring and SSH setups where reverse lookups are used.
If you run a website and send mail through a transactional email service or your mailbox provider, that service's IPs already have correct reverse DNS. You only need to manage PTR yourself if you run your own mail server. For most small businesses, a managed mailbox is simpler, as our comparison of Google Workspace and hosting email explains.
FAQs
What is a PTR record?
A DNS record that maps an IP address to a hostname. It is the basis of reverse DNS lookups.
Can I add a PTR record in my domain's DNS?
Usually not. The owner of the IP address, normally your VPS or hosting provider, controls it.
Why does my mail go to spam without reverse DNS?
Receiving servers treat a missing or generic PTR as a sign of a dynamic or compromised host and raise the spam score or reject the message.
What is forward-confirmed reverse DNS?
When the PTR hostname resolves back, through an A record, to the same IP. Both directions agree.
Do I need a PTR record for IPv6?
Yes, if you send mail over IPv6. Each sending IP, v4 or v6, should have reverse DNS.
Does a PTR record help SEO?
No. Search engines do not use it. It matters for email and some network tools.
How do I check my PTR record?
Run dig -x YOUR_IP +short, then check the returned hostname's A record points back to the same IP.
Can one IP have several PTR records?
It can, but it is discouraged, and many mail servers expect one. Use a single, stable hostname.
Conclusion
Reverse DNS is a small record with an outsized effect on mail. Pick a proper hostname, create the matching A record, ask your provider to set the PTR, confirm both directions agree and then finish SPF, DKIM and DMARC. If you only run a website, you can ignore it. If you run a mail server on a VPS, it is one of the first things to fix.
HostCloud's VPS and DNS services help you get the records right. See the options at https://hostcloud.in.
Sources: