Skip to main content
ToolsHub
MX

Mail Exchange Record (MX)

Specifies the mail servers responsible for accepting email for a domain.

Standards: RFC 1035 · RFC 5321

What is a DNS MX record?

MX (Mail Exchange) records direct email for a domain to one or more mail servers. Each MX record has a priority value (lower = higher priority). When email is sent to user@example.com, the sending server performs an MX lookup and tries the server with the lowest priority number first. Multiple MX records with different priorities provide redundancy. If the primary mail server is unavailable, the sending server tries the next priority. If all fail, the message is queued and retried. The target of an MX record must be an A or AAAA record (a hostname), never an IP address directly, and never a CNAME. Common mail providers (Google Workspace, Microsoft 365, Zoho Mail) supply specific MX records to add to your DNS.

Record Structure

FieldDescription
NameThe domain name (usually apex @)
TTLTime to live in seconds. 3600 is typical
ClassIN
TypeMX
PriorityPreference value; lower = higher priority. Range: 0–65535
ExchangeFQDN of the mail server, e.g. mail.example.com.

Examples

Single mail server
example.com. 3600 IN MX 10 mail.example.com.
Primary + backup (redundancy)
example.com. 3600 IN MX 10 mail1.example.com.
example.com. 3600 IN MX 20 mail2.example.com.
Google Workspace
example.com. 3600 IN MX 1 aspmx.l.google.com.
example.com. 3600 IN MX 5 alt1.aspmx.l.google.com.

Common Issues & Fixes

Email delivery failing — no MX record found

Sending servers cannot find where to deliver email for your domain.

Fix: Add MX records pointing to your mail provider. Use the MX Lookup tool to verify they resolve correctly.

MX record points to CNAME

RFC 2181 prohibits MX targets from being CNAMEs. Some sending servers will reject delivery.

Fix: Change the MX target to a hostname with a direct A/AAAA record.

Email marked as spam — missing SPF/DKIM

MX records alone are not sufficient for deliverability. Receiving servers also check SPF, DKIM, and DMARC.

Fix: Add SPF TXT record, configure DKIM, and set a DMARC policy. Use the SPF Checker and DKIM Lookup tools.

Related Network Tools

Related DNS Record Types

Browse All DNS Record Types