WhatsApp
Back to Blog

How to Fix Reverse DNS / PTR Issues

Fix reverse DNS and PTR record issues that cause email rejection, spam filtering, and failed rDNS lookups with step-by-step solutions.

Reverse DNS (rDNS) is a DNS lookup that resolves an IP address back to a hostname. A PTR record is the DNS record that makes this possible. When your server's IP doesn't have a valid PTR record — or the PTR doesn't match your sending domain — receiving mail servers will reject or flag your emails as spam.

This guide covers how to diagnose and fix reverse DNS / PTR issues for your VPS or dedicated server.

Quick Fix Checklist

  • ✅ Check if your IP has a PTR record: dig -x YOUR_IP
  • ✅ Verify the PTR matches your mail server hostname
  • ✅ Ensure the hostname has a matching A record pointing back to the IP
  • ✅ Contact your hosting provider if you can't set PTR yourself
  • ✅ Wait for DNS propagation (up to 24-48 hours)
  • ✅ Test with MXToolbox or dig after changes

What Is Reverse DNS / PTR?

Forward DNS vs Reverse DNS

Forward DNS resolves a hostname to an IP address (A record). Reverse DNS does the opposite — it resolves an IP address back to a hostname (PTR record). Both must match for email authentication to work properly.

# Forward DNS (A record)
dig mail.example.com +short
# Returns: 203.0.113.10

# Reverse DNS (PTR record)
dig -x 203.0.113.10 +short
# Should return: mail.example.com

Why PTR Records Matter

  • Email delivery: Gmail, Outlook, and Yahoo check PTR records. No PTR = rejected emails
  • Anti-spam: Missing or mismatched PTR is a strong spam signal
  • Server identity: PTR proves your server is who it claims to be
  • Compliance: RFC 1912 requires every internet-reachable host to have a PTR record

Common PTR/rDNS Problems

1. No PTR Record Set

The most common issue — your IP simply has no reverse DNS configured:

# Check if PTR exists
dig -x 203.0.113.10 +short
# Empty result = no PTR record

# Alternative check with host command
host 203.0.113.10
# "Host 10.113.0.203.in-addr.arpa. not found: 3(NXDOMAIN)"

2. PTR Doesn't Match Hostname

The PTR exists but points to a generic hostname instead of your mail domain:

# Bad PTR examples:
dig -x 203.0.113.10 +short
# Returns: vps12345.provider.com  ← Generic, not your domain

# Good PTR:
# Returns: mail.example.com  ← Matches your mail server

3. Forward/Reverse Mismatch (FCrDNS Failure)

Forward-Confirmed reverse DNS (FCrDNS) requires that the PTR hostname resolves back to the original IP:

# Step 1: Reverse lookup
dig -x 203.0.113.10 +short
# Returns: mail.example.com

# Step 2: Forward lookup of that result
dig mail.example.com +short
# Must return: 203.0.113.10  ← Same IP!

# If step 2 returns a different IP, FCrDNS fails

Step-by-Step Fix

Step 1: Find Your Server's Public IP

# Get your server's public IP
curl -4 ifconfig.me
# or
wget -qO- https://api.ipify.org

# For IPv6:
curl -6 ifconfig.me

Step 2: Check Current PTR Record

# Using dig
dig -x YOUR_SERVER_IP +short

# Using host
host YOUR_SERVER_IP

# Using nslookup
nslookup YOUR_SERVER_IP

# Online tools:
# https://mxtoolbox.com/ReverseLookup.aspx
# https://www.whatismyip.com/reverse-dns-lookup/

Step 3: Set the PTR Record

Important: PTR records are set by whoever controls the IP address — that's your hosting provider, not your domain registrar.

If Using QIW Host VPS:

Contact support or set it via the client portal under Server Settings → Reverse DNS.

If Using Other Providers:

  • AWS: Request via Elastic IP → "Create a PTR Record" in Route 53
  • DigitalOcean: Set droplet name to the desired FQDN (PTR auto-updates)
  • Hetzner: Server panel → Networking → Reverse DNS
  • OVH: Control Panel → IP → Reverse

Step 4: Create Matching A Record

In your domain's DNS zone, add an A record for the hostname you used in the PTR:

# In your DNS zone file or DNS panel:
mail.example.com.  IN  A  203.0.113.10

# The chain should be:
# IP 203.0.113.10 → PTR → mail.example.com → A → 203.0.113.10

Step 5: Configure Server Hostname

# Set the server hostname to match PTR
hostnamectl set-hostname mail.example.com

# Verify
hostname -f
# Should output: mail.example.com

# Update /etc/hosts
echo "203.0.113.10 mail.example.com" >> /etc/hosts

Step 6: Configure Mail Server HELO/EHLO

Your mail server's HELO hostname must match the PTR record:

# For Postfix (/etc/postfix/main.cf):
myhostname = mail.example.com

# For Exim (/etc/exim4/exim4.conf):
primary_hostname = mail.example.com

# Restart after changes
systemctl restart postfix
# or
systemctl restart exim4

Verify the Fix

# 1. Check PTR record
dig -x 203.0.113.10 +short
# Expected: mail.example.com

# 2. Check forward DNS matches
dig mail.example.com +short
# Expected: 203.0.113.10

# 3. Full FCrDNS test
PTR=$(dig -x 203.0.113.10 +short)
echo "PTR: $PTR"
dig $PTR +short
# Should show: 203.0.113.10

# 4. Test email deliverability
# Send a test email to [email protected]
# You'll get a report showing PTR status

Common Mistakes

  • Setting PTR at domain registrar: PTR must be set by the IP owner (hosting provider), not the domain registrar
  • Using a CNAME for PTR hostname: The PTR hostname must have an A record, not a CNAME
  • Not waiting for propagation: PTR changes can take 24-48 hours to propagate globally
  • Multiple PTR records: Each IP should have exactly one PTR record
  • Forgetting IPv6: If your server sends email over IPv6, you need a PTR for the IPv6 address too

🚀 Need a VPS With Clean IP & Proper PTR?

QIW Host provides VPS servers with clean IPs and full PTR/rDNS control. Set your reverse DNS right from the start.

Get a VPS With Clean IP →

Frequently Asked Questions

Who sets the PTR record — me or my hosting provider?

Your hosting provider controls PTR records because they own the IP address block. Most providers offer a control panel option or support ticket process to set PTR. You cannot set PTR at your domain registrar. See our guide on setting up SPF, DKIM, and DMARC for complete email authentication.

How long does a PTR change take to propagate?

PTR record changes typically propagate within 1-24 hours, though some DNS caches may take up to 48 hours. You can check propagation using dig -x YOUR_IP @8.8.8.8 to query Google's DNS directly.

Can I have multiple PTR records for one IP?

Technically yes, but it's not recommended. RFC 1035 allows multiple PTR records, but many mail servers only check the first result. Best practice is one PTR per IP address. If you run multiple domains, use a shared hostname like mail.example.com.

Does PTR affect website hosting or only email?

PTR primarily affects email delivery. Web browsers don't check PTR records. However, some security tools and monitoring systems use rDNS for identification. If your emails are going to spam, missing PTR is often the first thing to check.

My PTR is correct but emails still get rejected — why?

PTR is just one authentication layer. You also need valid SPF records, DKIM signatures, and DMARC policies. Check if your IP is blacklisted as well.

Need Expert Server Support?

QIW Host provides reliable VPS, shared hosting, and dedicated servers with 24/7 technical support.

Explore Hosting Plans

WhatsApp Chat

Chat instantly with our 24/7 support team on WhatsApp.

Chat Now

Knowledge Base

Find answers in our detailed articles. And Much More

Browse Articles

Submit Ticket

Submit a ticket and we'll get back quickly.

Submit Ticket
Chat on WhatsApp