Set reverse DNS (PTR) for a mail server on AWS, DigitalOcean, Hetzner and Linode
Updated 10 November 2026 · 5 min read
Short answer
Reverse DNS (a PTR record) is set by whoever owns the IP address, so for a VPS you set it in the cloud provider's console, not at your domain's DNS host. Gmail and Yahoo require the sending IP's PTR hostname to resolve back to the same IP (forward-confirmed reverse DNS). If you send through Google Workspace, Google handles PTR for its own IPs and you don't need to do anything; this guide is for teams running their own mail server or relay.
Where to set it
| Provider | Where | Requirement |
|---|---|---|
| AWS EC2 | Elastic IP → Actions → Update reverse DNS (or ask via the request form) | Needs an Elastic IP and a matching A record first |
| DigitalOcean | Set automatically from the Droplet's name | Name the Droplet with the full hostname, e.g. mail.acme.com |
| Hetzner Cloud | Server → Networking → edit reverse DNS for the IP | Forward A record should already exist |
| Akamai (Linode) | Linode → Network tab → Edit RDNS | A/AAAA record must resolve first |
| Vultr | Server → Settings → IPv4 → reverse DNS |
Worked example
# 1. Forward record at your DNS host
mail.acme.com. A 203.0.113.25
# 2. PTR set in the cloud console for 203.0.113.25
25.113.0.203.in-addr.arpa. PTR mail.acme.com.
# 3. Verify both directions
dig +short -x 203.0.113.25 -> mail.acme.com.
dig +short A mail.acme.com -> 203.0.113.25Gmail's sender guidelines say the sending IP must match the IP of the hostname in the PTR record, and that hostname needs an A (or AAAA) record pointing back to the same IP. Use the same hostname in your server's SMTP HELO/EHLO greeting.
Common mistakes
- Leaving the provider's default PTR (like ec2-203-0-113-25.compute-1.amazonaws.com): it may resolve, but it doesn't name your service and some filters treat it as generic.
- Setting PTR on an IPv4 address but sending over IPv6 without one. Gmail checks the address actually used.
- Forgetting that many cloud providers block outbound port 25 by default; you may need to ask for it to be opened.
Check the result
PTR is about the sending IP; the check covers your domain's records, which matter just as much. Run the domain through the free ReplyDak deliverability check: it reads MX, SPF, DKIM and DMARC live from public DNS, counts SPF lookups and checks the main blocklists, with no sign-up. If your DKIM selector is not a common one, type it into the optional selector box.
Bounced already? See Gmail 5.7.25 (no PTR). More on limits, bounces, blocklists and sender rules: cold email deliverability, one question at a time.
FAQ
Can I set a PTR record at Cloudflare or GoDaddy?
Only for IP ranges delegated to you, which is rare. For a cloud server, set PTR at the cloud provider.
Do I need PTR if I use Google Workspace or Amazon SES?
No. The service sends from its own IPs and manages their reverse DNS.
Should the PTR hostname match my From domain?
It doesn't have to, but it must resolve back to the IP. Using a hostname on your own domain looks more trustworthy.