Three records, two identities
Every email carries two sender identities. The envelope sender (MAIL FROM, which ends up as the Return-Path) is what servers use during delivery and what SPF checks [1]. The header From: is what the recipient sees. DKIM signs the message with a private key whose public half you publish in DNS under a selector [2]. DMARC then asks whether a passing SPF or DKIM result belongs to the same domain as the visible From: [3]. That match is called alignment, and it's the part most setups get wrong.
Alignment is relaxed by default, so mail.example.com aligns with example.com; strict mode (adkim=s, aspf=s) requires an exact match [3]. A message passes DMARC when either SPF or DKIM passes and aligns [3]. In practice DKIM is the one to rely on: SPF breaks when mail is forwarded, and many sending platforms use their own Return-Path domain, which passes SPF without aligning.
SPF: one record, ten lookups
An SPF record is a TXT record on the domain that starts with v=spf1, lists who may send, and ends with an all mechanism. Google's record for a domain that sends only through Workspace is v=spf1 include:_spf.google.com ~all [4]. Microsoft's for a domain that sends only through Microsoft 365 is v=spf1 include:spf.protection.outlook.com -all [7]. When several services send for you they share one record; Google's example for Workspace plus Microsoft 365 is v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all [4].
The two vendors disagree on the ending. Google recommends ~all, a soft fail [4]. Microsoft recommends -all, a hard fail, so DMARC can act on messages that fail SPF even when they carry no DKIM signature [7]. Once DMARC is enforcing either works; what matters is that every legitimate sender is listed. The mistakes that break SPF are few and common:
- Two SPF records. A domain must not publish more than one; if it does, SPF returns a permanent error for every message [1,7]. Adding a service means editing the existing record, not adding another.
- Too many lookups. The include, a, mx, ptr and exists mechanisms and the redirect modifier each cost a DNS lookup during evaluation, and more than 10 is a permanent error [1]. Includes inside includes count too. The ip4 and ip6 mechanisms don't [1].
- Void lookups. An include pointing at a name that returns nothing counts as a void lookup, and the RFC recommends treating more than two as a permanent error [1]. Remove entries for services you no longer use.
- Subdomains. The record on example.com doesn't cover mail.example.com; every subdomain that sends needs its own [7].
- Domains you never send from. Publish v=spf1 -all on them so nobody can pass SPF while pretending to be you [7].
DKIM: a key for every sending service
DKIM publishes a public key at selector._domainkey.yourdomain, and the sending service signs each message with the matching private key [2]. Every service that sends as your domain (your mailboxes, your CRM, your newsletter tool) needs its own DKIM setup with its own selector, signing as your domain rather than its own.
In Google Workspace you generate the key in the Admin console under Gmail's Authenticate email settings. Choose a 2048-bit key if your DNS host supports it, keep the default selector google, publish the TXT record at google._domainkey, then come back and click Start authentication [5]. Google notes that after turning on Gmail you may wait 24–72 hours before you can generate the key, and that DKIM can take up to 48 hours to start working after you publish it [5].
Microsoft 365 uses two CNAME records instead, selector1._domainkey and selector2._domainkey, which point at keys Microsoft hosts so it can rotate them [8]. Copy the exact values from the DKIM tab of Email authentication settings in the Defender portal, publish both CNAMEs, then turn on Sign messages for this domain with DKIM signatures [8]. Until you do, Microsoft does not DKIM-sign mail from custom domains at all [8].
- Doubled host names. Many DNS hosts append your domain automatically, so typing google._domainkey.example.com creates google._domainkey.example.com.example.com. If yours does, enter only the part before your domain.
- Long keys. A 2048-bit key is long, and some DNS hosts limit TXT record length; Google's DKIM guide covers what to do if yours does [5].
- Platform signatures. A tool that signs as d=its-own-domain passes DKIM but doesn't align with your From:. Set up the custom-domain DKIM records the service gives you.
- Parked domains. Don't publish DKIM records for domains you never send from [8].
DMARC: monitor, then enforce
DMARC is a TXT record at _dmarc.yourdomain. Start in monitoring mode with a reporting address: v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com. Google recommends starting at none and always including rua [6], and Microsoft recommends the same gradual path from none to quarantine to reject [9]. Without a rua tag, receivers won't send you aggregate reports at all [3].
The aggregate reports are XML files listing every source that sent as your domain and whether each passed SPF, DKIM and alignment. Read them for a few weeks; a DMARC report service makes them readable. Every legitimate source that fails, such as a billing system, help desk or newsletter tool, needs fixing before you tighten the policy, or your own mail will be junked or rejected.
Older guides, including Google's and Microsoft's own setup pages, ramp enforcement with the pct tag, such as pct=10 rising to pct=100 [6,9]. The current DMARC standard, RFC 9989 (May 2026), removed pct because receivers applied values other than 0 and 100 inconsistently, and added t=y as an explicit test-mode flag [3]. A record that still contains pct isn't broken, but don't count on a percentage rollout behaving as written. Move the policy in whole steps and watch the reports after each.
_dmarc.example.com TXT
Week 0 v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com
read the reports; fix every legitimate source that fails
Week 4+ v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.com
Week 8+ v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com
Optional tags: sp= for existing subdomains, np= for subdomains that
don't exist, and t=y to ask receivers not to apply the policy yet.Checking your work
DNS lookups prove a record exists, not that mail passes. Send a test message from each service to a Gmail address and open Show original, which lists the SPF, DKIM and DMARC results for that message. In the full headers, the Authentication-Results line shows which domain passed each check, and the d= value in the DKIM-Signature shows which domain signed [2]. You want to see:
- SPF: pass, for a Return-Path domain that matches your From: domain or is a subdomain of it.
- DKIM: pass, with d= your domain rather than the platform's.
- DMARC: pass. If it says fail while SPF and DKIM both pass, neither of them aligned.
- The same for every service that sends as your domain, not only your own mailbox.
Why it is worth finishing
Bulk senders to Gmail must publish DMARC and align the From: domain [10], and Microsoft requires domains sending more than 5,000 emails a day to Outlook.com addresses to pass SPF and DKIM and publish DMARC [11]. Even below those volumes, a domain with aligned DKIM and an enforced DMARC policy is far harder to spoof, and spoofed mail in your name is reputation you didn't spend.