Skip to content

Email

HELO and PTR for mail

Match HELO, PTR, and your sending IP so receivers accept your mail.

Updated Aug 29, 20263 min read8 reads

Tags

HELO and PTR for mail
HELO and PTR need to match your sending IP

HELO is the name your mail server announces when it connects to another server. That name should resolve to your sending IP, and the PTR record for the IP should point back to the same name. On shared hosting we already set this for you. On a VPS or dedicated server you need the hostname, PTR, and A record to agree, or receivers will treat the mail as junk.

Shared hosting is already configured

On cPanel shared hosting we set the server name, the PTR, and the HELO string. You do not choose those values yourself. Publish SPF and DKIM for your domain, then send from the mailbox as usual. Changing the shared HELO to something like mail.example.com is not supported, because the server name already matches the PTR and the sending IP.

VPS and dedicated: three places must agree

On a VPS or dedicated server you control three pieces: the system hostname, the PTR for the IP, and the A record for that hostname. Open a support ticket if you need the PTR updated. After a rebuild, a leftover hostname such as ubuntu or localhost.localdomain is a common reason mail fails. Banks and large providers often reject that kind of identity without much discussion.

bash
dig +short $(dig +short -x 203.0.113.40)

Replace the sample address with your real sending IP. The inner dig looks up the PTR name for the IP. The outer dig resolves that name back to an address. You want your own IP in the result. An empty PTR, a name that does not exist, or a name that points elsewhere is a fail. HELO should use that same name, or another name that also maps to the IP. You can confirm what you announce from outside with openssl against ports 25 or 587.

When you should change these settings

Update them after a rebuild, after you move the VPS to a new IP, or when you deliberately want HELO to match a public name such as mail.example.com. Do not chase HELO alone because one message landed in junk while the PTR already matched. Fix authentication first with SPF and DKIM. A clean HELO on a domain with no SPF is still unsigned mail.

On shared hosting, leave HELO alone. On a VPS, make the three records agree, send a test message, and read the Received and Authentication-Results headers. If they already agree, the junk problem is not PTR.

Share

Send this article

Need someone else to do this? Send them the link — the commands are in the article.

Tagged

Was this article helpful?

Be the first to rate this article.