Skip to content
Groundmail

Free tool · Check

MX record lookup

See which mail servers receive email for a domain, in priority order, and whether each one actually resolves. Under the tool: what an MX record is and how to set one up.

What is an MX record?

An MX (mail exchanger) record is the DNS record that says which server receives email for a domain. Each one has a priority and a mail server host name, and senders try the lowest number first. MX records only control receiving: where mail to your domain, replies and bounces are delivered, not how your own mail is sent.

This lookup lists a domain's MX records in priority order and checks that each mail server resolves to an IP address, so a missing, broken or mistyped record shows up before mail goes astray.

How to read your results

Mail servers resolve
Every MX host has an address, so senders can deliver. Nothing to do.
MX is a CNAME
Some senders won't follow it. Point the MX at the host name the CNAME resolves to.
MX doesn't resolve
The host name has no A or AAAA record, so senders skip it. Fix the spelling, or remove the record if the server is gone.
MX points at an IP address
MX records must name a host, not an IP. Create an A record for the server and point the MX at that name.
No MX records
Senders fall back to the domain's A record, which rarely runs a mail server, so mail to it usually bounces, and some receivers distrust a sending domain that can't receive. Add the MX records your mailbox provider gives you.
Domain accepts no email
A null MX (priority 0, host .) says the domain takes no mail at all. Correct for domains that never receive; remove it if you expect mail.

What an MX record looks like

An MX (mail exchanger) record is a DNS record with two parts: a priority (RFC 1035 calls it the preference), a number from 0 to 65535 where lower is preferred, and a host name, the mail server that accepts email for the domain. A domain can have several. In a DNS zone file they look like this:

Zone file (example)
; name          TTL    class  type  priority  mail server
example.com.    3600   IN     MX    10        mx1.mailhost.example.net.
example.com.    3600   IN     MX    20        mx2.mailhost.example.net.

The same records from the command line:

dig (example)
$ dig +short MX example.com
10 mx1.mailhost.example.net.
20 mx2.mailhost.example.net.
FieldExampleWhat it is
Nameexample.com (@ at most DNS hosts)The domain the record receives mail for: the part after the @ in ada@example.com.
TTL3600How many seconds resolvers may cache the answer. A change can take this long to reach every sender.
Priority10Which server senders try first. Lower numbers first.
Mail servermx1.mailhost.example.netA host name with its own A or AAAA record. Never an IP address and never a CNAME.

How MX priority works

  • Lowest number first. A sender sorts the records by priority and tries the lowest number. If that server doesn't answer, it tries the next.
  • Equal numbers share the load. RFC 5321 says a sender must pick among records with the same priority at random, so two servers at 10 each get about half the mail.
  • Only the order matters. 10 and 20 behave exactly like 1 and 2. Providers leave gaps so you can add a server in between later.
  • A backup is a real mail server. A higher-numbered MX receives mail whenever the first one is unreachable, so it must accept and filter mail for your domain like the primary does.

Most hosted mailbox providers give you one record, or several with set priorities. Copy them exactly as given rather than choosing your own numbers.

What MX records do and don't do

MX records only say where mail to a domain goes. Changing them moves your inbox, not your sending: the email your app sends goes out through your email provider whatever your MX records say. Whether that mail is trusted is down to SPF, DKIM and DMARC, which are TXT records and don't depend on MX.

MailWhich domain's MX is used
Email people send to you@example.comexample.com
Replies to your app's emailsThe Reply-To domain, or the From domain if there's no Reply-To
Bounces and delivery reports for your app's emailsThe return-path (envelope sender) domain, which your email provider usually runs
Email your app sendsNone of yours: each recipient's domain's MX
  • SPF can use MX. The SPF mx mechanism authorizes the servers your MX records point to. It's only right when those same servers send your mail, and it counts toward SPF's limit of 10 DNS lookups. Hosted inboxes usually send from other servers and give you an include: instead. Check your record with the SPF checker.
  • DKIM and DMARC don't use MX at all. They're TXT records under _domainkey and _dmarc.

No MX record, null MX and subdomains

  • No MX record. RFC 5321 says a sender then treats the domain's own A or AAAA record as an implicit MX with priority 0. A web server rarely accepts mail, so mail to the domain usually fails. If the domain has no address record either, there is nowhere to deliver.
  • Null MX. A single record with priority 0 and host . (RFC 7505) says the domain accepts no mail at all, so senders fail at once instead of retrying for days. It's right for domains that never receive. RFC 7505 says not to publish one on a domain you use in From or as a return path: receivers often reject mail whose return address can't receive.
  • Subdomains don't inherit MX. Records belong to one exact name, so notifications.example.com has no MX just because example.com does. If you send from a subdomain without an MX or Reply-To, replies to it have nowhere to go.
  • A CNAME is followed first. If a name is a CNAME, senders look up the MX of its target. That's why a return-path CNAME such as rp.example.com pointing to your email provider sends bounces to the provider, which processes them for you.

Common MX record mistakes

MistakeWhat happensFix
MX points at an IP address (10 203.0.113.10)RFC 5321 says the record must contain a domain name, so many senders can't use it.Add an A record such as mail.example.com for the IP, and point the MX at that name.
MX points at a CNAMERFC 2181 says an MX target must not be an alias; some senders won't follow it.Point the MX at the host name the CNAME resolves to.
Domain added twice (mx1.mailhost.example.net.example.com)Some DNS hosts treat a value without a trailing dot as relative and append your domain, so the host doesn't exist.Enter the full host name, with a trailing dot if your DNS host's help says so, then look it up again.
Old provider's records left in placeMail is split between old and new servers (equal priority), or goes to the old one whenever the new one doesn't answer.Remove the old provider's MX records once the new ones work.
Receiving service added at the root (@) instead of a subdomainAll mail to the domain, including your team's mailboxes, now goes to that service.Put app inbound on its own subdomain, such as inbound.example.com, and keep the root pointed at your mailbox provider.
Mail server name proxied through a CDNThe name answers with the CDN's IP addresses, which don't accept mail.Set the mail server's own A record to DNS only. Cloudflare's version of this is the common one.
Null MX on a domain you send fromReceivers can reject your mail because its return address can't receive.Remove the null MX, or send from a domain that receives.

Requirements from RFC 5321, section 5.1, RFC 2181, section 10.3 and RFC 7505.

How to add an MX record

Every DNS host asks for the same four things: the type (MX), the name or host (@ for the domain itself, or a subdomain such as inbound), the mail server's host name, and the priority. Use the exact values your mailbox or inbound provider gives you, save, then run the lookup above. Until the old record's TTL runs out, some senders may still use the old answer.

Step-by-step guides for the common DNS hosts, with screenshots:

  • Cloudflare: MX records are always DNS only, and Email Routing's MX records are locked.
  • GoDaddy: the Name, Priority and Value fields, and why to leave the root's MX alone.
  • Namecheap: MX records live under Mail Settings, set to Custom MX.
  • Bluehost: the DNS tab, removing the default MX record, and cPanel's Email Routing setting.

To receive email in your app with Groundmail, add mx.groundmail.dev at priority 10 on a subdomain such as inbound.example.com. Mail to that subdomain arrives as a signed webhook and through the same API you send with, and your team's mailboxes on the root domain stay where they are.

Sources

Receive email on a subdomain with Groundmail.

Point an MX record at Groundmail and mail to that domain arrives as a webhook and through the API you send with. Good for replies, support inboxes and parsing.

Questions

What is an MX record?

A DNS record that names the server that receives email for a domain. A domain can have several, with priorities that set the order senders try them in.

What does MX priority mean?

The order senders try the servers in: lowest number first. Two records with the same priority share the load; a higher number is a backup used when the lower ones don't answer.

Do I need MX records to send email?

Not to send, but replies and bounces need somewhere to go, and some receivers reject mail whose return address can't receive. If you send from a subdomain that doesn't receive, set a Reply-To that does; your email provider's return path handles bounces.

Does changing my MX records affect the email my app sends?

No. MX records decide where mail to your domain is delivered. Your app's mail goes out through your email provider, and whether it's trusted depends on SPF, DKIM and DMARC. Changing the root domain's MX does move your team's inbox, so put app inbound on a subdomain.

Can an MX record point to a CNAME?

It shouldn't. RFC 2181 says MX targets must have their own address records, and some mail servers refuse to follow a CNAME.

How long does an MX record change take?

Up to the old record's TTL (its time to live, in seconds). Resolvers that cached the old answer keep using it until then, so some mail can still arrive at the old server for a while. Leave the old server running until the TTL has passed.

How do I look up MX records from the command line?

dig +short MX example.com on macOS and Linux, or nslookup -type=mx example.com on Windows. Both show what public DNS returns, which this tool also shows with each host's IPs.