Own domain

What is an MX record?

Updated 30 October 2026 · 7 min read

When someone writes to anna@bakery.co.uk, their mail server has to work out where to deliver the message. It does that by asking the DNS for the MX records of bakery.co.uk. Get this one record wrong and mail bounces, arrives late or lands with a provider you left years ago.

Short answer

An MX record (mail exchanger) is a DNS entry that names the server accepting mail for a domain. Each MX has a priority, and sending servers try the lowest number first. It only decides where incoming mail goes; it does not prove who may send mail for you. That is the job of SPF, DKIM and DMARC.

How mail finds its way

Every domain has a zone at a DNS host: a list of records saying where the website lives, where mail goes and which services may act for the domain. The MX record is the one mail servers care about. It contains two things: a priority number and the hostname of a mail server.

When a message is sent, the sender's server looks up the MX records for the part after the @. It picks the record with the lowest priority, connects to that host and hands over the message. If that server cannot be reached, it moves on to the next one in the list and keeps retrying for a while before it gives up and returns the mail to the sender.

What the priority number means

Lower means preferred. A record with priority 10 is tried before one with priority 20. Two records with the same number share the load, and the sending server chooses between them at random. The numbers themselves have no meaning beyond their order, so 10 and 20 behave exactly like 1 and 2.

Backup MX records used to be common, but they only make sense if the backup server knows your mailboxes and passes mail on. An old backup that points to a previous provider is worse than none: some mail will quietly end up there.

Rules an MX record has to follow

  • It must point to a hostname, never to an IP address. If your mail server only has an IP, create an A record for a name such as mail.example.co.uk and point the MX to that name.
  • The hostname must not be an alias. RFC 2181 says MX targets may not be CNAME records, and some senders refuse such mail.
  • It belongs on the domain you write after the @. For addresses ending in @bakery.co.uk the MX sits on the root, usually written as @ in DNS panels, not on www.
  • In a raw zone file the hostname ends with a full stop. Without it, some systems add your domain to the end and the record points to a name that does not exist.

No MX and the null MX

If a domain has no MX at all, RFC 5321 tells senders to fall back to the domain's own address record and try to deliver there. That is rarely what you want, because the web server behind it usually does not accept mail, so messages hang in queues for days before they bounce.

A domain that never receives mail can say so clearly with a null MX: a single MX record with priority 0 and a lone full stop as the host, defined in RFC 7505. Senders then reject mail to that domain at once instead of trying for days. It is useful for domains you keep only for a website or to protect a brand.

How to look up MX records yourself

You do not need special tools. Replace bakery.co.uk with your own domain.

  1. Windows

    Open PowerShell and type Resolve-DnsName bakery.co.uk -Type MX. The older nslookup -type=mx bakery.co.uk in Command Prompt works too.

  2. Mac and Linux

    Open Terminal and type dig MX bakery.co.uk +short. Each line shows a priority followed by a server name.

  3. In Ayamail

    If the domain is added under Domains, the DNS records tab shows what the app sees right now and marks each record as active or pending.

Why changes take time

Every record has a TTL, a number of seconds that resolvers may keep a copy before asking again. If your old MX had a TTL of one hour, some senders may keep using it for up to an hour after you change it. Higher values mean longer waits. Lowering the TTL a day before a planned move makes the switch quicker.

Your DNS host usually applies a change at once. What takes time is the rest of the internet forgetting the old answer. In rare cases it can take up to a day or two.

The mistakes we see most often

  • An old MX is left behind after a move. Mail is split between the old and the new provider, and some messages seem to vanish.
  • The MX points to an IP address or to a CNAME, so strict senders refuse it.
  • The record is created on www or on a subdomain instead of on the root.
  • A typo in the hostname. One wrong letter and every message bounces.
  • The MX is changed at the registrar while the domain's nameservers point to another DNS host, so the change has no effect at all.

What an MX record does not do

The MX record only covers incoming mail. Which servers may send mail as your domain is described by SPF, whether a message really came from you is shown by a DKIM signature, and what receivers should do with mail that fails those checks is set by DMARC. A domain with a correct MX but no SPF or DKIM will still receive mail, but the mail it sends is far more likely to land in spam.

Ayamail's MX record

If your domain's mail should go to Ayamail, this is the only MX record it needs:

Your own domain (MX record)
SettingValue
Mail server (MX)mx1.ayamail.net
Priority10

The app treats any extra MX record that points elsewhere as a blocking problem, because part of your mail would end up there.

Ready to set it up?

The full list of records for your own domain, in the order the app asks for them.

SPF, DKIM and DMARC

The three records that decide whether your sent mail is trusted.

Questions and answers

Can a domain have more than one MX record?
Yes. Large providers often use several to spread the load. Only add the records your provider gives you. Mixing records from two providers splits your mail between them.
Does the MX record affect my website?
No. Websites use A, AAAA and CNAME records. You can move mail to another provider without touching the site.
Why do I still get mail at my old provider after changing the MX?
Some senders still have the old answer cached until its TTL runs out. Wait a few hours, and check that no old MX record is left.
Can a subdomain have its own MX?
Yes. A record on shop.bakery.co.uk only applies to addresses ending in @shop.bakery.co.uk. It does not change mail for the main domain.
  • Connect your domain

    Which MX, SPF, DKIM and DMARC records to add, where to add them and how to check they work. With guides for Cloudflare, GoDaddy, IONOS and more.

  • Cloudflare

    Add Ayamail's MX, SPF, DKIM and DMARC records in Cloudflare. Why the CNAMEs must be DNS only and how to switch off Email Routing safely.

  • GoDaddy

    Add Ayamail's MX and TXT records at GoDaddy. When GoDaddy's DNS applies, and what to do first if the domain has Microsoft 365 from GoDaddy.

  • Close an old account

    Close an old email address without losing bank logins or photos: what to copy, how long to forward, and what Google, Microsoft and Yahoo do.