An MX record is a DNS record that specifies which mail server(s) are responsible for receiving the email for a domain. For example, the dnscheck.co domain has two MX records pointing to the mx.dnscheck.co and mx2.dnscheck.co mail servers. A domain name can have multiple MX records.
MX records are also called "mail exchange records", and are partially defined in RFC 2821.
This page provides a brief overview of MX records. A more detailed description is in our Check Your DNS MX Records blog post.
DNS Check can monitor your MX records, and notify you if they become unresolvable, or start resolving to the wrong Exchange or using the wrong Preference. The Exchange and Preference fields are explained in the next section.
Here are the fields that make up an MX record:
|Name||A fully qualified domain name (FQDN).||dnscheck.co.|
|Type||The DNS record type. Always set to "MX".||MX|
|Preference||How desirable this MX record is relative to other MX records. The lower the Preference, the more desirable the MX record is.||10|
|Exchange||The fully qualified domain name (FQDN) of a mail server that receives the incoming email for this domain.||mx.dnscheck.co.|
The Preference field warrants some more explanation. An MX record's Preference is a number between 0 and 65,535 which indicates how preferable that MX record is relative to other MX records for that same domain. For example, an MX record with a Preference of 10 is considered more desirable than one with a Preference of 20. This means that normally mail is delivered to the mail server(s) whose MX records have the lowest Preference.
DNS Zone File Examples
Here's an example of how MX records look in a DNS zone file:
; Name Type Preference Exchange dnscheck.co. MX 10 mx.dnscheck.co. dnscheck.co. MX 20 mx2.dnscheck.co.
The Name ends in a period in the above example, so it's a fully qualified domain name.
Alternatively, you can create an MX record that's relative to the zone file's $ORIGIN. Here's an example of how to do this to create DNS records that are equivalent to what's shown in the previous example:
$ORIGIN dnscheck.co. ; Name Type Preference Exchange @ MX 10 mx @ MX 20 mx2
- Check Your DNS MX Records - a blog post that goes into a lot of detail on what MX records are, and how to check them using dig, nslookup and DNS Check.
- RFC 2821 - this RFC partially defines MX records.