How To Set PTR Record for Your Domain (Cloudflare + VPS Guide 2026)
If you’re trying to fix Gmail rejection and you read:
“Set PTR record in Cloudflare”
That is incorrect.
PTR must be set at the VPS provider level.
—
🧠 Why PTR Cannot Be Set in Cloudflare
Cloudflare manages:
- Domain → IP mapping (Forward DNS)
But PTR is:
- IP → Domain mapping (Reverse DNS)
And only the IP owner can control reverse DNS.
Since your VPS provider owns the IP block — they control PTR.
—
🔁 Correct Email DNS Structure (Must Match Exactly)
You need BOTH:
1️⃣ Forward DNS (Cloudflare)
In Cloudflare:
$$
Type: A
Name: mail
Value: YOUR_SERVER_IP
Proxy: DNS Only (Grey Cloud)
$$
Result:
$$
mail.yourdomain.com → YOUR_SERVER_IP
$$
—
2️⃣ Reverse DNS (VPS Provider)
Your VPS provider must set:
$$
YOUR_SERVER_IP → mail.yourdomain.com
$$
These two must match perfectly.
—
🚨 Why Gmail Rejects Without PTR
Gmail checks:
✔ Does this IP identify itself?
✔ Does reverse DNS exist?
✔ Does it match forward DNS?
If PTR is missing or mismatched:
❌ 550-5.7.1 errors
❌ Spam placement
❌ “Unauthenticated sender”
❌ Low IP trust
PTR is foundational.
—
✅ Step-by-Step: How To Set PTR Properly
—
🟢 STEP 1: Configure Mail A Record in Cloudflare
Inside Cloudflare DNS:
$$
Type: A
Name: mail
IP: YOUR_SERVER_IP
Proxy: OFF (Grey Cloud)
$$
⚠ Mail must NEVER be proxied.
—
🟢 STEP 2: Set Mail Hostname in aaPanel
Inside aaPanel:
$$
Mail Server → Hostname
mail.yourdomain.com
$$
Restart mail service.
—
🟢 STEP 3: Contact VPS Provider
Open support ticket:
$$
Please set Reverse DNS (PTR) for:
IP: YOUR_SERVER_IP
PTR: mail.yourdomain.com
$$
Most providers:
✔ Do this quickly
✔ Or provide a control panel field
Cloudflare cannot do this.
—
🟢 STEP 4: Verify PTR Is Working
After confirmation, test:
$$
dig -x YOUR_SERVER_IP
$$
Expected result:
$$
mail.yourdomain.com
$$
If you see:
$$
vps123.provider.com
$$
Then PTR is not correctly set.
—
🔥 Full Correct Email Identity Setup (2026 Standard)
For maximum Gmail trust:
✔ mail.yourdomain.com (A record in Cloudflare)
✔ PTR matches mail.yourdomain.com
✔ SSL installed for mail subdomain
✔ SPF added
✔ DKIM enabled
✔ DMARC added
✔ Mail DNS not proxied
All must align.
—
⚡ Quick Checklist
| Item | Done |
| Mail A record in Cloudflare | ✅ |
| Proxy disabled | ✅ |
| Mail hostname set in aaPanel | ✅ |
| PTR set by VPS provider | ✅ |
| Forward & reverse match | ✅ |
—
🚫 Common Mistake
People try to add:
$$
Type: PTR
$$
Inside Cloudflare.
Cloudflare does not allow that.
Only IP owner can create PTR.
—
#aaPanel #Cloudflare #ReverseDNS #PTRRecord #VPSMail #GmailFix #SMTP