Reverse DNS turns an IP address back into a hostname. It uses a PTR record. For email, receiving servers look up the PTR of every IP that connects to them and check that the name resolves back to the same IP. Gmail and Yahoo both require valid forward and reverse DNS on sending IPs. If your mail server’s IP has no PTR, or a generic one, expect rejections or spam placement.
If you send through an email API or SMTP relay, you can stop here: the provider owns the sending IPs and sets their PTR records. This page matters if you run your own mail server or send directly from a VPS.
How reverse DNS works
Forward DNS maps a name to an address: mail.acme.com has an A record pointing to 192.0.2.10. Reverse DNS goes the other way. The IP is written backwards under a special domain, and a PTR record there names the host:
10.2.0.192.in-addr.arpa. PTR mail.acme.com.
IPv4 reverse lookups live under in-addr.arpa, defined in RFC 1035. IPv6 uses ip6.arpa, defined in RFC 3596, with each hex digit of the address reversed.
What “valid” reverse DNS means for email
Receivers want forward-confirmed reverse DNS (FCrDNS):
- The sending IP has a PTR record.
- The hostname in that PTR has an A (or AAAA) record.
- That A record points back to the same sending IP.
Two more things help:
- Not generic. Names like
192-0-2-10.dynamic.isp.examplelook like home connections and are treated with suspicion. Use a name that describes a mail host, such asmail.acme.com. - Matches your HELO. Your server introduces itself with
EHLOorHELOand a hostname. Use the same name as the PTR.
What Gmail and Yahoo require
Google’s sender guidelines require, for all senders, that “sending domains or IPs need valid forward and reverse DNS records, also called PTR records”. Yahoo’s sender best practices say to “have a valid forward and reverse DNS record for your sending IPs”. Both apply to everyone, not only bulk senders.
How to check reverse DNS
Use dig (or nslookup on Windows):
# 1. Reverse lookup: which name does the IP point to?
dig +short -x 192.0.2.10
# mail.acme.com.
# 2. Forward lookup: does that name point back to the IP?
dig +short A mail.acme.com
# 192.0.2.10
If step 1 returns nothing, there is no PTR. If step 2 returns a different IP, the check is not forward-confirmed. You can also read the result from a received message: many servers record the PTR name in the Received header, and some add a note when the lookup failed.
To find which IP your mail actually leaves from, look at the top Received header in a message you sent to yourself at Gmail (“Show original”). Our tools page includes a header analyzer for this.
How to set a PTR record
You cannot set a PTR in your own domain’s DNS. Reverse zones belong to whoever was allocated the IP block, so the PTR is set through them:
| Where your server runs | How to set the PTR |
|---|---|
| Cloud provider or VPS | Usually a “reverse DNS” field in the server or IP settings, or a support request |
| Dedicated server host | Control panel or support ticket |
| Office or home connection | Ask your ISP. Many refuse on residential lines, and many receivers block mail from them anyway |
| Your own IP block | In your reverse zone, if it has been delegated to you |
Steps:
- Create the forward record first:
mail.acme.comA192.0.2.10. - Set the PTR for
192.0.2.10tomail.acme.comwith your provider. - Set your mail server’s hostname and HELO name to
mail.acme.com. - Wait for DNS caches to expire, then check with
dig -x.
Some clouds restrict outbound mail. On Amazon EC2, for example, port 25 is throttled by default, and AWS asks you to submit a request to remove the limit.
Reverse DNS on shared and dedicated IPs
On a shared IP from an email provider, the PTR names the provider’s host, not your domain. That is normal and receivers expect it. Your domain is identified by DKIM, SPF and DMARC instead. On a dedicated IP, some providers let you choose the PTR name, which can make logs easier to read, but it does not replace authentication.
Common reverse DNS problems
- No PTR at all. The most common cause on a fresh VPS. Gmail rejects or junks the mail.
- PTR points to the provider’s default name. It may be forward-confirmed, but it looks generic. Set your own.
- PTR and A record disagree. Often after moving a server to a new IP. Update both.
- IPv6 forgotten. If your server sends over IPv6, that address needs a PTR too. If you cannot set one, make the server send over IPv4 only.
- HELO name does not match. A server announcing itself as
localhostor as an internal hostname looks misconfigured.
Should you run your own mail server?
Reverse DNS is one of several things you must get right yourself: IP reputation, blocklist monitoring, TLS, bounce handling and retry queues among them. For app email, most teams use a provider so they never touch PTR records. Mailcandor delivers through Amazon SES, which manages the sending IPs and their DNS. You send over the email API or the SMTP relay and only publish DKIM, SPF and DMARC records for your own domain. See our SPF, DKIM and DMARC guide.