Skip to the content
Start free

MX record

An MX record (mail exchange record) is the DNS record that tells other mail servers where to deliver email for your domain, with a preference number for each mail server. Lower numbers are tried first. If your MX records are wrong, email to you can bounce, wait for days in a queue or go to an old provider, while your website carries on as if nothing were wrong.

What is an MX record? #

It is one of the DNS records behind your domain name. The core standard, RFC 1035, calls the type “mail exchange” and says of the preference number: “Lower values are preferred.” Each MX record holds two things: that number, and the host name of a mail server. Cloudflare’s record types page puts it simply: an MX record “is required to deliver email to a mail server”.

How does a sending server use it? #

The email standard, RFC 5321, sets out the steps in section 5.1:

  1. “The lookup first attempts to locate an MX record associated with the name.”
  2. The records are sorted: “Lower numbers are more preferred than higher ones.”
  3. Records with the same number must be tried in random order, “to spread the load”.
  4. If there is no MX record at all, the domain’s own address record is treated as an implicit MX with preference 0.

That last rule surprises people. With no MX record, senders try to deliver to the same address as your website.

What happens when the mail server is down? #

Email does not simply vanish. RFC 5321 says a sender must wait before retrying, the retry interval “SHOULD be at least 30 minutes”, and “the give-up time generally needs to be at least 4-5 days”. So a broken MX record often shows up as slow email first and bounces days later. A second MX record with a higher number gives senders another place to try, but only if that server really accepts your mail.

MX records do not change rankings. They matter for the email that runs a website. Google Search Console and Bing Webmaster Tools send you messages about problems. Your shop sends order emails and sign-in codes. Customers reply to calls to action by email, and each lost enquiry is a lost conversion your conversion tracking never sees. In the UK, the Electronic Commerce Regulations 2002 say a business must give “the details of the service provider, including his electronic mail address”. An address that bounces fails that duty in practice. See what a UK business website must show by law.

Why does it matter for AI answers? #

An AI assistant that answers “how do I contact this firm?” quotes the email address it found on your pages, in your schema markup or in your llms.txt. Schema.org’s email property exists on Organization, Person and ContactPoint for this. If the MX record behind that address is broken, the AI gives a correct answer that leads nowhere. Your contact details are part of how machines know your business as an entity; see also knowledge graph. Keep them working and keep them the same everywhere. As AI agents start to place orders for people, see agentic commerce, the confirmation email has to arrive too.

Rules for the mail server name #

  • No aliases. RFC 2181 says the host part of an MX record “must not be an alias”. It must have its own A or AAAA records, not a CNAME.
  • A name, not an address. The value is a host name such as mx1.mailprovider.example, never a bare IP address.
  • DNS-only behind a CDN. Cloudflare’s proxy status page says “Other record types (such as MX or TXT) are always DNS-only”, and recommends DNS-only for records used for email routing. Only A, AAAA and CNAME records can be proxied through a CDN like Cloudflare.

Worked example: two mail servers and a spare domain #

A law firm’s domain has two MX records. In a zone file they look like this (the server names are examples):

example.com.   3600  IN  MX  10  mx1.mailprovider.example.
example.com.   3600  IN  MX  20  mx2.mailprovider.example.

Senders try mx1 first, because 10 is lower than 20, and use mx2 only if the first cannot be reached. To see your own records from a command line, run nslookup -type=mx example.com.

The firm also owns a second domain, on a different top-level domain, that never receives email. RFC 7505 defines a “Null MX” for this: one MX record with preference number 0 and a server name of just a dot.

example.org.   3600  IN  MX  0  .

It tells senders straight away that the domain does not accept email, instead of leaving them to try the domain’s address record. RFC 7505 says a domain with a null MX “MUST NOT” publish any other MX record. A server that rejects a message for this reason should use reply code 556 with status 5.1.10, “Recipient address has null MX”.

Reading the numbers #

Set-up What senders do
10 mx1, 20 mx2 mx1 first; mx2 only if mx1 fails
10 mx1, 10 mx2 random choice between the two, to share the load
no MX at all the domain’s address record is used as the mail server
0 . no mail accepted; delivery fails at once
an MX pointing at a CNAME not allowed by RFC 2181; results vary

How MX ties in with SPF, DKIM and DMARC #

MX records say where mail comes in. SPF, DKIM and DMARC say which mail going out is really yours. They link up: the mx term in an SPF record, defined in RFC 7208, allows the servers named in your MX records to send. Change mail provider, and you usually change all four. Our entry SPF, DKIM and DMARC explained covers the set, and email deliverability covers why mail lands in spam.

Common mistakes #

  • Old records left behind. Records with the same number are picked at random, so one old record can send part of your mail to a former provider.
  • Mail on a subdomain forgotten. A subdomain such as support.example.com needs its own MX records if it receives mail.
  • Typos in the host name. Use the exact names your provider gives you, including any trailing dot your DNS panel expects.
  • An MX pointing at a CNAME. Not allowed by RFC 2181.
  • Moving the website and forgetting the mail. A redirect moves web traffic; it does nothing for email.
  • No record on a domain that should not get mail. Add a null MX so senders fail fast.

How to check it #

  1. List every MX record from outside with our DNS lookup. After a change, the DNS propagation checker shows when the world sees it. Remember the old DNS answer can be cached for its TTL.
  2. Check each host name matches your current mail provider, and that each has its own address records, not a CNAME.
  3. Check the outgoing side. The SPF record explainer reads your SPF line, the DKIM record decoder reads your key, the DMARC record generator writes a policy, and the email security checker looks at all of them.
  4. Send a test email from an outside account. If it is late or lands in spam, paste its headers into the email header analyser to see each hop.
  5. If your domain has no MX record, run the HTTP Header Checker on the bare domain: that address is where senders will try to deliver.
  6. Find every place your email address is published. The UK Shop Compliance Checker looks for company details on the page. The Schema Markup Checker reads the email in your Organization markup, and the schema generator writes it if it is missing.
  7. Make sure every copy says the same thing. The AI Consistency Checker compares the page, schema, llms.txt and feeds, and the llms.txt Checker reads your llms.txt.
  8. Check AI and search can read your contact page: Can Google index this page?, the Markdown Version Checker for a clean copy, and the AI Readiness Checker for the whole site.
  9. Moving domain? Run the Redirect Checker for the web side and recheck the MX records for the mail side, then run the SEO Audit. See move a website without losing traffic.
  10. Check who could fake you. The lookalike domain checker lists names close to yours.

Single checks on each tool page: free, no account (2 a day). The full audit: a free account (sign in with an emailed code), 1 a day.

What URSY.com counts #

We count web requests, not email. Every request the website answers is counted from the CDN’s edge log and the origin, and sorted into five visitor types: people, search engines, AI crawlers, AI agents and other machines (API/MCP calls included). We never keep full IP addresses or what people type. See our methodology.

Questions #

Do I need two MX records? #

Not always. Follow your mail provider’s list. A second record with a higher number gives senders a back-up, but only if that server takes your mail.

What if my domain has no MX record? #

RFC 5321 says senders then treat the domain’s address record as the mail server. Add proper MX records, or a null MX if the domain takes no mail.

Can an MX record point to a CNAME? #

No. RFC 2181 says the mail server name must not be an alias.

Why is my email late rather than bounced? #

Senders retry for days. RFC 5321 says the give-up time is usually at least 4-5 days.

Does an MX record affect SEO? #

Not directly. It affects the email your site depends on, and the contact details search engines and AI show people.

Sources #

Updated 24 November 2026 by URSY.com.

Cite this page: MX record. URSY. Updated 26 November 2026. https://ursy.com/wiki/mx-record/ · Section links

Tools for this

All 871 wiki entries, A to Z →