DNS and authentication

Reverse DNS (PTR records) for email servers

Short answer

Reverse DNS maps an IP address back to a hostname using a PTR record. Mail servers check it on every incoming connection, and Gmail and Yahoo require sending IPs to have valid forward and reverse DNS: the IP's PTR names a host, and that host resolves back to the same IP. The PTR is set by whoever owns the IP, usually your hosting provider, not in your domain's DNS. If you send through an email API, the provider already handles it.

Last checked 16 November 2026

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):

  1. The sending IP has a PTR record.
  2. The hostname in that PTR has an A (or AAAA) record.
  3. That A record points back to the same sending IP.

Two more things help:

  • Not generic. Names like 192-0-2-10.dynamic.isp.example look like home connections and are treated with suspicion. Use a name that describes a mail host, such as mail.acme.com.
  • Matches your HELO. Your server introduces itself with EHLO or HELO and 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:

  1. Create the forward record first: mail.acme.com A 192.0.2.10.
  2. Set the PTR for 192.0.2.10 to mail.acme.com with your provider.
  3. Set your mail server’s hostname and HELO name to mail.acme.com.
  4. 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 localhost or 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.

Questions

Do I need a PTR record to send email?

If you run your own mail server, yes. Gmail and Yahoo require valid forward and reverse DNS on sending IPs. If you send through an email API or relay, the provider's IPs already have PTR records.

Where do I add a PTR record?

With whoever controls the IP address, usually your cloud or hosting provider, often in the server's network settings or by support ticket. Adding a PTR in your own domain's DNS zone does nothing.

How do I check reverse DNS for an IP?

Run dig -x followed by the IP. Then look up the hostname it returns and make sure it points back to the same IP.

Should the PTR hostname match my From domain?

It does not have to. It should be a real hostname that resolves back to the IP, and it should match the name your server uses in its HELO or EHLO greeting.

What is forward-confirmed reverse DNS?

It means the IP's PTR points to a hostname, and that hostname's A or AAAA record points back to the same IP. Receivers trust this more than a PTR alone.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.