How to Fix “lowest numbered MX record points to local host” Mail Error
If emails get stuck in your mail server queue (Exim or Sendmail) with the log message lowest numbered MX record points to local host – or the equivalent mail for example.com loops back to myself in Postfix – your mail transfer agent has hit a mail routing loop.
The message means exactly what it says: DNS reports that the highest-priority (lowest-numbered preference) MX record for the destination domain points to your own server’s IP address, yet the mail daemon does not recognize that domain as local and tries to relay the message outbound – straight back to itself.
Scenario 1. Mail for This Domain Should Be Delivered Locally
Most commonly, you pointed the domain’s MX record to the server (or configured a relay) but forgot to add the domain name to your MTA’s local domains list:
- Exim (FreeBSD / Linux): check the
domainlist local_domainsdirective in your Exim config. It usually reads from a file such as/usr/local/etc/exim/local_domainsor/etc/exim4/local_domains– add the domain on a new line and runservice exim reload. - Exim on cPanel / WHM servers: make sure the domain is listed inside
/etc/localdomainsand removed from/etc/remotedomains(or in cPanel → Email Routing, select “Local Mail Exchanger”). - Sendmail: add the domain (one per line) to
/etc/mail/local-host-namesand restart Sendmail. - Postfix: add the domain to
mydestination(or yourvirtual_mailbox_domainstable) in/etc/postfix/main.cfand runsystemctl reload postfix.
Scenario 2. Mail Is Hosted Externally (Google Workspace, Microsoft 365, etc.)
The opposite situation often happens on a web server that only hosts a website (for example, WordPress sending contact form alerts to [email protected]) while actual mailboxes live on an external mail provider:
- Check MX records in DNS: run
dig MX example.com +short(ordrill MX example.com) on the server itself. If the MX record still points to your web server’s hostname or IP, update the MX records at your DNS provider to point to your external mail host. - Check
/etc/hostsand local DNS zones: sometimes public DNS is already updated, but a stale entry inside/etc/hostsor a local DNS zone on the server still mapsmail.example.comto127.0.0.1or the server’s own IP.
local_domains or the MX record, force Exim to retry frozen messages in the queue immediately with exim -qff (check the current queue with exim -bp).The rule of thumb is simple: if the domain’s MX points to your server, the domain must be in local_domains; if mailboxes live elsewhere, the MX record (as resolved from inside the server) must never point to a local IP.
