Clisec
ProductsAnti-spamPrecise filtering of spam and bulk campaigns, without penalizing legitimate mail.Anti-phishing & BECStops impersonation, malicious links, and email fraud before the inbox.cPanel® pluginOne agent protects the whole server; each user manages from their cPanel.Explore
PricingGuidesContactAbout us
Guide · Deliverability

PTR, A and MX records: the DNS a mail server needs

What A, MX and PTR records are, why hostname, PTR and HELO must match, and how to set them up on cPanel without IPv6 surprises.

Updated on 8 min readClisec team

In short

A mail server needs three things to match: the hostname it uses to greet (HELO), the A record for that hostname pointing to the server IP, and the PTR record for that IP pointing back to the same hostname. If they don't match, Gmail and Outlook distrust everything it sends. The PTR isn't created in cPanel: the provider that owns the IP sets it. Each domain's MX records, on the other hand, say which server receives its inbound mail.

What each record does

RecordQuestion it answersExample
AWhat IP does this name have?server.yourhosting.com → 203.0.113.10
AAAAWhat IPv6 address does this name have?server.yourhosting.com → 2001:db8::10
MXWhich server do I deliver this domain's mail to?yourcompany.com → mail.yourcompany.com (priority 0)
PTRWhat name does this IP have? (reverse DNS)203.0.113.10 → server.yourhosting.com
HELO / EHLOHow does the server introduce itself when sending?EHLO server.yourhosting.com

Why they must match (FCrDNS)

Receiving mail servers run a check called forward-confirmed reverse DNS (FCrDNS): they take the connecting IP, look up its PTR, and verify that the A record of that name points back to the same IP. If the IP has no PTR, or the PTR is generic (like ip-203-0-113-10.provider.net), the server looks like a home connection or an infected machine.

Gmail requires a valid PTR from every sender. Many other servers reject connections outright when there's no PTR or the HELO name doesn't resolve.

How to set it up on a cPanel server

  1. Pick a fully qualified hostname that isn't a customer domain, for example server1.yourhosting.com, and set it in WHM › Networking Setup › Change Hostname.
  2. Create the A record for that hostname pointing to the server's main IP. WHM offers to create it if DNS is on the same server.
  3. Ask for the PTR from your server provider or data centre: the IP must resolve to the same hostname. Many providers let you set it in their panel.
  4. Check Exim greets with that name. By default it uses the server hostname. If the server has several IPs and sends from another one, each IP needs its own PTR.
# The hostname resolves to the IP
dig +short A server1.yourhosting.com

# The IP resolves to the hostname (PTR)
dig +short -x 203.0.113.10

# The name your server greets with
exim -bP primary_hostname

MX records and cPanel email routing

  • An MX points to a name, never to an IP, and that name must have an A record (not a CNAME).
  • The lowest priority is tried first. A backup MX is only useful if it really accepts and stores mail for that domain.
  • Check the routing in cPanel › Email › Email Routing. If the domain's mail lives in Google Workspace or Microsoft 365, it must say "Remote Mail Exchanger". If it says "local", the cPanel server delivers internally any mail its other accounts send to that domain, and it never reaches Google or Microsoft.

The IPv6 problem

If the server has IPv6, Exim may send to Gmail over IPv6. Gmail is stricter with IPv6: without a PTR and correct authentication, it rejects or junks the mail. There are two ways out: get a PTR for the IPv6 address too and add it to SPF, or make Exim send over IPv4 only until that's ready.

Common mistakes

MistakeConsequenceFix
IP without a PTRRejections and spam at Gmail, Outlook and othersAsk the IP's provider for a PTR
Generic data centre PTRLooks like a residential or unmanaged IPChange it to the server hostname
Hostname that is a customer domainTrouble when that customer moves serversUse a subdomain owned by the hosting company
MX pointing to a CNAME or an IPFailed deliveries on some serversMX to a name with an A record
Local routing with mail at Google or MicrosoftInternal emails that never arriveSwitch to Remote Mail Exchanger

Frequently asked questions

Where do I set the PTR in cPanel?

You don't: the PTR is controlled by whoever owns the IP, your server provider or data centre. Ask them, giving the IP and the server hostname.

Does the PTR have to match my email domain?

No. It must match the server hostname and the name it uses to greet (HELO). Email domains are authenticated with SPF, DKIM and DMARC.

What is FCrDNS?

The check that an IP's PTR points to a name whose A record points back to the same IP. Mail servers use it to weed out home or infected machines.

Do I need a PTR for IPv6?

Yes, if the server sends mail over IPv6. Gmail is especially strict with IPv6 without a PTR.

Protect inbound email on your whole server

With your DNS in order, protect what comes in too: Clisec filters phishing, BEC, spam and malware across your whole cPanel server.

Request a demoSee pricing and coverage

Keep reading

Complete guide · DeliverabilityWhy are my emails going to spam, and how to fix it (cPanel)A 5-minute diagnosis and the most common causes, from authentication to domain reputation.ReadGuide · DeliverabilityHow to set up SPF, DKIM and DMARC in cPanel, step by stepThe three records explained, how to create them in cPanel and how to take DMARC to p=reject without breaking anything.ReadGuide · DeliverabilityServer IP on a blocklist: how to check and how to get off itWhich list is blocking you, why, and the right order to get off it and stay off.Read