dnswatchdog.iodocs

Invalid MX Record

The MX record target does not resolve to any IP addresses, preventing email delivery.

Severity: Critical

What is an MX record?

An MX (Mail Exchanger) record is a DNS record that specifies which mail servers are responsible for receiving email for a domain. When someone sends an email to user@example.com, the sending mail server looks up the MX records for example.com to find out where to deliver the email.

MX records include a priority number and a target hostname:

example.com.  MX  10  mail1.example.com.
example.com.  MX  20  mail2.example.com.

The lower the priority number, the more preferred the server. In this example, mail1.example.com is tried first. If it's unavailable, mail2.example.com is used as a fallback.

The target hostname must resolve to an IP address (have an A or AAAA record). MX records should never point directly to an IP address or to a CNAME — they must point to a hostname that resolves.

Why this is a problem

When an MX record points to a hostname that doesn't resolve (returns NXDOMAIN or has no A/AAAA records), email delivery to your domain will fail. Sending servers will be unable to find the IP address of your mail server and will bounce the email back to the sender.

This can happen when:

  • The mail server hostname was mistyped in the MX record
  • The mail server was decommissioned but the MX record wasn't updated
  • The A/AAAA record for the mail server hostname was accidentally deleted
  • You switched email providers but left old MX records in place

What you should do

  • Verify that each MX record target hostname resolves to a valid IP address
  • Remove MX records pointing to decommissioned or non-existent mail servers
  • If you've switched email providers, update MX records to point to the new provider's servers
  • Ensure MX targets are hostnames, not IP addresses or CNAMEs
  • Test email delivery after making changes to confirm emails are being received
  • Consider having at least two MX records with different priorities for redundancy

On this page