Normal DNS turns names into IPs. Reverse DNS does the opposite: given an IP address, it returns a hostname, using a PTR record. Most websites don’t care about it, but mail servers do. Many receiving servers reject or spam-folder email from IPs without a proper PTR record. If you run a mail server on a VPS, setting reverse DNS is one of the first steps.
How reverse DNS works
Reverse lookups use a special domain. For the IPv4 address 203.0.113.25, the octets are reversed and in-addr.arpa is appended:
25.113.0.203.in-addr.arpa. PTR mail.example.com.
IPv6 uses ip6.arpa, with each hex digit reversed.
Who controls it? Not your domain’s DNS provider. Reverse zones belong to whoever owns the IP block: your hosting provider. That’s why you set PTR records in the provider’s control panel or through support, not at your registrar or Cloudflare.
On VPS.DO, USA VPS plans let you set the PTR for your IP yourself in the client area (Hong Kong and Japan VPS don’t support custom rDNS). See email VPS.
Check reverse DNS
dig -x 203.0.113.25 +short
# mail.example.com.
host 203.0.113.25
# 25.113.0.203.in-addr.arpa domain name pointer mail.example.com.
A generic answer such as 203-0-113-25.provider.net, or no answer at all, means you haven’t set it yet.
Forward-confirmed reverse DNS (FCrDNS)
Receivers usually check that the PTR hostname resolves back to the same IP:
dig -x 203.0.113.25 +short # → mail.example.com.
dig mail.example.com A +short # → 203.0.113.25 ✓ matches
So you need both:
- PTR:
203.0.113.25 → mail.example.com(set at the hosting provider); - A record:
mail.example.com → 203.0.113.25(set at your DNS provider).
What the PTR should be for a mail server
- A fully qualified hostname you control:
mail.example.com. - The same name your mail server announces in its SMTP greeting (HELO/EHLO). In Postfix that’s
myhostname = mail.example.com. - Not a generic or dynamic-looking name. Patterns like
ip-203-0-113-25ordynamiclook like home connections to spam filters. - One PTR per IP. If several domains send from the same server, they can all use the same PTR. It doesn’t need to match each sending domain, only to be consistent and forward-confirmed.
Set the server’s hostname to match. See hostnamectl.
Why it matters for deliverability
| Missing / wrong PTR | Consequence |
|---|---|
| No PTR | Many servers reject outright (550 … no PTR record), others score as spam |
| Generic PTR | Higher spam scores. Some blocklists treat generic rDNS as dynamic IPs |
| PTR doesn’t resolve back (no FCrDNS) | Fails checks at Gmail, Outlook and many others |
| PTR ≠ HELO name | Lower reputation, some rejections |
PTR is one piece of the puzzle, alongside SPF, DKIM, DMARC and IP reputation. See SPF, DKIM and DMARC.
IPv6
If your mail server sends over IPv6, the IPv6 address needs a PTR too, and Gmail is particularly strict about it. If you can’t set IPv6 reverse DNS, make Postfix send over IPv4 only:
# /etc/postfix/main.cf
inet_protocols = ipv4
Other uses of reverse DNS
- Logs and traceroutes show readable names instead of IPs.
- SSH:
UseDNS yesin sshd makes logins wait on reverse lookups. The default is nowno, which avoids slow logins. - Allow-lists: some services verify crawlers (like Googlebot) with reverse plus forward DNS.
Troubleshooting
dig -x still shows the old name. PTR records are cached like any DNS record. Wait for the TTL to expire, or query the provider’s nameserver directly (dig -x IP +trace).
Email still rejected after setting PTR. Check FCrDNS (the A record), the HELO name, SPF, DKIM and DMARC, and whether the IP is on a blocklist (MXToolbox blacklist check).
Quick reference
| Task | Command |
|---|---|
| Reverse lookup | dig -x IP +short |
| Forward check | dig +short hostname A |
| Postfix hostname | myhostname = mail.example.com |
| Set PTR | Hosting provider panel or support (owner of the IP) |
Related: MX records and DNS records explained.