MX Record: What It Is and How to Set It Up

· · 5 min read · updated on

Quick answer: an MX (mail exchanger) record is the DNS entry that tells other mail servers where to deliver email for your domain. It has a priority number and a host name, for example 10 inbound.mailprovider.example. You create it in the DNS of your domain (at your registrar or wherever your nameservers point), with the exact values your email provider gives you, and remove any MX records from a previous provider.

What an MX record does

When someone writes to hello@yourcompany.com, their mail server looks up the MX records of yourcompany.com and connects to the host listed there. That is the whole job: MX records route incoming mail. They do not affect your website (that is the A, AAAA and CNAME records) and they do not decide who may send for your domain (that is SPF).

The rules come from RFC 5321, the standard for email delivery: the sender picks the MX host with the lowest priority number and tries the others if it is unreachable.

How priority works

Each MX record has a number. Lower means preferred:

  • 10 mx1.provider.example is tried first;
  • 20 mx2.provider.example is tried only if the first does not answer.

If two records have the same number, senders spread mail between them. Use exactly the numbers your provider gives you; if it gives a single host, 10 is the usual choice.

Set up an MX record step by step

1. Get the values from your email provider

Your provider shows the MX host and priority for your domain. On Domailo, add the domain under Domains and the dashboard lists every record to publish (TXT for ownership, MX, SPF and DKIM), each with a copy button.

2. Open the right DNS panel

Records live wherever your domain's nameservers point. That is usually your registrar (Cloudflare, Namecheap, GoDaddy, Squarespace Domains), but if you moved the nameservers to a web host or to Cloudflare, edit them there. A record added in the wrong panel is simply ignored.

3. Remove the old MX records

If the domain received mail somewhere else, delete those MX records. Mixing two providers splits your incoming mail between them.

4. Add the new record

Field What to enter Example
Type MX MX
Name / Host @ (the domain itself) or blank, as your panel expects @
Mail server / Value The host from your provider inbound.mailprovider.example
Priority The number from your provider 10
TTL Default or Auto Auto

Some panels want a trailing dot after the host (inbound.mailprovider.example.) and others add it for you; follow your panel's examples. On Cloudflare, MX records cannot be proxied, so there is nothing to switch off.

5. Check that it worked

Changes usually appear within minutes to a few hours, depending on the TTL of the old record. To check, run nslookup -type=mx yourcompany.com (Windows) or dig MX yourcompany.com +short (macOS and Linux), or use any public DNS lookup tool. Then send a test from an outside address, such as a personal Gmail. The guide how to check your domain's email setup has the full checklist.

Common mistakes

  • Old and new MX at the same time. Part of your mail keeps going to the old provider.
  • The record in the wrong DNS panel. Check where the nameservers point before you edit.
  • A typo in the host. Copy it instead of typing it.
  • Host with http:// or an IP address. The value is a host name only, never a URL or an IP.
  • Deleting the MX by accident. Without an MX, senders fall back to the domain's A record (RFC 5321); since that is usually your website, mail typically bounces or gets lost.

MX is only half of email setup

MX handles receiving. To send without landing in spam, you also need:

  1. SPF: a TXT record listing the servers allowed to send for your domain (RFC 7208).
  2. DKIM: a signature on each message that proves it came from your domain (RFC 6376).
  3. DMARC: tells receivers what to do with mail that fails SPF and DKIM.

Google's email sender guidelines ask for SPF and DKIM. Our guide MX, SPF, DKIM and DMARC explained covers all four.

Where Domailo fits

Domailo is business email on your own domain for small teams. When you add a domain, it shows the exact MX, SPF and DKIM values to copy and checks the domain for you. Plans are priced per organization, from US$ 5 a month for 2 users, and several people can share an address like hello@ with their own logins. Domailo works in the browser and in the Android app; it does not offer IMAP or POP.

Conclusion

An MX record is a single line in your DNS that decides where your email arrives: the right host, the right priority, in the panel your nameservers point to, with the old provider's records removed. Add SPF and DKIM next so the mail you send arrives too. If you are setting up email on your domain for a small team, Domailo walks you through each record, with a 30-day trial.

Frequently asked questions

Can a domain have more than one MX record?

Yes, from the same provider. Different priorities (10, 20) give a backup host; equal priorities spread mail between hosts. Do not mix MX records from two providers, or incoming mail gets split between them.

How long does an MX record take to work?

Usually minutes to a few hours. It depends on the TTL of the record you replaced: until it expires, some servers still use the old value.

What happens if a domain has no MX record?

Senders fall back to the domain's A record, as defined in RFC 5321. That usually points to the website, which does not accept mail, so messages typically bounce or get lost.

Does an MX record affect my website?

No. The website uses A, AAAA or CNAME records. You can change MX records without touching the site.

What is the difference between MX and SPF?

MX says where mail for your domain is delivered. SPF is a TXT record that lists which servers may send mail for your domain. You need both: MX to receive, SPF (with DKIM) to send without landing in spam.