// 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:
localhostorlocalhost.localdomain- an internal name such as
server01,ubuntuormail.local - a bare IP address, such as
203.0.113.10without 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
- Choose a name on your own domain, for example
mail.yourdomain.com. - Create an A record for that name pointing to your server's public IP:
mail.yourdomain.com A 203.0.113.10
- 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.
- 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". - 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
- No SPF record on your domainYour domain does not say which servers may send email for it. Add one TXT record and receivers can tell your real emails from fakes.
- SPF error: too many DNS lookups (permerror)SPF allows at most 10 DNS lookups. Above that, the whole record breaks and receivers treat it as invalid. Here is how to slim it down.
- Several SPF records on one domainA domain must have only one SPF record. With two or more, SPF breaks for every email. Merge them into a single line.
- SPF fails: the sending server is not authorizedYour domain has an SPF record, but the server that sent your email is not in it. Find which service sent the email and add it.
- No DKIM signature on your emailsDKIM adds a digital signature that proves an email really comes from your domain. Turn it on in your email provider and publish its key in DNS.