all guides

// how to fix

Invalid HELO/EHLO hostname

Your server introduces itself with a name that is not valid, such as localhost or a bare IP. Spam filters distrust this. Give it a real name that matches reverse DNS.

What it means

When a mail server connects to another one, the first thing it does is say its name, with the command HELO or EHLO. For example:

EHLO mail.yourdomain.com

That name should be a real, full hostname that exists in DNS. Problems appear when the server introduces itself as:

  • localhost or localhost.localdomain
  • an internal name such as server01, ubuntu or mail.local
  • a bare IP address, such as 203.0.113.10 without brackets
  • someone else's domain, such as gmail.com

Why it matters

  • Infected computers and spam robots often use fake or random names. Receivers treat a bad HELO name as a spam signal.
  • Some servers refuse the connection outright with an error such as 504 5.5.2 Helo command rejected: need fully-qualified hostname.
  • A HELO that matches your reverse DNS is part of what makes a server look trustworthy.

How to check

  • Send a test email: on the home page, copy your unique test address, send it a normal email from the mailbox or tool you want to check, then open the report. The HELO line shows the name your server used. Compare it with the reverse DNS line.

If you send through Google Workspace, Microsoft 365 or a newsletter tool, the provider controls the HELO and it is already correct. This guide is for your own server, a VPS or a device that sends email directly.

How to fix it

  1. Choose a name on your own domain, for example mail.yourdomain.com.
  2. Create an A record for that name pointing to your server's public IP:
    mail.yourdomain.com  A  203.0.113.10
  3. Set the reverse DNS (PTR) of the IP to the same name. This is done at your hosting or server provider, not at your domain's DNS. See the reverse DNS guide.
  4. Configure the mail server to use that name. On Postfix, for example:
    myhostname = mail.yourdomain.com
    smtp_helo_name = $myhostname
    On other servers, look for a setting called "hostname", "HELO name", "EHLO domain" or "FQDN".
  5. Reload the mail server so the change takes effect.

The ideal match

The three should be the same name:

  • The HELO name: mail.yourdomain.com
  • The A record of that name: your server's IP
  • The reverse DNS of that IP: mail.yourdomain.com

For servers sending for several domains, one name for the server is fine: it does not need to match each From domain.

Check that it is fixed

DNS changes are not instant. Most are visible within a few minutes, but some providers take up to 24 to 48 hours.

Send a new test email from the home page through the same server. The HELO line should show your full hostname, and the reverse DNS line should show the same name.

Check that it is fixed

DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.

Related guides