All Glossary Terms

Glossary

MX Record

Directs email to the correct mail servers for a domain

An MX record (Mail Exchanger record) specifies the mail servers responsible for accepting incoming email on behalf of a domain, along with a priority value that determines which server is tried first.

What is an MX Record?

An MX record, short for Mail Exchanger record, is the DNS record type that tells the internet where to deliver email sent to a particular domain. When someone sends an email to user@example.com, the sending mail server performs a DNS lookup for the MX records of example.com to find the correct mail server to connect to. Without MX records, email delivery to a domain is impossible.

Each MX record consists of two main components: the hostname of the mail server (such as mail.example.com or aspmx.l.google.com for Google Workspace) and a priority value (a non-negative integer). Lower priority numbers indicate higher preference — if a domain has MX records with priorities 10 and 20, sending servers try the priority-10 server first and only fall back to priority-20 if the first is unavailable.

Most domains have at least two MX records for redundancy: a primary server with a low priority number and one or more backup servers with higher priority numbers. This ensures that email can still be received even if the primary mail server experiences an outage.

How Does an MX Record Work?

Email delivery begins when a sending mail server performs an MX lookup for the recipient's domain. The DNS resolver returns all MX records for that domain, sorted by priority. The sending server attempts to establish an SMTP connection (usually on port 25) to the highest-priority mail server first.

If that connection succeeds, the email is delivered. If the server is unavailable or rejects the connection, the sender tries the next MX record in order of priority. This fallback mechanism is what makes email delivery surprisingly resilient: email will queue and retry against backup servers for a defined period (typically several days) before bouncing.

The MX record itself points to a hostname, not an IP address. The sending server must perform an additional A or AAAA lookup to resolve that hostname to an IP address. This means the target of an MX record must be a hostname with its own A or AAAA record — it cannot be a CNAME, per DNS specification.

How to Check an MX Record

To view the MX records for any domain, use the MX Lookup tool at nslookup.net/tools/mx-lookup. Enter the domain name and the tool returns all MX records in priority order, along with the associated hostnames and their resolved IP addresses. This is invaluable when configuring email for a new domain, migrating to a new mail provider, or diagnosing email delivery failures.

Related Tool

MX Lookup

Try the Tool →

Frequently Asked Questions

What does MX record priority mean?
MX priority is a numeric value that determines the order in which sending servers attempt delivery. Lower numbers mean higher priority — a server with priority 10 is tried before a server with priority 20. If two MX records have the same priority value, traffic is distributed between them equally, providing basic load balancing.
Can an MX record point to a CNAME?
No. RFC 2181 explicitly prohibits MX records (and other records like NS and SRV) from pointing to CNAME targets. The MX record must point directly to a hostname that has its own A or AAAA record. Violating this rule can cause unpredictable email delivery failures with some sending servers.
What happens if a domain has no MX record?
If a domain has no MX record, some sending mail servers will fall back to attempting delivery to the A record of the domain itself. However, this behavior is not guaranteed across all mail servers, and many modern senders will simply bounce the email. For reliable email reception, always publish at least one MX record.
How do I set up MX records for Google Workspace or Microsoft 365?
Both providers supply specific MX record values in their setup documentation. For Google Workspace, you add records pointing to aspmx.l.google.com and several alt servers with increasing priority numbers. For Microsoft 365, you add a single record pointing to your tenant's mail.protection.outlook.com address. These values are unique to your account, so always use the values provided in your admin console.