Skip to content
Infrastructure5 min read

Reverse DNS (PTR Records) for Email Servers

Reverse DNS maps IP addresses back to hostnames and is a critical component of email server configuration. Without proper PTR records, your emails may be rejected or marked as spam.

What is Reverse DNS?

Regular DNS (forward DNS) translates domain names to IP addresses. For example, mail.example.com might resolve to 203.0.113.25.

Reverse DNS does the opposite: it maps an IP address back to a hostname. This is accomplished through PTR (pointer) records stored in a special DNS zone.

How It Works

Forward DNS: mail.example.com → 203.0.113.25

Reverse DNS: 203.0.113.25 → mail.example.com

PTR records are stored in special reverse DNS zones. For IPv4, these use the in-addr.arpa domain with the IP address reversed. For example, a PTR record for 203.0.113.25 would be stored at 25.113.0.203.in-addr.arpa.

Why PTR Records Matter for Email

When your mail server connects to deliver an email, the receiving server often performs a reverse DNS lookup on your IP address. This is one of the first checks in the spam filtering process.

Spam Filter Requirement

Many mail servers reject connections from IPs without valid PTR records. This is a baseline anti-spam measure.

Server Identity Verification

PTR records help verify that a mail server is who it claims to be, not a compromised machine or botnet node.

Professional Infrastructure Signal

A properly configured PTR record signals that you operate legitimate email infrastructure, not a throwaway server.

Without a PTR record, major email providers like Gmail, Microsoft, and Yahoo may reject your emails outright or significantly reduce your sender reputation.

Forward-Confirmed Reverse DNS (FCrDNS)

It's not enough to just have a PTR record—it must match your forward DNS. This is called Forward-Confirmed Reverse DNS (FCrDNS).

# The PTR record must point to a hostname...
203.0.113.25 → mail.example.com

# ...that resolves back to the same IP
mail.example.com → 203.0.113.25

This two-way verification ensures that:

  1. The IP address has a PTR record pointing to a hostname
  2. That hostname has an A record (or AAAA for IPv6) pointing back to the same IP

If these don't match, many receiving servers will treat your email with suspicion or reject it entirely.

How to Set Up PTR Records

Important: Only the owner of the IP address can create PTR records. This is typically your hosting provider, VPS provider, or ISP—not your domain registrar.

The process varies depending on your hosting setup:

Cloud Providers (AWS, GCP, Azure)

Most cloud providers allow you to set PTR records through their control panel or API. Look for "reverse DNS" or "PTR record" settings associated with your elastic/static IP.

VPS Providers (DigitalOcean, Linode, Vultr)

These typically provide a field to set your PTR record in the droplet/instance settings. Some automatically set it based on your server's hostname.

Dedicated Servers / Colocation

Contact your provider's support and request they set the PTR record for your IP address. You'll need to provide:

  • The IP address
  • The hostname it should resolve to (e.g., mail.example.com)

Home/Office ISP

Most residential ISPs don't allow custom PTR records and actively block outbound port 25. Running a mail server on a residential connection is not recommended.

Checking Your PTR Record

You can verify your PTR record using the dig command with the -x flag:

# Check PTR record for an IP address
dig -x 203.0.113.25

# Or use the host command
host 203.0.113.25

# Expected output shows the hostname
25.113.0.203.in-addr.arpa. PTR mail.example.com.

Then verify the forward DNS matches:

# Verify the hostname resolves to the same IP
dig +short mail.example.com

# Should return:
203.0.113.25

You can also use online tools like MXToolbox, DNSChecker, or our domain scanner to verify your PTR configuration.

Common PTR Record Issues

Missing PTR Record

Symptom: Emails rejected with messages like "no PTR record" or "reverse DNS lookup failed"

Solution: Contact your hosting provider to set up a PTR record for your mail server's IP address.

Mismatched Hostname

Symptom: PTR exists but forward DNS doesn't match, causing FCrDNS failure

Solution: Ensure your PTR record points to a hostname that has an A record resolving back to the same IP.

Generic Hostname

Symptom: PTR shows something like "203-0-113-25.dynamic.provider.net"

Solution: Request a custom PTR record that matches your actual mail server hostname.

IPv6 PTR Missing

Symptom: IPv4 works fine but IPv6 connections are rejected

Solution: If your server has an IPv6 address, you need a PTR record for that too. Consider disabling IPv6 for outbound mail if you can't set the PTR.

Summary

  • 1.PTR records map IP addresses back to hostnames (reverse DNS)
  • 2.Email servers check PTR records to verify sender legitimacy
  • 3.Your PTR must match your forward DNS (FCrDNS)
  • 4.Only your IP owner (hosting provider) can set PTR records
  • 5.Use dig -x to verify your PTR configuration

Resources

Check Your Email Infrastructure

Use our scanner to verify your PTR records and other email authentication settings including SPF, DKIM, and DMARC.

Scan Your Domain