Email provider DNS records: what MX, SPF, DKIM and DMARC each do
Every mailbox or sending service you use asks for DNS records on your domain. Each record has its own name in DNS and does one job. This page shows what each one does, the values the larger providers publish, and which records change when you switch.
The short answer
A mail provider needs MX records that send incoming mail to its servers, an include in your single SPF record, and DKIM records at its own selector names. Your DMARC record belongs to you and stays the same across providers. When you switch, add the new provider’s records before you remove the old ones.
The four records, one by one
| Record | Name | What it does | Who gives you the value |
|---|---|---|---|
| MX | example.com |
Tells other servers where to deliver mail for the domain. Senders try the lowest preference number first [1]. | Your mailbox provider |
| SPF, a TXT record | example.com |
Lists the servers allowed to send mail with your domain in the envelope sender [2]. Only one SPF record per name: a second one is an error [2]. | Each sending service documents what to add, such as an include, and you merge them into one record |
| DKIM, a TXT or CNAME record | <selector>._domainkey.example.com |
Publishes the public key receivers use to check the signature on each message [3]. | Every service that signs for you, at its own selector |
| DMARC, a TXT record | _dmarc.example.com |
Says what you ask receivers to do with mail whose From domain fails aligned SPF and DKIM, and where to send reports [4]. | You |
A full set for example.com with Fastmail as the provider, using the values Fastmail documents [10]:
example.com. MX 10 in1-smtp.messagingengine.com.
example.com. MX 20 in2-smtp.messagingengine.com.
example.com. TXT "v=spf1 include:spf.messagingengine.com ~all"
fm1._domainkey.example.com. CNAME fm1.example.com.dkim.fmhosted.com.
fm2._domainkey.example.com. CNAME fm2.example.com.dkim.fmhosted.com.
fm3._domainkey.example.com. CNAME fm3.example.com.dkim.fmhosted.com.
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
Fastmail’s own suggested SPF record ends in ?all [10], and Google recommends ~all [7]. The example uses ~all. If you already have an SPF record, keep its all and add the include. The rua tag names the mailbox that receives aggregate reports [4].
A domain that sends and receives no mail at all needs a different set, built around a null MX record: 0 . as the only MX [5]. That set is in lock down a domain that sends no email.
Values the larger providers publish
| Provider | MX | SPF include | DKIM records |
|---|---|---|---|
| Google Workspace | smtp.google.com, priority 1 [6] |
include:_spf.google.com [7] |
TXT at google._domainkey, the default selector [8] |
| Microsoft 365 | The value shown in the Microsoft 365 admin center, typically priority 0 [9] | include:spf.protection.outlook.com [9] |
CNAME at selector1._domainkey and selector2._domainkey [9] |
| Fastmail | in1-smtp.messagingengine.com priority 10, in2-smtp.messagingengine.com priority 20, unless you choose its regional MX servers [10] |
include:spf.messagingengine.com [10] |
CNAME at fm1._domainkey, fm2._domainkey and fm3._domainkey [10] |
| Cloudflare Email Routing | route1.mx.cloudflare.net, route2.mx.cloudflare.net, route3.mx.cloudflare.net [11] |
include:_spf.mx.cloudflare.net [11] |
TXT at cf2024-1._domainkey [11] |
Google says domains that started on Google Workspace before 2023 may still use older MX values starting with aspmx, and those keep working [6]. Microsoft tells you to add its include to the SPF record you already have instead of creating a second one [9], and Google asks you to update your SPF record whenever you add a sender [7].
Problems and fixes
Mail goes missing while you change provider
Some messages land in the old mailboxes, some bounce, and outgoing mail starts failing SPF. Change email provider without losing a single message.
Cloudflare deleted your MX records when you turned off Email Routing
You pointed Email Routing’s MX record at a new provider, disabled Email Routing, and the domain stopped receiving mail [11]. Turning off Cloudflare Email Routing deletes your MX, SPF and DKIM records.
Mail from your own server is rejected or lands in spam
Gmail answers with 550 5.7.25 because the sending IP has no matching PTR record [12], or a bounce names a blocklist that lists your IP. Running your own mail server in 2026: what it takes to get delivered.
Two problems that can follow a provider change live in other topics: two SPF records on one domain and DKIM records still pointing at your old provider. What Gmail, Yahoo and Outlook.com demand from senders is in sender requirements.
Check your MX records
The checker reads your MX records from your browser, names the provider they point to, and flags a missing MX, a null MX next to other MX records, and MX records that point at an IP address or a CNAME.
Runs in your browser. Your domain is not sent to this site or stored.
Guides in this topic
Change email provider without losing a single message
Move your domain to a new email provider without bounces. Set up the new SPF and DKIM first, lower the TTL, switch MX in one edit, then clean up the old ones.
Turning off Cloudflare Email Routing deletes your MX, SPF and DKIM records
Disabling Cloudflare Email Routing deletes its MX, SPF and DKIM records. That includes the ones you edited. The safe order to leave it, and how to move onto it.
Running your own mail server in 2026: what it takes to get delivered
A self hosted email server needs a static IP, matching PTR and open port 25. It also needs TLS, SPF, DKIM, DMARC and a clean blocklist record. What each costs.
