Skip to content
WhatsApp support

Subject:Domains

MX Records Explained: What They Are and How to Set Up and Check Them

A plain-English guide to MX records: how email finds your domain, what priority and TTL mean, how to change MX records at your DNS host, how to check them, and the mistakes that stop incoming mail.

  • 8 min read
A DNS records table showing a company domain's MX record and its priority

An MX record is an entry in your domain's DNS that tells the internet which server receives email sent to your addresses, such as sales@company.com. Every server that sends you a message first looks up your domain's MX records, then delivers the message to the server listed there. If the record is missing or wrong, mail doesn't arrive, no matter how healthy your mailboxes are.

This guide explains what's inside an MX record and what priority means, how to add or change MX records at your DNS host, how to check them yourself, and the most common mistakes that stop incoming mail.

What is an MX record and how does it work?

MX stands for Mail Exchange. Think of your domain as your company's street address and the MX record as the sign at the entrance saying "mail is delivered to this office." When a customer emails info@company.com, this happens in seconds:

  1. The sender's server reads the part after the @, which is company.com.

  2. It asks DNS for that domain's MX records.

  3. It gets one or more server names, each with a priority number.

  4. It connects to the most preferred server and hands over the message.

  5. Your provider's mail server puts the message in the info mailbox.

This behavior is defined in RFC 5321, the standard for mail transfer. It also says that if a domain has no MX record at all, the sender tries to deliver to the domain's own address, which you usually don't want, because your web server isn't a mail server.

MX handles receiving, SPF handles sending

A common mistake is assuming the MX record controls everything. It's responsible for receiving only. Proving that your outgoing messages are genuine is the job of SPF, DKIM and DMARC, which we cover in SPF, DKIM and DMARC explained. That's why sending can work while receiving is broken, or the other way around.

What happens if your mail server is down for a while?

Email is designed to survive short outages. If the sender can't reach any server in your MX records, it doesn't reject the message right away; it keeps it in a queue and retries at intervals. RFC 5321 recommends that senders don't give up for roughly four to five days. So an hour-long outage means delayed messages, not lost ones. A wrong record is far more dangerous, because messages are delivered successfully, just to the wrong place.

What's inside an MX record

When you open the DNS panel at your registrar or DNS host, an MX record has these fields:

FieldExampleMeaning
Name / Host@The domain itself; @ means company.com
TypeMXThe record type
Priority10The order servers are tried in, lowest first
Value / Mail servermail.provider.comYour email provider's mail server
TTL3600How many seconds networks cache the value before asking again

MX priority: what happens with more than one record?

Some providers give you a single record; others give two or more with different priorities:

company.com.   MX   10   mx1.provider.com.
company.com.   MX   20   mx2.provider.com.

Senders try mx1 first because its number is lower. If it doesn't answer, they move on to mx2. If the numbers are equal, senders spread messages across both servers. What matters is that every record belongs to the same provider, because a backup server at another provider will accept messages that never reach your mailboxes.

How to add or change MX records

You change MX records wherever your domain's DNS is managed, usually your domain registrar, or your web host if the nameservers point there. We cover the full process of connecting an existing domain in how to create email with your own domain; these are the MX-specific steps:

  1. Find out who manages your DNS: check your domain's nameservers and log in to that provider's panel specifically.

  2. Copy the values from your new email provider: the server name and priority exactly as given, with nothing added.

  3. Delete the old MX records: every record pointing to a previous provider must go, not sit next to the new one.

  4. Add the new record: name @, type MX, plus the priority and value from your provider.

  5. Leave the TTL at its default: or lower it a day before the move if you want a faster switch.

  6. Check the result: after a few minutes, confirm the new record shows up from more than one public DNS server.

  7. Keep the old mailboxes for a while: until you're sure the last messages have reached the new provider.

TTL: how to speed up a move and reduce the risk

The TTL sets how many seconds networks keep a cached copy of the record before asking again. If it's 86400, a full day, some servers may keep sending to your old provider for up to a day after the change. So if you're planning to move your email, lower the MX record's TTL to 300 or 3600 seconds a day before the move, change the value on moving day, and set the TTL back to its usual value once everything has settled.

Do you need to change MX records yourself?

Not always. These are the three most common cases:

  • A new domain registered together with your email: the provider sets up MX and the other records itself, and you never touch DNS.

  • An existing domain with a website, with DNS at a registrar or web host: you add the new MX record there yourself, and the website stays as it is.

  • Transferring the domain itself to your email provider: once the transfer completes, DNS is managed by the provider, which sets up the records for you.

How to check your MX records

On your computer with nslookup or dig

On Windows, open Command Prompt and type:

nslookup -type=mx company.com

On a Mac or Linux, open Terminal and type:

dig mx company.com +short

The result is one or more lines like 10 mail.provider.com.: the priority, then the server name. If nothing comes back, the domain has no MX record.

In your browser

The Dig tool in the Google Workspace diagnostic tools shows any domain's MX records without commands, and plenty of other online DNS checkers do the same. Checking from more than one place shows whether a new change has propagated or some networks still see the old value.

With Emailat

The domain health check in the Emailat dashboard tests your MX, SPF, DKIM and DMARC records against several public DNS resolvers and shows whether each one is correct or missing. If your domain uses Emailat's DNS, the records are fixed automatically. If it's hosted elsewhere, you see the exact values to copy, with a button to check again after you add them.

Common MX record mistakes that stop email

MistakeResultFix
Old provider's records left next to the new onesPart of your mail goes to the old providerDelete every old record
An IP address in the valueSenders reject the recordUse the hostname your provider gives you
A value that points to a CNAMEUnreliable behavior, rejected by some serversUse a hostname with its own A record
The record set on www instead of @Mail to company.com doesn't arriveSet the name to @, or leave it blank, depending on the panel
Editing DNS in a panel that isn't in useNothing changes, however much you editEdit at the provider your nameservers point to
Cancelling the old provider right after the changeLost messages during propagationWait a day or two before cancelling

If receiving works but your outgoing messages land in spam, MX isn't the problem; see why your emails go to spam for the causes.

What to do after setting up your MX record

Send a test message from an outside account, such as Gmail, to your new address, and check that it arrived using webmail before setting up any apps. Then reply from your new address to the same outside account to confirm sending works too, and open the message there to see whether it landed in the inbox or in spam. After that, check your other authentication records, and finally add the email to your team's devices. And tell your team when the move happens, so nobody is surprised by a message that reached the old mailbox during propagation.

The bottom line

An MX record is one line in your DNS, but it's the only road your customers' email takes to reach you. Enter the value exactly as your provider gives it, delete every old record, check the result from more than one place, and wait for propagation before cancelling your previous provider. With a new domain registered with us, you don't have to deal with any of this, because the records are set up automatically from day one.

Want to move your domain to us? Start on the domain transfer page, or message us on WhatsApp with any question.

Frequently asked questions

What is an MX record?

An MX (Mail Exchange) record is an entry in your domain's DNS that tells mail servers around the world where to deliver messages sent to your addresses. Without it, or with a wrong value, messages don't reach your mailboxes even if sending works fine.

What does the priority number in an MX record mean?

It sets the order in which servers are tried: the server with the lowest number is tried first, and if it doesn't answer, the message goes to the next one. If two records share the same number, senders spread messages between them. The number itself doesn't matter, only its order relative to the others.

How long do MX record changes take to work?

Usually from a few minutes to a few hours, depending on the old record's TTL and how long networks keep cached values. In rare cases it can take 24 to 48 hours, so don't cancel your old mailboxes the moment you make the change.

Will changing my MX records affect my website?

No. MX records only handle incoming email; your website depends on other records such as A or CNAME. You can move your email to a new provider and your website keeps working as before, as long as you don't change the website's records by mistake.

Can a domain have more than one MX record?

Yes, and it's common for providers to give a backup server. But all the records must belong to the same email provider. Mixing records from different providers sends part of your mail to mailboxes you never check.

Was this article helpful?

Be the first to rate

Share this article

About the author

فريق إيميلات

Re:Keep reading