MCMail by MYCLOUD

MX Records: How Email Finds Your Mail Server

When someone sends a message to name@example.uz, their mail server first asks DNS where mail for example.uz should go. The answer comes from MX records. This article explains how they work, how to check them, and which mistakes come up most often.

What an MX record is

MX (Mail Exchanger) is a DNS record type that lists the servers accepting mail for a domain. Each MX record has two parts: a priority number and the hostname of a mail server.

example.uz.    3600    IN    MX    10 mx1.example.uz.
example.uz.    3600    IN    MX    20 mx2.example.uz.
mx1.example.uz. 3600   IN    A     192.0.2.10
mx2.example.uz. 3600   IN    A     198.51.100.20

Here, mail for example.uz is accepted by mx1 and mx2, and their IP addresses are defined by separate A records. Note that an MX record always points to a hostname, never directly to an IP address.

Delivery works like this:

  1. The sending server takes the domain from the recipient address (everything after @).
  2. It looks up the MX records for that domain.
  3. It sorts them by priority and tries to connect over SMTP on port 25.
  4. If a server is unreachable, it tries the next one. If none respond, it queues the message and keeps retrying, usually for several days.

If a domain has no MX records at all, the standard (RFC 5321) says senders should fall back to the domain's own A record. Don't rely on that: an explicit MX record is more predictable and easier to troubleshoot.

Priority: lower number wins

The number in an MX record is its preference value. The lower the number, the higher the priority, so a server with priority 10 is tried before one with priority 20.

SetupBehavior
10 mx1, 20 mx2mx1 is primary; mx2 is used only when mx1 is unavailable
10 mx1, 10 mx2Load is spread roughly evenly between the two
A single 10 mx1One server; during an outage, messages wait in the sender's queue

Only the relative values matter: 10/20 behaves exactly like 1/5. Steps of 10 are a common convention because they leave room to add a server in between later.

Don't add a backup MX from an old or third-party service "just in case." If the backup server doesn't know your mailboxes or filters spam poorly, it becomes a path for spam and lost messages.

TTL: how fast changes take effect

TTL (time to live) is how many seconds other DNS servers may cache a record. With a TTL of 3600, some senders may keep using the old MX for up to an hour after you change it.

  • For normal operation, 3600–86400 seconds (one hour to one day) is fine.
  • Before moving to a new mail provider, lower the TTL to 300–600 seconds a day or two in advance so the switch propagates faster.
  • Once the move is done and verified, raise the TTL back.

For a full switchover plan, see our guide to migrating email without losing messages.

How to check MX records

Windows: nslookup

nslookup -type=mx example.uz

To query a specific public resolver instead of your ISP's cache, add its address at the end, for example nslookup -type=mx example.uz 8.8.8.8.

Linux and macOS: dig

dig MX example.uz +short
10 mx1.example.uz.
20 mx2.example.uz.

Then confirm that each server name resolves to an IP address:

dig A mx1.example.uz +short
192.0.2.10

It also helps to compare the domain's authoritative server with public resolvers. Find the authoritative servers with dig NS example.uz +short, then query one directly: dig @ns1.example.uz MX example.uz. If the authoritative server already returns the new data but a public resolver still shows the old one, you just need to wait for the TTL to expire.

Online tools such as mxtoolbox.com show your MX records and test whether the servers respond. They're handy when you don't have a command line nearby.

Common mistakes

MistakeWhat happensFix
MX points to an IP addressThe record is invalid; some senders won't deliverUse a hostname and define its IP with an A record
MX points to a CNAMENot allowed by the standard; sender behavior is unpredictablePoint MX to a name that has its own A record
Old MX records left next to new onesSome mail still goes to the old serverRemove every MX record of the previous provider
Missing trailing dot in a zone fileYou end up with mx1.example.uz.example.uzUse the full name with a trailing dot in zone files; in web panels, follow the panel's format
Records added in the wrong placeEdited at the registrar while DNS is hosted elsewhereCheck the NS records and edit the zone where they point
Record created for a subdomainThe name field says mail instead of the rootFor the root domain, use @ or leave the field empty, depending on the panel

The last two are the most common. If you're not sure where your domain's DNS is managed, see our article on choosing and registering a domain.

MX is only part of the setup

MX handles incoming mail. To keep your outgoing messages out of spam folders, your domain also needs SPF, DKIM, and DMARC. These are separate TXT records and don't replace MX.

For domains that never receive mail, there is the "null MX" (RFC 7505): a record of MX 0 . tells senders not to bother, so they bounce the message right away instead of retrying for days.

When you connect a domain to MCMail, we send you the exact MX and other DNS records. If mail stops arriving after an MX change, message our support at @mycloudsupport and include the output of dig MX or nslookup so we can find the cause faster.