Quick Answer

A PTR (pointer) record maps your server's IP address back to its hostname — the reverse of an A record. For email servers, the PTR record must point to your mail hostname (e.g., mail.yourdomain.com), which must match your EHLO hostname and have a matching A record. PTR records are set in your VPS provider's control panel, not your DNS provider. Without a correct PTR record, Gmail, Yahoo, and most providers will reject or spam your email.

PTR Record Setup for Self-Hosted Email Servers

By Braedon·Mailflow Authority·Self-Hosted SMTP

PTR Records: Reverse DNS for Mail Servers

A PTR record is the reverse of an A record. An A record says "mail.yourdomain.com lives at IP 1.2.3.4." A PTR record says "IP 1.2.3.4 is mail.yourdomain.com." Receiving mail servers check both directions to verify your server's identity.

Without a correct PTR record, your self-hosted email will be rejected or spam-foldered by most major providers. This is one of the first things to configure on any mail server. For general PTR knowledge, see our PTR records guide and DNS configuration guide.

The PTR Chain

Your PTR must form a complete forward-confirmed reverse DNS (FCrDNS) chain:

1. Your IP (1.2.3.4) → PTR → mail.yourdomain.com
2. mail.yourdomain.com → A record → 1.2.3.4
3. Postfix myhostname → mail.yourdomain.com
4. SMTP EHLO → mail.yourdomain.com

All four must match. If any link is broken, receiving servers flag it as suspicious.

Verifying Your PTR Record

# Check PTR record
dig -x 1.2.3.4 +short
# Expected: mail.yourdomain.com.

# Verify forward DNS matches
dig mail.yourdomain.com A +short
# Expected: 1.2.3.4

# Check what your server announces
# Connect to your own server:
telnet mail.yourdomain.com 25
# Look for: 220 mail.yourdomain.com ESMTP Postfix

# Or check Postfix hostname:
postconf myhostname
# Expected: mail.yourdomain.com

Setting PTR Records by Provider

Hetzner Cloud

  1. Log into Hetzner Cloud Console
  2. Select your server
  3. Click Networking tab
  4. Under IPv4, click the IP address
  5. Click Edit Reverse DNS
  6. Enter mail.yourdomain.com
  7. Save — takes effect within minutes

DigitalOcean

  1. Log into DigitalOcean Control Panel
  2. Go to NetworkingDomains
  3. DigitalOcean sets PTR based on the droplet name
  4. Rename your droplet to mail.yourdomain.com
  5. Or use the API:
    curl -X POST "https://api.digitalocean.com/v2/domains/yourdomain.com/records" \
      -H "Authorization: Bearer $DO_TOKEN" \
      -d '{"type":"PTR","name":"1.2.3.4","data":"mail.yourdomain.com"}'
    

Vultr

  1. Log into Vultr Console
  2. Select your instance
  3. Click SettingsIPv4
  4. Click Reverse DNS next to your IP
  5. Enter mail.yourdomain.com
  6. Save — propagates within minutes

OVH

  1. Log into OVH Control Panel
  2. Go to Bare Metal CloudIP
  3. Click the gear icon next to your IP
  4. Select Modify Reverse
  5. Enter mail.yourdomain.com
  6. Confirm — may take up to 24 hours

Common PTR Mistakes

Wrong Hostname

# Wrong: points to VPS default
PTR → vps12345.hetzner.com

# Wrong: points to bare domain
PTR → yourdomain.com

# Correct: points to mail subdomain
PTR → mail.yourdomain.com

Forward/Reverse Mismatch

# Broken: PTR says mail.yourdomain.com but A record is different
PTR: 1.2.3.4 → mail.yourdomain.com
A:   mail.yourdomain.com → 5.6.7.8  ← Different IP!

# Fixed: both point to same IP
PTR: 1.2.3.4 → mail.yourdomain.com
A:   mail.yourdomain.com → 1.2.3.4  ← Same IP

EHLO Mismatch

# Check Postfix EHLO hostname
postconf myhostname
# If this doesn't match your PTR, fix it:
sudo postconf -e "myhostname = mail.yourdomain.com"
sudo systemctl restart postfix

IPv6 PTR Records

If your server has IPv6 and Postfix is configured to use it for outbound email, you need an IPv6 PTR record too. Many providers include IPv6 by default.

Option 1: Set the IPv6 PTR record (same process as IPv4)

Option 2: Disable IPv6 for outbound SMTP in Postfix:

# /etc/postfix/main.cf
inet_protocols = ipv4

This is the simpler option if you don't need IPv6 email delivery.

Practitioner note: I always disable IPv6 for outbound SMTP on self-hosted servers unless the client specifically needs it. IPv6 PTR records are another thing that can break, and IPv6 IP reputation is less established. One fewer thing to manage, one fewer thing to troubleshoot.

Practitioner note: The number one PTR-related issue I fix is people who configured everything correctly initially but later migrated to a new IP and forgot to update the PTR. The old PTR points to a different server, the new IP has no PTR, and suddenly all email goes to spam. If you change IPs, update PTR immediately.

If you need help configuring PTR records or diagnosing DNS issues on your mail server, schedule a consultation — I'll verify your entire DNS chain is consistent and correct.

Sources


v1.0 · April 2026

Frequently Asked Questions

Why is a PTR record required for email?

Receiving mail servers check your PTR record as a basic identity verification. The logic: if you control the server (and therefore its IP), you should have set up reverse DNS properly. Missing or mismatched PTR records are a strong spam signal — they indicate a hastily configured or compromised server.

Where do I set the PTR record?

At your VPS provider, not your DNS provider. The PTR record belongs to the IP address, which is owned by the VPS provider. You set it through their control panel — Hetzner Cloud Console, DigitalOcean Networking, Vultr Server Settings, or OVH IP Management.

What should my PTR record say?

Your mail server's fully qualified domain name — typically mail.yourdomain.com. This must match your Postfix myhostname setting and your EHLO hostname. And mail.yourdomain.com must have an A record pointing back to the same IP. The chain: IP → PTR → hostname → A record → same IP.

How long does a PTR record take to propagate?

Usually minutes to a few hours, depending on the provider. Hetzner and DigitalOcean are nearly instant. Some providers take up to 24 hours. Test with 'dig -x YOUR.IP' from an external server to verify propagation.

Do I need a PTR record for IPv6?

Yes, if your server sends email over IPv6. Many self-hosted setups disable IPv6 for email to simplify configuration. If you send over IPv6, you need both IPv4 and IPv6 PTR records.

Want this handled for you?

Free 30-minute strategy call. Walk away with a plan either way.