Home / Blog / Guide

SPF, DKIM and DMARC Explained: Set Up Email Authentication

SPF, DKIM and DMARC are three DNS records that prove your email really comes from you. Without them, cold email lands in spam or is rejected. Here is what each one does and how to set them up.

Published 4 December 2026 · 8 min read

The short version

  • SPF lists the servers allowed to send email for your domain.
  • DKIM adds a digital signature to each message, so the receiver can tell it was not changed.
  • DMARC tells receivers what to do when SPF and DKIM fail, and sends you reports.

All three are records you add in the DNS settings of your domain, usually where you bought it.

Why they matter now

Google says senders who send 5,000 or more messages a day to Gmail addresses are bulk senders, and they need SPF, DKIM and DMARC. Yahoo has the same rule, and Microsoft started enforcing similar rules for Outlook.com for senders above 5,000 a day. Even below that line, missing records make spam filters more suspicious, so set them up on every sending domain. Gmail also asks bulk marketing senders for one-click unsubscribe and wants user-reported spam rates kept below 0.1%, and never at 0.3% or above.

SPF: who may send

SPF is a TXT record on your domain. An example for a domain that sends through Google Workspace:

Type: TXT Host: @
Value: v=spf1 include:_spf.google.com ~all

Rules to remember: keep one SPF record per domain, add every service that sends for you (your mailbox provider, your campaign tool) inside that one record, and stay under 10 DNS lookups. Two SPF records break SPF.

DKIM: a signature on every email

Your mailbox provider or sending tool gives you a DKIM key. You add it as a TXT record (or sometimes a CNAME) under a name that includes a selector, such as selector._domainkey.yourdomain.com. Then you turn on signing in that tool. In Google Workspace this is in the Admin console under Gmail authentication.

DMARC: the policy and the reports

DMARC is a TXT record at _dmarc.yourdomain.com. Start in monitoring mode:

Type: TXT Host: _dmarc
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

p=none only watches, and it is the minimum that Gmail asks of bulk senders. After a few weeks of clean reports, move to p=quarantine and then p=reject, which protects your domain from being faked. DMARC also needs alignment: the domain in your From address must match the domain that passed SPF or DKIM.

Alignment: why DMARC can fail even when SPF passes

DMARC does not only ask whether SPF or DKIM passed. It asks whether the domain that passed matches the domain in your From address. That match is called alignment. If a campaign tool sends with its own domain and signs with its own key, SPF and DKIM can pass while DMARC fails. The fix is to set up the tool's custom sending domain or DKIM key for your domain, so the signing domain is yours.

Set up on Google Workspace

  • SPF: add v=spf1 include:_spf.google.com ~all as a TXT record on @.
  • DKIM: in the Admin console, open Gmail, then Authenticate email. Choose your domain, generate the record, add it as a TXT record at google._domainkey, then click Start authentication.
  • DMARC: add the _dmarc TXT record shown above, starting with p=none.

Wait a few hours, then send a test to another inbox and read the headers.

Set up on Microsoft 365

  • SPF: add v=spf1 include:spf.protection.outlook.com ~all as a TXT record on @.
  • DKIM: add the two CNAME records Microsoft gives you, named selector1._domainkey and selector2._domainkey, then turn on DKIM signing for the domain in the Microsoft Defender portal.
  • DMARC: add the _dmarc TXT record, starting with p=none.

Soft fail or hard fail in SPF

The last part of an SPF record says what to do with mail from servers you did not list. ~all (soft fail) marks it suspicious. -all (hard fail) tells receivers to reject it. Start with ~all while you check that every real sender is listed, and only move to -all when you are sure.

Why a separate outreach domain or subdomain helps

Cold email carries more risk than your day-to-day mail. If complaints rise, you want the damage to stay away from the domain your team uses for customers and invoices. Use a domain close to your brand, or a subdomain, for outreach, and give it its own SPF, DKIM and DMARC. Make sure the domain has a working website and a real signature, because recipients check.

A simple DMARC roll-out plan

  • Week 1: publish p=none with a reporting address.
  • Weeks 2 and 3: read the reports. DMARC sends daily summary files, which free reader tools can turn into tables. Find every service that sends as your domain.
  • Week 4: fix any sender that fails, by adding it to SPF or turning on its DKIM.
  • After the reports look clean: move to p=quarantine, then p=reject if your policy needs it.

Troubleshooting

  • SPF permerror: your record needs more than 10 DNS lookups. Remove services you no longer use.
  • SPF none or missing: the record is on the wrong host or has a typo. It belongs on @ as a TXT record.
  • DKIM fail: the key was copied with a missing character, or signing is not turned on in the tool.
  • DMARC fail with SPF pass: alignment problem, see above.
  • Nothing changes: DNS can take a few hours. Check again later, and test from a fresh email.

Set-up checklist for cold email

  • Use a separate domain or subdomain for cold outreach, so a problem does not hurt your main domain.
  • Add SPF, DKIM and DMARC on that domain before you send anything.
  • Send a test to your own Gmail and Outlook and look at the message headers for pass results.
  • Warm up each mailbox slowly: 14-day warm-up plan.
  • Keep lists clean and include an opt-out. Run lists through an email check.

Common mistakes

  • Two SPF records on one domain.
  • Forgetting to add the campaign tool to SPF or to turn on its DKIM.
  • Jumping straight to p=reject and blocking your own mail.
  • Sending from one domain while the tool signs with another, so DMARC alignment fails.
  • Editing DNS and not waiting: changes can take a few hours to spread.

Where this fits

Authentication gets you in the door; content and list quality keep you there. Read the cold email guide and deliverability services next. Ally Engineers email campaigns also track bounces and mailbox health per sending address.

Connect the mailbox

After authentication is set, connect the mailbox with the right server and port. See Gmail IMAP and SMTP settings.

See how Gmail views your domain

Once authentication is set, watch the result in Google Postmaster Tools.

Check your records with free tools

Test what you just read. Use the SPF checker, DKIM checker and DMARC checker, or run all of them at once with the domain health checker. The SPF and DMARC pages also have a record generator.

Related features

Keep reading

Ready to try it? Start as a sales team or start as a recruiter.

Questions about this guide

What is the difference between SPF, DKIM and DMARC?

SPF lists who may send for your domain, DKIM signs each message, and DMARC says what to do when checks fail and sends you reports.

Do I need all three for cold email?

Yes. Gmail, Yahoo and Outlook.com ask bulk senders, those above 5,000 messages a day, for all three, and missing records hurt smaller senders too.

Which DMARC policy should I start with?

Start with p=none to monitor. After clean reports, move to quarantine and then reject.

Can I have two SPF records?

No. A domain should have one SPF record that includes every sending service. Two records break SPF.

How do I check my records?

Send a test email to your own Gmail and Outlook and read the message headers for SPF, DKIM and DMARC pass results.

Send us a message

Tell us what you need. A real person from the team replies by email, usually within one working day.

Set up your workspace and send your first message today.