Skip to content
AdminKit

Migrating email providers without breaking SPF, DKIM or DMARC

AdminKit walks through migrating email providers without breaking SPF, DKIM or DMARC: SPF must authorize the new provider before the old one is removed, DKIM needs the new selector live and verified before signing moves over, and DMARC alignment can fail silently for any sending source you haven't added — sequencing is what prevents a week of bounced mail.

By AdminKit team, Netbase JSC · Updated

Key takeaways

  • A provider switch changes four records: MX for incoming mail, SPF and DKIM for outgoing mail, and DMARC, which judges the other two. They don’t change together, so the order matters.
  • Add before you remove. Publish the new provider’s SPF entry and DKIM selector, check them, and only then move MX. Remove the old provider’s entries last.
  • Leave DMARC policy alone during the move and read its aggregate reports. They are the only place you’ll see a sender you forgot about.
  • Two providers in one SPF record can push you over the 10-lookup limit, and two providers can want the same DKIM selector name. Check both before publishing.
  • Retire the old DKIM key by publishing an empty p=, not by deleting it. Verifiers treat both the same; the empty key just makes the retirement obvious.

Why does a migration touch four records, not one?

Moving mail from one provider to another — self-hosted to a cloud suite, one cloud suite to another, or consolidating several domains onto one provider — looks on the surface like changing a single MX record. In practice, four separate DNS-published pieces — each a record type RFC 1035 defines, also tracked in the IETF Datatracker — all need to agree before mail flows correctly: MX decides where incoming mail is routed, SPF decides which outgoing servers are authorized to send as your domain, DKIM decides whether a receiver can verify that an outgoing message wasn’t altered, and DMARC decides what happens to mail that fails the other two — see SPF, DKIM and DMARC explained for how the three work together in the steady state this guide is migrating to. A migration is risky specifically because these four normally change together but don’t update atomically: DNS propagates on its own schedule, and the new provider typically needs its own records published and verified before you can safely rely on it for anything real.

Here is what the records of an imaginary domain look like before, during and after a move from “Old Mail” to “New Mail”. The provider names, selectors and addresses are placeholders:

RecordBeforeDuring the moveAfter
MX10 mx.oldmail.example10 mx.newmail.example (switched in step 6)10 mx.newmail.example
SPFinclude:spf.oldmail.exampleboth include: entriesinclude:spf.newmail.example
DKIMold1._domainkeyold1._domainkey and new1._domainkeynew1 live, old1 revoked (p=)
DMARCunchangedunchangedunchanged, then tighten later

For the formal DMARC rules, note that RFC 9989, published in May 2026, obsoletes RFC 7489. The parts this guide relies on, the p= policy, rua aggregate reports and identifier alignment, carry over from one to the other. RFC 7489 is still cited here because many existing records and report generators were built against it.

What order keeps mail flowing throughout?

The sequence below keeps every step reversible and verified before the next one depends on it, rather than changing everything at once and finding out what broke afterward.

Step 1: inventory what’s actually live today

Before changing anything, record your current state with AdminKit’s free, account-free checks: MX lookup for your current mail hosts and their priorities, SPF check for every service currently authorized to send as your domain, DKIM check for your current selector(s), and DMARC check for your current policy and reporting address. This list is what you’ll be comparing against at the end to confirm nothing legitimate got dropped along the way — and it’s the only reliable way to catch a sending service (a CRM, an invoicing tool, a helpdesk) that was authorized under the old provider and that you’d otherwise forget exists.

DKIM selectors are the part people usually don’t know. Google’s setup guide suggests sending yourself a test message and reading the s= value in its DKIM-Signature header; do that for each system that sends as your domain, and write down the selector names.

Step 2: lower TTLs ahead of the cutover

Every DNS record carries a TTL controlling how long a resolver may cache the previous answer before re-checking — see DNS propagation and TTL explained for realistic timelines. Lowering the TTL on your MX, SPF and DKIM records a day or more before you plan to change them means a mistake you catch quickly can also be rolled back quickly, instead of staying cached at a stale value for hours after you’ve already fixed it. The MX record gains the most, since it’s the one you may need to switch back in a hurry. For SPF, Microsoft recommends a TTL of at least 3,600 seconds (one hour) to avoid DNS lookup timeouts, so don’t go below that.

Step 3: dual-publish SPF for both providers

Add the new provider’s include (or ip4/ip6) mechanism to your SPF record alongside the old provider’s — don’t remove the old one yet. Re-run SPF check after adding it: stacking two providers’ mechanisms temporarily is exactly the kind of change that can push a record over RFC 7208’s 10-DNS-lookup limit — Google Workspace’s own SPF troubleshooting guide warns about the identical risk, noting that nested lookups inside each provider’s own include count toward the same limit — so confirm you’re still under it before moving on — see fixing SPF “too many DNS lookups” (PermError) if the check flags it. Keep both providers authorized until you’re confident nothing is still sending through the old one (Step 5 covers how to confirm that).

A domain must have exactly one SPF record, so this means editing the existing record, not adding a second one. Two SPF records on the same name are a permerror under RFC 7208 §4.5. The interim record looks like this (placeholder names):

example.com.  3600  IN  TXT  "v=spf1 include:spf.oldmail.example include:spf.newmail.example -all"

Step 4: publish the new provider’s DKIM selector, then verify before signing switches

Your new provider will generate its own key pair and selector name — publish the TXT record it gives you, then confirm it with DKIM check before the provider actually starts signing with it. This is the same overlap principle covered in how to rotate a DKIM key without breaking mail, applied here to two different providers’ keys running in parallel rather than two versions of your own: mail already in transit when signing switches over still carries whichever selector’s signature was live at send time, so both the old and new provider’s selector records need to stay published and valid through the transition, not just the new one. See DKIM selector and record mistakes that break signing for the syntax errors that most often undermine a selector that otherwise looks right.

Two provider-specific details catch people out. First, the record isn’t always a TXT record you paste: Microsoft 365 asks for two CNAME records, selector1._domainkey and selector2._domainkey, pointing at names Microsoft hosts, so the key lives in Microsoft’s DNS. Second, selector names can collide. Google Workspace uses the prefix google by default and tells you to pick a different one if your domain already has a key under that name. If your old and new providers would use the same selector, settle on a new name before you publish anything, or you’ll overwrite the key the old provider is still signing with.

; During the move: both selectors published (placeholder values)
old1._domainkey.example.com.  3600  IN  TXT    "v=DKIM1; k=rsa; p=MIIBIjANBg...old"
new1._domainkey.example.com.  3600  IN  TXT    "v=DKIM1; k=rsa; p=MIIBIjANBg...new"
; A Microsoft 365 selector is a CNAME instead of a TXT record
selector1._domainkey.example.com.  3600  IN  CNAME  selector1-example-com._domainkey.tenant.onmicrosoft.example.

Step 5: leave DMARC policy alone, and watch what it reports

Resist the urge to change your DMARC policy as part of the same cutover — keep it at whatever it already was (or publish a new record at p=none if you didn’t have one) so it does one job during the migration: tell you, via its rua aggregate reports, whether mail from the new provider is actually passing SPF and DKIM alignment before you’ve committed to it. Reading DMARC aggregate reports and rolling out to p=reject safely covers how to read those reports in detail. If reports show the new provider’s source passing cleanly, you have real evidence the migration is working, not just an assumption based on the records looking correct.

AdminKit’s DMARC report analyzer opens a report file in your browser and shows each source IP with its message count and its aligned SPF and DKIM results. During a migration, read the rows like this:

Source in the reportSPF alignedDKIM alignedWhat it tells you
New providerpasspassThe new setup works
New providerpassfailSigning isn’t on yet, or the selector isn’t published
Old providerpasspassSomething still sends through the old provider
A server you don’t recognisefailpassProbably forwarding; see the forwarding guide
A server you don’t recognisefailfailA forgotten sender, or spoofing; find out which

The forwarding case is covered in why email forwarding breaks SPF.

Step 6: cut over MX, then confirm before touching anything else

Once the new provider is accepting mail correctly and SPF/DKIM are both verified for it, update your MX records to point at the new provider. Re-run MX lookup afterward — how to read an MX lookup result covers the common case where a lookup still briefly shows the old hosts due to TTL caching rather than a failed change, so don’t assume the cutover failed before the old TTL has had time to expire everywhere. Keep the old mailboxes reachable until then, because senders with the old MX record cached will keep delivering to the old provider.

Step 7: retire the old provider’s records, not delete them outright

Once mail has been flowing through the new provider cleanly for a period you’re confident covers any mail still in flight from before the cutover, remove the old provider’s SPF mechanism and revoke (rather than delete) its DKIM selector by publishing an empty p= value at that selector’s hostname, the same pattern how to rotate a DKIM key without breaking mail uses for a same-provider key rotation. RFC 6376 §3.6.1 defines an empty p= as a revoked key, and §6.1.2 says verifiers return PERMFAIL (key revoked) for signatures that use it. The RFC also says there is “no defined semantic difference” between a revoked key and a deleted record, so receivers treat old signatures the same either way. The empty key is about clarity: anyone who looks later can see the selector was retired on purpose, rather than wondering whether someone forgot to finish a setup.

What should you do if something breaks mid-cutover?

Lowering TTLs in step 2 is what makes a rollback possible. With a short TTL, senders pick up a reverted record quickly, and the old mailboxes are still there to receive mail. Match the symptom to the step that caused it:

SymptomLikely causeWhat to do
Incoming mail stops after the MX changeThe new provider isn’t accepting mail for your domain yetPoint MX back at the old provider, then fix the new setup
Mail from the new provider fails SPFThe new include is missing, or the record is over 10 lookupsFix the single SPF record and re-run the SPF check
Mail from the new provider fails DKIMSigning is off, or it uses a selector you didn’t publishCompare the s= in a signed message with the DKIM check
One tool’s mail fails after step 7That tool still sent through the old providerPut the old SPF entry back, then move the tool

The mistake that causes most post-migration delivery problems

Mailbox migration and mail-sending migration aren’t always the same event. A billing system, support desk, marketing platform or internal application often keeps sending transactional mail through the old provider’s SMTP relay well after user mailboxes have already moved to the new one — and if that sender was only authorized through the old provider’s SPF include, it silently starts failing SPF the moment that include is removed. Checking DMARC aggregate reports (Step 5) for every sending source still appearing there, not just the ones you remember configuring, is what catches this before it causes a delivery problem instead of after one is already reported to you.

How do you confirm the migration is finished?

Once the old provider’s records are retired, run all four checks again — MX lookup, SPF check, DKIM check and DMARC check — and compare the result against the inventory from Step 1. Every legitimate sending source from the original list should still be authorized somewhere in the new setup; anything that’s missing is worth tracking down before you consider the migration finished, not after someone reports mail that never arrived. Only after reports have stayed clean for a while is it worth tightening DMARC policy, as a separate change. This migration walkthrough is part of AdminKit’s email authentication cluster of SPF, DKIM and DMARC guides and tools.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

What actually breaks if I just update the MX record and call it done?

Mail starts arriving at the new provider, but SPF, DKIM and DMARC don't update themselves alongside it. If the new provider's sending servers aren't in your SPF record yet, outbound mail you send from the new system fails SPF; if DKIM isn't signing with a selector published in DNS, every outgoing message fails DKIM too. With both failing, a DMARC policy at quarantine or reject can cause your own legitimate mail to be filtered or dropped the moment you switch, not just mail from an attacker.

Should I update MX, SPF, DKIM and DMARC all at the same time?

No — update them in an order that keeps every step reversible and verified before the next one depends on it. SPF and DKIM for the new provider should be published and checked before you route any real mail through it; MX should move only once you've confirmed the new provider is ready to receive; DMARC policy itself usually shouldn't change at all during a migration, so it keeps reporting on whatever is actually happening without also being a variable you're changing mid-cutover.

How long should I keep both providers' SPF include active at once?

Until you're certain no outbound mail is still being sent through the old provider — which can be longer than the mailbox migration itself if any automated system (invoicing, a CRM, a helpdesk, a marketing tool) still sends through the old provider's servers after mailboxes have moved. Removing the old include the moment mailboxes move, without checking for straggler senders, is one of the most common causes of mail that fails SPF right after a migration that otherwise looked complete.

Do I need a new DKIM selector for the new provider, or can I reuse the old one?

Use the new provider's own selector — you generally can't choose to reuse the old one anyway, since each provider controls its own selector name and signs with its own key pair. Publish the new provider's selector record and confirm it with a DKIM check before any mail actually signs with it, the same overlap logic used when rotating a DKIM key, just with two different providers' keys live at once instead of two versions of your own. If both providers use the same selector name, ask the new one for a different prefix: Google Workspace, for example, lets you choose another prefix when 'google' is already taken in your DNS.

Should I change my DMARC policy as part of the migration?

Generally no — leave the policy exactly where it was and let the rua aggregate reports tell you whether the new provider's mail is passing alignment, rather than also introducing a policy change as a second variable during the same cutover. If you're migrating a domain that had no DMARC record at all before, this is a reasonable moment to publish one at p=none specifically so you have reporting visibility through the migration, but hold off moving to quarantine or reject until well after the new provider is fully settled in.

What's the single most common way these migrations go wrong?

Forgetting a sending source that isn't the primary mailbox provider — a billing system, a support desk, a marketing platform, or an internal application sending transactional mail — that was authorized under the old provider's SPF include or relied on the old provider's SMTP relay, and quietly starts failing the moment that old infrastructure is decommissioned. Reviewing DMARC aggregate reports before removing anything from the old provider is what catches this before it causes a delivery problem instead of after.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.