MX Record
DNSMX Record is a DNS record type that tells other mail servers which hostnames accept email for a domain and in what order they should be tried. It points to mail exchanger hostnames (not IP addresses directly) and uses priority values to support primary and backup mail routing. Correct MX configuration is essential for reliable inbound email delivery and spam-control alignment.
How It Works
An MX (Mail Exchanger) record is published in a domain's DNS zone and lists one or more mail servers responsible for receiving email for addresses at that domain (for example, [email protected]). Each MX entry includes a priority number; lower numbers are preferred. When a sending mail server needs to deliver a message, it queries DNS for the domain's MX records, sorts them by priority, and attempts delivery starting with the lowest value. If the preferred server is unavailable, it tries the next one, enabling failover.
MX records point to hostnames such as mail.yourdomain.com, and those hostnames must resolve via A or AAAA records to reachable IP addresses. This indirection allows you to change mail server IPs without changing the MX targets. MX records also interact with other DNS-based email controls: SPF is typically published as a TXT record to authorize sending sources, and DKIM/DMARC help recipients validate authenticity. While MX records govern inbound routing, they do not by themselves guarantee deliverability; server configuration, reverse DNS, and authentication policies also matter.
Why It Matters for Web Hosting
When choosing a hosting plan, you need to know whether email is hosted with your web host, a separate mail service, or both. MX records are the switch that directs inbound mail to the correct platform, so a mismatch can cause lost mail, delivery delays, or messages landing on an old server. Understanding MX records helps you evaluate control panel access, DNS management features, propagation behavior, and whether the host supports redundant MX setups for higher email reliability.
Common Use Cases
- Pointing a domain to a hosted mailbox service while the website stays on a different server
- Setting up primary and backup mail exchangers using multiple MX records with different priorities
- Migrating email between servers by updating MX targets and keeping old servers temporarily as fallbacks
- Troubleshooting inbound email failures by verifying MX targets, priorities, and corresponding A/AAAA records
- Routing mail through a security or filtering gateway before final delivery to the mailbox server
MX Record vs A Record
An MX record specifies where a domain receives email and must reference a hostname, while an A record maps a hostname to an IPv4 address (and an AAAA record maps to IPv6). In practice, MX records depend on A/AAAA records because the mail exchanger hostname must resolve to an IP. If you mistakenly point MX directly to an IP or confuse it with the website's A record, inbound email may fail even though the site loads correctly.