A PTR record is the reverse of an A record: it maps an IP address to a hostname. Mail servers look up the PTR record of the IP address that connects to them, because a sending IP with no reverse DNS, or with a generic name that does not match, is a common sign of a compromised machine or a poorly run server. For email you want every sending IP to have a PTR record with a real hostname that resolves back to the same IP.
You cannot set a PTR record in your domain's DNS zone, in the usual case. Reverse records live in a zone owned by whoever controls the IP block, normally your hosting provider, cloud platform or ISP. You request or set the record through them. The sections below show how the lookup works, how to ask for the right record, how to verify it, and how to fix the usual mismatches.
How reverse DNS works
Reverse lookups use special zones. For IPv4, the address is written backwards and .in-addr.arpa is appended. For IPv6, each hex digit (nibble) is written backwards and .ip6.arpa is appended. The documentation addresses below are reserved for examples.
| IP address | Reverse name |
|---|---|
203.0.113.25 | 25.113.0.203.in-addr.arpa |
2001:db8::25 | 5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa |
25.113.0.203.in-addr.arpa. 3600 IN PTR mail.example.com.Authority follows ownership of the address block. The provider holds the zone, or delegates a small block to you. For blocks smaller than a /24, delegation uses the method in RFC 2317, so your provider may ask you to confirm the hostname instead of giving you a zone to edit.
What receivers check
- A PTR record exists. Some receivers reject or heavily penalise connections from IPs without one.
- Forward-confirmed reverse DNS (FCRDNS). The PTR hostname must resolve by A or AAAA back to the connecting IP. See FCRDNS.
- A sensible name. Names built from the IP, such as
203-0-113-25.dyn.example.net, mark dynamic or residential ranges and are often scored down or blocked. - HELO consistency. The name in your
EHLOcommand should be a hostname that resolves to the sending IP, ideally the same as the PTR name. See reverse DNS and the HELO name. - One PTR per IP. Several PTR records on one address cause inconsistent results and should be avoided.
Reverse DNS is one of several signals. It does not replace SPF, DKIM and DMARC, which authenticate the domain, and it does not by itself build reputation. See domain versus IP reputation and email authentication explained.
How to check reverse DNS
# IPv4 lookup
dig -x 203.0.113.25 +short
# mail.example.com.
# IPv6 lookup
dig -x 2001:db8::25 +short
# Forward check: the name must return the same IP
dig +short A mail.example.com
dig +short AAAA mail.example.com
# Alternatives
host 203.0.113.25
nslookup 203.0.113.25The check passes when the first command returns your hostname and the forward lookup returns the original IP. Run it for every IP your mail server can use to connect out, including IPv6, since receivers see whichever family the connection uses. On a server that sends on both, either publish matching PTR and AAAA records or disable IPv6 delivery until you have. See IPv6 email sending.
How to set a PTR record
- Choose the hostname. Use a name in a domain you control and that you are happy to be seen in headers, such as
mail.example.comormta1.example.com. Use a different name per IP if you have several. - Create the forward record first. Add an A record (and AAAA if you use IPv6) for that name pointing to the sending IP.
- Request or set the PTR. Find out who owns the IP. On many cloud and VPS platforms there is a reverse DNS or hostname setting for each IP address in the control panel. Where there is not, open a support request with the IP and hostname. Interfaces and rules differ, so follow your provider's current documentation.
- Wait for propagation. Once set, lookups usually update within the record's TTL, though caches elsewhere can lag.
- Set the server's HELO name to match. Configure the mail server to announce the same hostname.
- Verify with dig and a test message. Check the Received headers of a delivered test for the expected name.
Aligning the HELO name in common MTAs
# Postfix: /etc/postfix/main.cf
myhostname = mail.example.com
smtp_helo_name = $myhostname
# Exim: main configuration
smtp_active_hostname = mail.example.com
# in the remote_smtp transport
helo_data = mail.example.comReload the service after the change. Note that some hosting environments set the system hostname at boot, so confirm that the change survives a restart. If you use a relay or a hosted sending service, the provider's IP addresses have their own PTR records and you do not manage them. Check this with your provider. Details on MTAs are in mail transfer agents.
One IP, many sending domains
A single server often sends for several domains. That is normal: the PTR and HELO name identify the machine, not each customer domain. Use one stable hostname for the IP and let SPF, DKIM and DMARC carry the identity of each sending domain. You do not need a separate PTR per domain, and you cannot have more than one useful PTR on an address anyway. What matters is that the visible From domain is authenticated and aligned, as explained in DMARC alignment. If you manage several brands, see sending subdomain strategy.
When you change the IP, retire a server or move to another provider, treat the PTR as part of the migration checklist. The new IP needs its own PTR, forward record and HELO name before any volume moves, and the old PTR should be removed when you release the address so it does not mislead whoever receives it next. Document the hostname-to-IP table in your runbook so that a rebuild does not silently revert to a generic provider name.
Mistakes to avoid
| Mistake | Why it hurts | Fix |
|---|---|---|
| Generic provider name left in place | Looks like a dynamic or shared hosting range | Request a custom hostname |
| PTR name does not resolve forward | Fails FCRDNS | Add the matching A or AAAA record |
| PTR points to a hostname with a CNAME | Resolvers and checks may fail or behave inconsistently | Point the A record straight at the IP |
| HELO says localhost or a bare name | Rejected by many receivers | Use the fully qualified PTR hostname |
| Several IPs, one shared name | Not every IP confirms | Give each IP its own name, or confirm all A records include each IP |
| Forgot the IPv6 address | Mail over IPv6 fails reputation checks | Set a PTR for IPv6 or send over IPv4 only |
| Changed IP without updating PTR | New IP has the old or no hostname | Update the PTR with every IP change |
Troubleshooting
| Symptom | What to check |
|---|---|
| Bounce mentions no reverse DNS or PTR | Run dig -x on the sending IP; request the record from the IP owner |
| Gmail or Microsoft rejects the connection | Check FCRDNS, SPF, DKIM and DMARC together. See bulk sender requirements |
| Blocklist listing mentions generic rDNS | Fix the PTR first, then request delisting. See delisting guide |
| PTR changed but old value appears | Wait for the TTL to expire, and query the authoritative server |
| Cannot find where to edit the PTR | You do not own the zone: ask the IP provider |
You can look up whether a sending IP is listed on common blocklists with the blocklist check, and compare your identity records with the SPF, DKIM and DMARC checker.
When this matters and next steps
Reverse DNS matters whenever you send from IP addresses you control: a dedicated server, a VPS or a dedicated IP at a provider. If you send through a relay, the provider handles it for the relay IPs. Before you start sending volume from a new IP, set the PTR, align the HELO name, publish SPF, DKIM and DMARC and warm the address up. See dedicated versus shared IPs, warming up a new domain or IP and DNS records for email.
Skip the reverse DNS work Send through MigoSMTP on smtp.migosmtp.com and let the service manage sending IP identity while you authenticate your own domain.
References and further reading
Frequently asked questions
What is a PTR record?
A PTR record maps an IP address to a hostname. It is the reverse of an A or AAAA record and is stored in the in-addr.arpa or ip6.arpa zones.
Why do mail servers check reverse DNS?
A missing or generic PTR often indicates a dynamic, compromised or poorly managed host, so many receivers penalise or reject such connections.
Who can set my PTR record?
The owner of the IP block, usually your hosting provider, cloud platform or ISP. It is not edited in your own domain zone.
What is forward-confirmed reverse DNS?
It means the PTR hostname of an IP resolves by A or AAAA back to the same IP address, confirming the two records agree.
How do I check my PTR record?
Run dig -x with your IP address, then look up the returned hostname and confirm it resolves to the same IP.