MX Record Reference
Last updated
This article serves as a reference for the formal structure, components, and key technical details of a Mail eXchange (MX) record.
MX record format
An MX record specifies the mail servers responsible for a domain. The structure follows the standard format defined in RFC 1035, Section 3.3.9.
The core components of an MX record’s RDATA (Resource Data) section are composed of two elements:
priority: A 16-bit integer (0-65535) that indicates the preference given to this record.
domain-name: The fully-qualified domain name (FQDN) of the mail server.
The canonical representation of an MX record is: <name> IN MX <priority> <domain-name>
In the DNSimple record editor, an MX record is represented by the following customizable elements:
Name: The host name for the record, without the domain name. This is generally referred to as a “subdomain”. Leave it blank for the root domain.
TTL (Refresh Rate): The time-to-live in seconds. This is the amount of time the record is allowed to be cached by a resolver.
Priority: A number that indicates the preference for this mail server.
Mail Server Host: The fully-qualified domain-name of the mail server. It must be a hostname, not an IP address, and should not point to a CNAME (RFC 2181, Section 10.3).
MX record behavior and priorities
Priority: When a mail agent attempts to deliver an email, it will always try to connect to the mail server with the lowest priority value first.
Redundancy: If multiple MX records exist for a domain, they provide redundancy. If the server with the lowest value cannot be reached, the mail agent tries the server with the next lowest value.
Equal priorities: If multiple records share the same priority value, mail agents may randomly select among them for delivery.
Example MX records
A common example of multiple MX records used to provide redundancy for a domain:
example.com. IN MX 1 mx1.example.net.
example.com. IN MX 5 mx2.example.net.
example.com. IN MX 5 mx3.example.net.
example.com. IN MX 10 backup.example.net.
In this example, mail is first delivered to mx1.example.net (priority 1). If that fails, the sender tries mx2.example.net or mx3.example.net (priority 5), and then backup.example.net. For your email provider’s current values, use the records it gives you, or a one-click service.
Have more questions?
If you have additional questions or need any assistance with your MX records, just contact support, and we will be happy to help. You can also read more about DNS hosting at DNSimple.