Back to tools

Email tool

MX Lookup

Check the mail exchange records for any domain and see which servers receive its email.

DNS query

What an MX record does

An MX (mail exchange) record is a DNS resource record that names the host responsible for accepting email for a domain. Each entry pairs a 16-bit preference value with a target hostname. Per RFC 5321 §5.1, a sending server resolves the full MX set, sorts it by preference (lowest first), and attempts delivery to each host in order. The target must be a hostname that resolves to an A or AAAA record; RFC 2181 §10.3 forbids pointing an MX at a CNAME, and an IP literal is invalid.

How to read the results

The lookup returns one or more rows, each showing a preference number and a target hostname. Lower numbers are tried first. When two hosts share the same preference, a sender may pick either one, spreading load between them. The resolved A/AAAA addresses confirm the target is actually reachable. A trailing dot on a hostname is normal — it marks a fully qualified name.

A worked example

Suppose the lookup shows "10 mx1.example.com" and "20 mx2.example.com". A sending server tries mx1 first because 10 is lower; only if that connection fails does it fall back to mx2 at preference 20. If instead you see "10 mx1" and "10 mx2", the two are equal — the sender picks one at random and the other absorbs overflow. Provider records such as Google Workspace's "1 aspmx.l.google.com" and "5 alt1.aspmx.l.google.com" follow the same priority rule.

Common problems / misconfigurations

Several MX faults break inbound delivery silently rather than returning an obvious error:

  • MX target is a CNAME — violates RFC 2181 §10.3 and some senders reject it.
  • MX points to an IP literal instead of a hostname — invalid; the value must be a name.
  • The target host has no A/AAAA record (a dangling MX) — mail bounces.
  • No MX at all — senders fall back to the domain's A record as an implicit MX (RFC 5321 §5.1).

FAQ

  • Can an MX record point to an IP address? — No. RFC 5321 requires a hostname that resolves to A/AAAA; use a hostname, never a bare IP.
  • What happens if two MX records have the same priority? — Senders treat them as equal and pick one at random, balancing load between the hosts.
  • Do I need an MX record if I only send mail? — Receiving needs MX; sending does not strictly require it, but without one inbound replies and bounces may fail.