What is an MX record?
An MX record is the DNS entry that tells the rest of the internet which mail servers receive email for a domain. Here is how MX records work, what each field means, and why priority matters.
An MX record is the DNS entry that tells the rest of the internet which mail servers receive email for a domain. For normal hosted mail, it is the DNS record that routes inbound messages to Google Workspace, Microsoft 365, Fastmail, or whichever provider handles your mailbox.
The mechanics are simple, but a few details trip people up: lower numeric priority values are tried first, MX hostnames need address records, no-MX domains have an SMTP fallback, and null MX means “this domain does not accept mail.”
How an MX record works
When someone sends mail to [email protected], the sender’s mail server looks up the MX records for example.com in DNS. Each MX record points at a hostname that accepts mail. The sender resolves that hostname to an IP address, opens an SMTP connection, and attempts delivery.
Here is what a query can look like for a domain using Google Workspace’s current documented MX value:
$ dig +short mx yourdomain.com
1 smtp.google.com.
In that example, 1 is the priority and smtp.google.com. is the mail server. Trailing dots are normal in DNS output: they mark fully qualified domain names.
If the lookup returns nothing, the domain has no explicit MX. Under RFC 5321, standards-compliant senders treat the domain’s A or AAAA address as an implicit MX. That fallback exists, but you should not rely on it for a business domain. If the lookup returns a single record of 0 ., the domain explicitly refuses email under RFC 7505.
What’s in an MX record
Every MX record has exactly two values, plus the standard DNS metadata.
The priority (also called preference) is a 16-bit unsigned integer between 0 and 65535. Lower numbers are tried first.
The exchange is the hostname of a mail server that accepts SMTP connections for the domain. It must resolve to one or more A or AAAA records, must not be an IP address directly, and must not point at a CNAME (RFC 5321 section 5.1).
On top of those two values, the record carries the usual DNS TTL that tells resolvers how long to cache the answer. TTLs of 300 to 3600 seconds are typical.
The DNS zone file syntax is:
example.com. 3600 IN MX 10 mail.example.net.
Why priority matters
Sending servers always try the lowest numeric priority value first. If that host is unreachable, they fall back to the next-lowest value. Backup mail servers use higher priority numbers (often 20 or 50) so they only receive mail when the primary servers are down.
That “priority” language can be confusing because the lowest number has the highest preference. A record with priority 10 is tried before a record with priority 20.
When two MX records share the same priority, sending servers spread delivery attempts across them. This is the standard pattern for providers that publish several equivalent inbound hosts:
10 mx1.example.net.
10 mx2.example.net.
10 mx3.example.net.
Backup MX records were popular when many operators ran their own mail infrastructure. Today they are usually unnecessary with hosted mail because the provider’s documented MX hostnames already represent redundant infrastructure. Long backup lists are often a sign of forgotten hostnames pointing at servers nobody operates anymore. They can also create a weaker inbound path if the backup server does not apply the same spam, malware, TLS, and policy controls as the primary path.
What happens if a domain has no MX record
No MX does not always mean immediate rejection. SMTP defines an implicit fallback: if there are no MX records, standards-compliant senders try the A or AAAA address of the domain itself.
That is legacy-compatible behavior, not a good operational design for modern hosted mail. If example.com should receive mail, publish the MX records documented by the mailbox provider. If the domain should not receive mail, publish a null MX instead of relying on failed connection attempts to a web server.
Null MX records
A null MX record is a single MX entry of the form 0 . (priority zero, exchange a single dot). It tells the internet that the domain does not accept email. Sending servers see the null MX and reject delivery immediately rather than retrying for several days.
Use a null MX on parked domains, brand-protection domains, and web-only domains that should never receive mail. It is published exactly like any other MX record:
example.com. 3600 IN MX 0 .
RFC 7505 defines the exact semantics. Most modern mail servers honor it.
Do not use null MX for a domain that sends mail from visible From: addresses or envelope sender addresses. Receiving systems often expect a sending domain to handle delivery status notifications, abuse reports, and replies. A null MX can make that domain look intentionally unreachable.
MX records and email authentication
MX records and email authentication solve different problems. MX records say where to deliver mail. SPF, DKIM, and DMARC say who is allowed to send mail.
It is normal for a domain’s MX hostnames to look completely different from the domain itself. A domain using Google Workspace publishes smtp.google.com. as its MX. That is not a sign of compromise. It is the normal pattern for hosted mail.
If you are auditing a domain’s email setup end to end, MX is one piece of the picture. Use our SPF generator and DMARC generator to build the authentication records, and see DMARC alignment for the overall framework.
How to view your MX records
The fastest way is our free MX records lookup. Type any domain into the form, and the tool returns every MX record sorted by priority, resolves each mail server’s IPv4 and IPv6 addresses, and identifies the email provider behind the host when it recognizes one.
If you prefer the command line, run:
dig +short mx yourdomain.com
Either way, the answer should match the provider records you intended to publish. If it does not, check the authoritative DNS zone for the domain, remove stale MX records from old providers, save the corrected records, and wait for cached TTLs to expire before retesting.
If you want to see your own MX setup right now, run a free MX records lookup and read the priorities, hosts, and IPs in one view.