Deliverability

How to set up SPF, DKIM and DMARC for Google Workspace and Microsoft 365

Set up SPF, DKIM and DMARC step by step for Google Workspace and Microsoft 365: example records, common mistakes and how to check they pass.

Short answer: SPF lists the servers allowed to send email for your domain, DKIM proves an email wasn't changed on the way, and DMARC tells receiving servers what to do when those checks fail. All three are DNS records. Since 2024 Gmail and Yahoo have expected every sender to use SPF or DKIM, and bulk senders must have all three.

Key points

  • Publish exactly one SPF record and keep it under 10 DNS lookups.
  • DKIM has to be switched on at your provider as well as published in DNS.
  • Start DMARC at p=none, read the reports, then move to quarantine and reject.
  • Check the result in Gmail's “Show original”: SPF, DKIM and DMARC should all say PASS.

Why it matters#

Email without authentication looks like spoofing, so it goes to spam or is rejected outright. Since 2024, Gmail and Yahoo have required SPF or DKIM from every sender, and SPF, DKIM, DMARC and one-click unsubscribe from anyone sending several thousand emails a day.

SPF#

Add one TXT record to your domain. Having two SPF records is an error, so put every service that sends for you into the same record.

ProviderExample SPF record (TXT, @)
Google Workspacev=spf1 include:_spf.google.com ~all
Microsoft 365v=spf1 include:spf.protection.outlook.com -all
Both + another servicev=spf1 include:_spf.google.com include:service.example ~all

Check against your provider's current documentation, and stay under the limit of 10 DNS lookups.

DKIM#

  1. Google Workspace: Admin console → Apps → Google Workspace → Gmail → Authenticate email. Generate a 2048-bit key, publish the TXT record (for example google._domainkey) and click Start authentication.
  2. Microsoft 365: in the email authentication settings of the Microsoft Defender portal, turn on DKIM for your domain and publish the two CNAME records (selector1 and selector2).
  3. Wait for DNS to update (anything from minutes to 48 hours), then check that signing is switched on.

DMARC#

Add a TXT record at _dmarc. Start in monitoring mode, read the reports for a few weeks, then tighten the policy. DMARC passes when SPF or DKIM passes for a domain that matches the one in the From: address.

  • Start: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.example
  • Next: p=quarantine (failing email goes to spam)
  • Goal: p=reject, once every legitimate sender passes

How to check#

Send yourself an email, open it in Gmail and choose “Show original”. SPF, DKIM and DMARC should all say PASS. When you connect a mailbox, Repmight checks your domain's records and tells you what's missing.

Common mistakes#

  • More than one SPF record
  • Adding a new sending service and forgetting to add it to SPF
  • Publishing the DKIM record but never switching signing on
  • Going straight to p=reject without reading the reports
  • DMARC reports sent to a mailbox nobody reads

Set-up checklist#

  • One SPF record listing every sending service, under 10 DNS lookups
  • DKIM published and signing switched on, 2048-bit where possible
  • DMARC at p=none with a rua address you check
  • Test email shows PASS for SPF, DKIM and DMARC
  • A date in the diary to review reports and tighten the policy

FAQ

Do I need all three?

If you send in small numbers, SPF or DKIM is technically enough to pass Gmail's rules for all senders. Setting up all three is still the safest choice for deliverability, and bulk senders have to.

Is DMARC p=none enough?

It's a good place to start, because you can watch what happens. Once the reports show all your legitimate email passing, moving to quarantine or reject protects your domain from spoofing.

How long does SPF, DKIM and DMARC take to work?

DNS changes usually show within minutes to a few hours, but can take up to 48 hours. Send a test email afterwards to confirm.

What does “DMARC alignment” mean?

The domain in the visible From: address must match the domain that passed SPF or DKIM. Without that match, DMARC fails even if SPF or DKIM passes.

Sources

  1. Set up SPF · Google Workspace Help
  2. Set up DKIM · Google Workspace Help
  3. Set up DMARC · Google Workspace Help
  4. How to use DKIM for email in your custom domain · Microsoft Learn
  5. RFC 7208: Sender Policy Framework (SPF) · RFC Editor
  6. RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC) · RFC Editor

Is your domain ready to send email?

Check your domain's MX, SPF, DKIM and DMARC records and see what's missing and how to fix it.

Free, no sign-up needed.