aaPanel Reverse DNS (PTR Record) Setup Guide (2026 Complete Fix)
If your emails:
❌ Go to spam
❌ Get rejected by Gmail
❌ Show “550 reverse DNS does not match”
❌ Show “IP has no PTR record”
And you’re using:
Then you MUST configure Reverse DNS properly.
—
🧠 What Is Reverse DNS (PTR Record)?
Normally:
$$
mail.yourdomain.com → YOUR_SERVER_IP
$$
That is forward DNS (A record).
Reverse DNS does the opposite:
$$
YOUR_SERVER_IP → mail.yourdomain.com
$$
This is called a PTR record.
Mail servers check both directions.
If they don’t match → email is suspicious.
—
🚨 Why PTR Is Critical for Gmail
When Gmail receives your email, it checks:
✔ IP reputation
✔ SPF
✔ DKIM
✔ DMARC
✔ Reverse DNS
If no PTR record exists:
❌ Gmail may reject email
❌ Email may land in spam
❌ SMTP authentication may fail
—
🔍 Step 1: Check If PTR Exists
From terminal:
$$
dig -x YOUR_SERVER_IP
$$
Or:
$$
host YOUR_SERVER_IP
$$
If result shows nothing meaningful → PTR not set.
—
⚠ Important: PTR Is NOT Set in aaPanel
You cannot configure reverse DNS inside aaPanel.
It must be set at your VPS provider level.
Examples:
DigitalOcean
Contabo
Hetzner
OVH
Vultr
Linode
PTR is controlled by whoever owns the IP address.
—
✅ Step-by-Step: Set PTR Record
—
🟢 STEP 1: Create Mail Hostname
In your DNS provider (for example, Cloudflare):
Create A record:
$$
Type: A
Name: mail
Value: YOUR_SERVER_IP
Proxy: DNS Only (Grey Cloud)
$$
Verify:
$$
mail.yourdomain.com → YOUR_SERVER_IP
$$
—
🟢 STEP 2: Set Server Hostname in aaPanel
Inside aaPanel → Mail Server:
Set hostname:
$$
mail.yourdomain.com
$$
Restart mail service.
—
🟢 STEP 3: Configure PTR at VPS Provider
Login to your VPS control panel.
Find:
Reverse DNS / PTR Record section.
Set:
$$
YOUR_SERVER_IP → mail.yourdomain.com
$$
Save changes.
Propagation usually takes minutes to hours.
—
🔄 Forward-Confirmed Reverse DNS (FCRDNS)
For full trust:
Both must match:
- Forward DNS:
$$
mail.yourdomain.com → YOUR_SERVER_IP
$$
- Reverse DNS:
$$
YOUR_SERVER_IP → mail.yourdomain.com
$$
This is called:
✔ Forward-confirmed reverse DNS
Mail servers love this.
—
🧪 Step 4: Test PTR After Setup
Run:
$$
dig -x YOUR_SERVER_IP
$$
Expected output:
$$
mail.yourdomain.com
$$
Then test forward:
$$
dig mail.yourdomain.com
$$
Both must match exactly.
—
🔐 Combine PTR With These (Important)
PTR alone is not enough.
Also configure:
✔ SPF record
✔ DKIM enabled
✔ DMARC record
✔ SSL installed for mail.yourdomain.com
✔ Mail DNS NOT proxied in Cloudflare
—
🚀 Best Mail Setup (2026 Recommended)
✔ Hostname = mail.yourdomain.com
✔ A record created
✔ PTR set by VPS provider
✔ SPF configured
✔ DKIM enabled
✔ DMARC added
✔ SSL installed
—
⚡ Common Mistakes
❌ Setting PTR to main domain instead of mail subdomain
❌ Using IP as SMTP host
❌ Proxying mail through Cloudflare
❌ Forgetting to restart mail service
❌ PTR mismatch with hostname
—
Web Development #aaPanel #ReverseDNS #PTRRecord #EmailDeliverability #VPSMail #Cloudflare #HostingFix