MX record: what it is, what the priority means, and how to check yours

An MX record is the DNS record that tells other mail servers where to deliver email for your domain. Each one names a mail server’s host name and a priority number, and senders try the lowest number first. A domain needs at least one MX record to receive email; sending works without one.
To see a domain’s MX records right now, type it into the MX lookup. It lists each mail server by priority with its addresses, flags a server named through an alias or a null MX, and says in general terms where the domain’s email arrives. The rest of this post explains what you are looking at, and what to change when it is wrong.
What is an MX record?
An MX (mail exchanger) record is the entry in your domain’s DNS that names the servers that accept email for it. When someone writes to hello@example.com, their mail server takes the part after the at sign, asks DNS for the MX records of example.com, and connects to the server they name. Without that answer it has nowhere reliable to deliver the message.
DNS is the internet’s address book: it holds a domain’s records, each with a type. An A record gives a name an IPv4 address, a TXT record holds text such as your SPF policy, and an MX record holds mail routing. The MX record only affects mail coming in. Mail you send leaves through whichever service you send with, and that service’s SPF and DKIM records are what receivers check, which DKIM, SPF and DMARC explained covers.
Gmail’s and Yahoo’s sender pages make the same split. What they ask of senders is valid forward and reverse DNS for the sending servers, which is a PTR record, plus authentication. Neither asks a sending domain for MX records. You need MX records for one reason: so mail, including replies and bounces, can reach you.
Because one MX record decides where mail lands for every address at the domain, changing it moves all of your mailboxes at once. That is the part people underestimate: the record has no idea that sales@ and support@ exist. It applies to the whole domain, and the MX record glossary entry has a short definition to send a colleague.
What does an MX record look like, and what does the priority number mean?
An MX record is a domain name, a priority number and the host name of a mail server, plus the time to live (TTL) that every DNS record has. Here is an MX record example as it appears in a zone file, the plain-text format DNS servers load, for a domain with a main server and a backup:
example.com. 3600 IN MX 10 mx1.mailhost.example.
example.com. 3600 IN MX 20 mx2.mailhost.example.Read each line left to right: the domain the record belongs to, the TTL in seconds, the class (IN, internet, on every record you will see), the type, the priority, and the host. The trailing dot after the host means the name is complete. In a zone file, a host written without it has the zone’s own name added to the end.
A DNS host’s control panel shows the same record as a form. The field names vary (Host, Name or Hostname; Value, Points to, Mail server or Target), but the parts are the same, and @ stands for the domain itself:
Type: MX
Host: @
Priority: 10
Value: mx1.mailhost.example
TTL: 1 hourMX record priority: lower is tried first
The MX record priority (the RFCs call it the preference) is a number from 0 to 65535, and lower numbers are preferred (RFC 1035 §3.3.9). A sender sorts the records, tries the lowest number first, and moves to the next one only if that server cannot be reached or does not answer. When two records share a number, RFC 5321 §5.1 says the sender must pick between them at random, which spreads the mail across both.
Only the order matters, not the size of the numbers. 10 and 20 behave exactly like 1 and 5. Many mailbox services hand out several records with different numbers; enter every one exactly as given, including the numbers, because the service has already decided which of its servers should be tried first.
A backup record is only a backup if the server it names accepts mail for your domain. A higher-numbered host that belongs to a service you no longer use is not a fallback: it is a second place your mail can go when the first one is slow.
How do I look up a domain's MX records?
The quickest way is an MX lookup: enter the domain, read the list. Our MX lookup reads the records from public DNS and shows the first ten mail servers by priority. For each one it gives the addresses DNS returns and says whether the name is an alias. A last row says where the mail arrives, in general terms read from the host names: at servers under the domain itself, at a hosted mailbox service, or at another company’s servers. If that is not the service you pay for, your records are out of date.
For the wider picture, the email domain check runs the same MX reading alongside SPF, DKIM, DMARC, MTA-STS, TLS-RPT, BIMI and block lists, and lists the three things to fix first.
How to check MX records from a terminal
On macOS or Linux, dig prints each record as its priority and host:
$ dig +short MX example.com
10 mx1.mailhost.example.
20 mx2.mailhost.example.nslookup works on Windows, macOS and Linux. Windows prints each line as MX preference = 10, mail exchanger = …; the others print it as below:
$ nslookup -type=mx example.com
Non-authoritative answer:
example.com mail exchanger = 10 mx1.mailhost.example.
example.com mail exchanger = 20 mx2.mailhost.example.An empty answer from dig +short, or “No answer” from nslookup, means the domain publishes no MX records at all. Both commands ask your own network’s resolver, which may still hold an old answer after a change. To see what your DNS host is publishing this minute, ask its nameserver directly:
$ dig +short NS example.com
ns1.dnshost.example.
$ dig +short MX example.com @ns1.dnshost.exampleWhy must an MX record point to a host name, never an IP address or a CNAME?
Because the standards define the value of an MX record as a host name, and that name has to lead straight to an address. RFC 5321 §5.1 says the data in an MX answer must be a domain name, and that the name must return at least one address record (an A or AAAA record). RFC 2181 §10.3 adds that the name must not be an alias.
; wrong: an MX record must name a host, not an address
example.com. IN MX 10 192.0.2.25
; wrong: the host the MX names is an alias
example.com. IN MX 10 mail.example.com.
mail.example.com. IN CNAME mx1.mailhost.example.
; right: name the host, and give that host its own address
example.com. IN MX 10 mail.example.com.
mail.example.com. IN A 192.0.2.25An IP address typed into the value field is the most common slip, usually because a hosting panel showed the mail server as an address. Some DNS hosts refuse to save it; where it is saved, senders skip the record, and the MX lookup marks it as a fail. The fix is to give the server a name, add an A record for that name with the address, and put the name in the MX record.
A CNAME is subtler. Many senders follow the alias and deliver anyway, so the mistake can sit unnoticed for months, but some refuse, and you cannot tell from your side which ones do. The MX lookup shows an MX host that is an alias as a warning. Point the MX record at the name the alias leads to instead.
What happens if a domain has no MX record?
Senders fall back to the domain’s own address. RFC 5321 §5.1 calls this the implicit MX: when a domain has no MX records, a sender treats the domain itself as its only mail server, with a priority of 0, and connects to its A or AAAA record. The rule applies only when there are no MX records at all.
In practice that address is usually a web server, which takes no mail. The message is not delivered at once: the sender keeps the message and retries, and RFC 5321 §4.5.4.1 suggests a give-up time of at least four to five days. So mail to a domain without MX records tends to fail slowly, with a bounce days later, rather than straight away. A domain with no MX records and no address of its own cannot receive mail at all. The MX lookup shows the first case as a warning and the second as a fail.
A null MX says the domain takes no mail
A domain that should never receive email, such as a parked domain or one that only hosts a website, can say so with a null MX (RFC 7505): a single MX record with priority 0 and a host of just a dot. A sender that sees it gives up on the first attempt instead of retrying for days. RFC 7505 §4.1 suggests that a server refusing such a message reply with code 556 and status 5.1.10.
parked-example.com. IN MX 0 .
parked-example.com. IN TXT "v=spf1 -all"Two rules come with it. The null MX must be the only MX record: RFC 7505 §3 says a domain that publishes one must publish no other, and the MX lookup marks a null MX beside real records as a fail. And a domain with a null MX should not be used as a sender’s address either, because bounces could not come back to it; receivers may refuse that mail, with status 5.7.27. Pair it with an SPF record of v=spf1 -all and a strict DMARC policy so nobody can send as the domain.
How long does an MX record change take?
Usually minutes, at most the old record’s TTL. Resolvers that asked before your change keep the old answer until its time to live runs out, then ask again and get the new one. A TTL of 3600 means up to an hour, and a TTL of 86400 means up to a day.
There is no global update to wait for, which is why “wait 48 hours for DNS propagation” is advice and not a rule. If a domain had no MX records before, resolvers may have cached that empty answer too, for as long as the zone’s SOA record says (RFC 2308 §5): commonly an hour, set by your DNS host.
For a planned move, lower the TTL a day ahead, to 300 seconds for example, so that the switch itself takes effect within minutes. Raise it again once the move has settled:
example.com. 300 IN MX 10 mx1.newhost.example.Why is mail still going to the old server?
Almost always because an old MX record is still published. When a domain moves to a new mailbox service, the new records get added and the old ones get forgotten. Every MX record is a valid destination, so senders keep delivering some messages to the old server, either because its number is lower or because the new one was busy for a moment. Delete every MX record your current service did not give you.
The other causes, in the order to rule them out:
- The old answer is still cached. Within the old TTL some senders still use it. Wait out the TTL, then check the domain’s nameserver directly as shown above.
- You changed the wrong DNS. If the domain’s nameservers point at a different company from the panel you edited, your change is not published anywhere.
dig +short NS example.comshows which DNS host is answering. - The record went on the wrong name. Some panels add the domain to the Host field for you, so typing
example.comthere creates a record forexample.com.example.com. Use@or leave the field empty. - Mail is forwarded. The old service may still forward copies to your new address, or the other way round. Check its forwarding settings before you close the account.
Keep the old mailbox for a week
After a move, leave the old account open until its MX record has been gone for longer than the TTL plus a few days of retries. Senders that were mid-retry when you switched may still deliver there, and you want to be able to collect that mail.
What are the most common MX record problems, and how do you fix them?
Most MX problems are one of a handful of typing or tidying mistakes. Each row below is a result you may see in a lookup, what usually causes it, and the change that fixes it.
| What you see | Usual cause | Fix |
|---|---|---|
| No MX records | Never added, or lost when the domain moved to a new DNS host | Add the records your mailbox service gives you, exactly as given |
| A host with no address | A typo in the host name, or a server that no longer exists | Correct the host name, or delete the record |
| An MX record that names an IP address | An address typed where a host name belongs | Add an A record for a host name and put that name in the MX record |
| An MX host that is an alias (CNAME) | The host was set up as a CNAME to another name | Point the MX record at the name the alias leads to |
| Old mail servers still listed | New records added, old ones never removed | Delete every MX record your current service did not give you |
| A null MX beside real records | A parked domain was put back into use | Delete the 0 . record if the domain should receive mail |
| A host ending in your own domain twice | The trailing dot left off in a zone file, or the domain typed into the Host field | Write the full host name with a trailing dot, and use @ for the domain itself |
Once the records look right, send a test message from an outside address, such as a personal Gmail or Outlook account, and reply to it. Mail arriving both ways is the check that matters. If you are setting up mail on a domain for the first time, the business email setup guide walks through MX, SPF, DKIM and DMARC in order.
Check yours
Which mail servers receive my domain's email?
Check yours
Is my domain set up to send and receive email properly?
Published Updated 12 min readBy the Rasket team
Written for beginners, small business owners and IT admins
Frequently asked questions
Can a domain have more than one MX record?
Yes, and most do. Each record names one mail server with its own priority number. Senders try the lowest number first and move down the list when a server cannot be reached, so two or more records give mail somewhere to go when one server is down.
Do I need an MX record to send email?
No. Sending goes through the service you send with, and receivers check its SPF, DKIM and DMARC, not your MX records. You need MX records to receive mail, which includes replies and bounces. A domain with a null MX should not be used as a sender's address, because receivers may refuse mail whose bounces could not come back.
Can two MX records have the same priority?
Yes. RFC 5321 says a sender must choose between records with the same number at random, so mail is spread across those servers. Equal numbers are how a mailbox service shares the load between servers that do the same job.
Can an MX record point to a subdomain?
Yes. The host in an MX record can be any name that has its own A or AAAA record, such as mail.example.com. A subdomain can also have MX records of its own, so support.example.com can receive mail at a different service from example.com without touching anyone's mailbox.
What does an MX record of 0 followed by a dot mean?
It is a null MX (RFC 7505): the domain says it accepts no email at all. Senders give up on the first attempt instead of retrying for days. It must be the only MX record on the domain, and it suits parked domains and domains that only host a website.
What TTL should an MX record have?
An hour (3600 seconds) is a sensible everyday value. Before a planned move, lower it to around 300 seconds a day ahead so the switch takes effect within minutes, then raise it again once mail is arriving at the new service.
Why does an MX lookup show different addresses each time?
Large mail services answer for each of their host names with a few addresses from a bigger pool, and the few change between queries. That is normal and not a fault. If our MX lookup says an address could not be read, run it again in a minute.
Sources
- RFC 5321: Simple Mail Transfer Protocol, sections 4.5.4.1 and 5.1 — IETF, read 2026-11-19
- RFC 7505: A "Null MX" No Service Resource Record for Domains That Accept No Mail — IETF, read 2026-11-19
- RFC 1035: Domain Names, Implementation and Specification, section 3.3.9 — IETF, read 2026-11-19
- RFC 2181: Clarifications to the DNS Specification, section 10.3 — IETF, read 2026-11-19
- RFC 2308: Negative Caching of DNS Queries, sections 3 and 5 — IETF, read 2026-11-19
- Email sender guidelines — Google, read 2026-11-19
- Sender Best Practices — Yahoo, read 2026-11-19
Related
- MX record — An MX record is the DNS record naming the servers that accept mail for a domain, each with a priority number, where lower numbers are tried first.
- DNS propagation (TTL) — Propagation is the delay between publishing a DNS record and the rest of the internet seeing it. Nothing is actually pushed anywhere: resolvers cache the…
- Business email setup: a step-by-step guide — How to set up business email on your own domain: the four DNS records it needs, six steps with checks, switching without losing mail, and common mistakes.
- DKIM, SPF and DMARC explained (2026 Full Guide) — What SPF, DKIM and DMARC each check, how to read the verdicts on a sent message, the records to publish, and what Gmail and Outlook.com require of senders.
- How to create a business email for free — Four ways to get free email with your own domain, how to check each in minutes, and how to change your MX records without losing any mail.