Normal DNS turns a name into an IP address. Reverse DNS does the opposite: it turns an IP address into a name. Most of the time nobody notices it — but if you run a mail server, reverse DNS decides whether your messages are accepted, filtered as spam, or rejected outright. It also makes logs, traceroutes and security tools easier to read.
How reverse DNS works
Reverse lookups use a special domain, in-addr.arpa, with the IP address written backwards. For 203.0.113.20 the lookup is:
20.113.0.203.in-addr.arpa. PTR mail.example.com.
The important consequence: the PTR record is controlled by whoever owns the IP address block — your hosting provider — not by your domain’s DNS provider. You cannot add a PTR record in Cloudflare or your registrar’s DNS panel; you set it with your hosting provider, through a control panel or a support request.
Check reverse DNS
dig -x 203.0.113.20 +short
host 203.0.113.20
Windows:
nslookup 203.0.113.20
A generic answer such as 203-0-113-20.provider.net or no answer at all means no custom PTR has been set.
Forward-confirmed reverse DNS (FCrDNS)
Receiving mail servers usually check that reverse and forward DNS agree:
- Reverse:
203.0.113.20→mail.example.com - Forward:
mail.example.com→203.0.113.20
If both match, the IP has forward-confirmed reverse DNS. That is what you want. A PTR pointing to a name that does not resolve back to the same IP is nearly as bad as having none.
dig -x 203.0.113.20 +short # mail.example.com.
dig mail.example.com A +short # 203.0.113.20
Why mail servers care
Spam often comes from compromised home computers and servers with generic or missing reverse DNS. Receivers therefore treat these signals as suspicious:
| Situation | Typical result |
|---|---|
| No PTR record | Rejected by many providers, or strong spam score |
Generic PTR (ip-203-0-113-20.provider.net) |
Higher spam score; some rejections |
| PTR set, forward does not match | Often treated like no PTR |
| FCrDNS matches and HELO uses the same name | Expected baseline for a mail server |
Major providers’ sender guidelines explicitly require valid forward and reverse DNS for sending IPs.
Choosing the hostname
Pick a name in a domain you control that identifies the server, for example mail.example.com or mx1.example.com. Then make three things consistent:
- A record:
mail.example.com→203.0.113.20(in your domain’s DNS). - PTR record:
203.0.113.20→mail.example.com(with your hosting provider). - Mail server hostname / HELO: the server introduces itself as
mail.example.com.
For Postfix:
# /etc/postfix/main.cf
myhostname = mail.example.com
smtp_helo_name = $myhostname
And the system hostname:
sudo hostnamectl set-hostname mail.example.com
One IP can have only one PTR record in practice. If the server sends mail for several domains, that is fine — the PTR identifies the server, not every domain it sends for. SPF, DKIM and DMARC handle per-domain authentication; see SPF, DKIM and DMARC.
Setting rDNS at Server.HK
On US VPS, you can set the reverse DNS (PTR) of your IP yourself in the control panel. This is the product designed for mail use — ports 25, 465 and 587 are open there. Steps in general:
- Create the A record for your chosen hostname first and wait until it resolves.
- In the VPS control panel, open the network/IP section and set the reverse DNS for the IP to that hostname.
- Wait for the change to take effect (usually minutes; caches may hold old answers up to their TTL) and verify with
dig -x.
Other products (Hong Kong and Japan VPS, dedicated servers) do not support custom rDNS, and outbound mail ports are blocked there by default. The reverse DNS must point to a hostname you control; using rDNS to impersonate other domains or mail servers is prohibited, and spam from a VPS leads to suspension. Details are in our Acceptable Use Policy and FAQ.
IPv6
If your mail server has IPv6 and sends over it, the IPv6 address also needs a matching PTR record (under ip6.arpa) and AAAA record. Many providers reject IPv6 mail without it. If you cannot set IPv6 rDNS, configure the mail server to send over IPv4 only (Postfix: inet_protocols = ipv4).
Other uses of reverse DNS
- Logs and monitoring: readable names in
last, web server logs (if resolved) and traceroutes. - Security tools and some services check PTR records as one signal of legitimacy.
- Network troubleshooting: router PTR names in MTR reports often reveal city and carrier.
Troubleshooting
| Problem | Check |
|---|---|
dig -x shows the old or generic name |
Change not applied yet, or cached — wait for TTL, check again |
| Control panel refuses the hostname | The A record must exist and point to the same IP first |
| Mail still rejected with “no reverse DNS” | Receiver may cache; also check IPv6 if the server sends over IPv6 |
| Mail rejected for HELO | smtp_helo_name / hostname not a fully qualified name that resolves |