How to Set Up Reverse DNS PTR Record for Email

Setting up reverse DNS PTR records is one of those small tasks that has an outsized effect on email deliverability. Many providers — Gmail, Microsoft, and most corporate mail gateways — reject or heavily penalize mail from IPs with no PTR record. If you run your own mail server, this is a five-minute job you should do before sending anything.

Reverse DNS is simply the opposite of normal DNS: instead of resolving a hostname to an IP address, it resolves an IP address back to a hostname. That mapping is stored in a PTR (pointer) record, and receivers use it to verify that your server is who it claims to be.

Why Reverse DNS PTR Matters for Email

When your mail server connects to Gmail, one of the first things Gmail does is a reverse lookup on your IP. It then does a forward lookup on the returned hostname to confirm it resolves back to the same IP — this is called forward-confirmed reverse DNS (FCrDNS). If either check fails, your message starts with a trust deficit.

In practice, missing or mismatched PTR records cause:

  • Outright rejection by strict receivers with errors like 450 4.7.25 Client host rejected: cannot find your reverse hostname.
  • Higher spam scores at filters that do score-based filtering.
  • Failed warmup, since you are trying to build reputation with a technically broken identity.

SPF, DKIM, and DMARC authenticate your domain; PTR authenticates your server. You need both.

How to Set Up Reverse DNS (PTR Record) for Email Servers

Unlike normal DNS records, PTR records are not managed in your domain's DNS zone — they live in the zone owned by whoever controls the IP block, which is almost always your hosting provider. That means you set PTR through your VPS provider's control panel (or by opening a support ticket), not through your DNS registrar.

Step 1: Choose Your Mail Hostname

Pick a fully qualified hostname for your mail server, for example mail.yourdomain.com. This hostname should:

  • Be a real, resolvable name — not a placeholder like localhost.
  • Match the HELO/EHLO banner your MTA sends.
  • Match the hostname in your TLS certificate if you use one for SMTP.

Step 2: Create the Forward (A) Record

In your domain's DNS zone, add an A record pointing the mail hostname to your server's IP:

mail.yourdomain.com. 3600 IN A 203.0.113.10

This must exist before you set the PTR record — many providers validate that forward DNS resolves before accepting your PTR request.

Step 3: Set the PTR Record at Your Hosting Provider

Log in to your provider's control panel and find the reverse DNS / PTR setting for your IP (on Contabo it is under the IP management section; on OVH it is in the dedicated server/VPS network settings). Set it to your mail hostname, e.g. mail.yourdomain.com.

If your provider does not offer a self-service option — some budget hosts do not — open a support ticket with your IP and the desired hostname. Most providers set it within a few hours. This is worth checking before you commit to a host: providers popular with mail operators like Contabo and KnownHost let you manage PTR records yourself from the panel.

Step 4: Configure Your MTA's HELO Banner

Your mail server must introduce itself with the same hostname. In Postfix:

smtpd_banner = $myhostname ESMTP
myhostname = mail.yourdomain.com

In PowerMTA, set the smtp-hostname directive in your virtual MTA configuration to match. A mismatched banner is a classic rookie mistake that undermines the whole PTR setup.

Verifying Your Reverse DNS PTR Record

After the change propagates (usually minutes to a few hours), verify your reverse DNS PTR record from the command line:

dig +short -x 203.0.113.10
dig +short mail.yourdomain.com

The first command should return mail.yourdomain.com. and the second should return 203.0.113.10. If both match, you have forward-confirmed reverse DNS — the gold standard.

Also test with a real message: send to [email protected] and confirm the report shows a passing reverse DNS check, or inspect the Received headers in Gmail's “Show original” view.

Common Reverse DNS PTR Mistakes

Using the provider's default PTR. Fresh VPS IPs often come with a generic PTR like vps123.hostingprovider.net. Technically valid, but it looks unprofessional and does not match your HELO banner — set your own.

PTR pointing to a hostname that does not resolve back. If you set PTR to mail.yourdomain.com but forget the A record, FCrDNS fails and you are arguably worse off than before.

One PTR per IP. An IP can only have one PTR record. If you host multiple domains on one server, pick one mail hostname for the IP and use it consistently — you can still send from many domains over that IP.

Assuming IPv6 is covered. If your server sends over IPv6, that address needs its own PTR record too. Either configure it or restrict outbound mail to IPv4 until you do.

Key Takeaways

  • A missing or mismatched reverse DNS PTR record gets mail rejected or spam-foldered at major providers.
  • PTR records are set at your hosting provider, not in your domain's DNS zone.
  • Forward DNS (A record), PTR record, and MTA HELO banner must all use the same hostname.
  • Verify with dig -x and confirm forward-confirmed reverse DNS.
  • One IP = one PTR record; set up IPv6 PTR too if you send over IPv6.

Related Guides

Leave a Comment