Guides › Authentication

How to set up SPF, DKIM and DMARC

SPF, DKIM and DMARC are three DNS records that prove an email really came from your domain. Gmail, Yahoo and Outlook now require all three from anyone sending in bulk, and mail without them is far more likely to land in spam or be refused. This guide sets them up in the right order, with the exact records and how to check each one.

9 min read · updated November 8, 2026

What each record does

RecordWhat it provesWhere it lives
SPFWhich servers may send email for your domainA TXT record on the domain itself
DKIMThat the message was not changed and was signed by your domainA TXT (or CNAME) record at selector._domainkey.yourdomain.com
DMARCWhat inboxes should do when SPF or DKIM fails, and where to send reportsA TXT record at _dmarc.yourdomain.com

Think of SPF as the guest list, DKIM as a tamper-proof seal on each letter, and DMARC as the instruction to the doorman: what to do with a letter that is not on the list or has a broken seal.

Before you start

  • Log in to the place that manages your domain's DNS. That is usually where you bought the domain (GoDaddy, Namecheap) or a DNS service such as Cloudflare.
  • List every service that sends email as your domain: your email platform, your inbox provider (Google Workspace, Microsoft 365, Zoho), your helpdesk, your shop, your invoicing tool. Each needs to be covered.
  • Use a subdomain such as news.yourdomain.com for marketing email if you can. Your everyday mail then keeps its own reputation.

Step 1: Add one SPF record

SPF is a single TXT record on your domain that lists the services allowed to send for it. A typical record looks like this:

Type:  TXT
Host:  @
Value: v=spf1 include:_spf.google.com include:amazonses.com ~all
  • Only one SPF record per domain. Two records starting with v=spf1 make both invalid. If you already have one, add the new include: to it instead of creating a second.
  • Stay under 10 lookups. Every include:, a, mx and redirect costs a DNS lookup, and SPF fails above 10. Remove services you no longer use.
  • End with `~all` or `-all`. ~all (soft fail) is the usual choice; -all is stricter. Never use +all, which lets anyone send as you.

Check it with the free SPF checker. It counts your lookups and spots a second record.

Step 2: Turn on DKIM signing

DKIM needs two halves: your email service signs every message with a private key, and you publish the matching public key in DNS. Your provider gives you the record to add. It is either a TXT record holding the key itself, or one or more CNAME records that point to keys the provider looks after (and rotates for you).

Type:  CNAME
Host:  abc123._domainkey
Value: abc123.dkim.provider.com

# or, as a TXT record holding the key:
Type:  TXT
Host:  s1._domainkey
Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqh...
  • The part before ._domainkey is the selector. Each service has its own, so several services can sign for one domain.
  • Use a 2048-bit key where you have the choice. 1024-bit keys still work but are the minimum.
  • Turn on DKIM in every service that sends as your domain, including Google Workspace or Microsoft 365.

The DKIM checker finds your key by selector and tells you its length.

Step 3: Publish DMARC, starting with p=none

Once SPF and DKIM pass, add DMARC. Start in monitoring mode, so nothing is blocked while you read the reports:

Type:  TXT
Host:  _dmarc
Value: v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r
TagMeaning
p=The policy: none (just report), quarantine (send to spam) or reject (refuse)
rua=Where daily summary reports go. Use a mailbox you read, or a free DMARC report service
adkim= / aspf=Alignment: r (relaxed, the default) lets news.yourdomain.com match yourdomain.com; s (strict) needs an exact match
pct=The share of failing mail the policy applies to, useful when moving up slowly
sp=A separate policy for subdomains

Alignment is the part people miss. DMARC passes only when SPF or DKIM passes and the domain it checked matches the domain in the visible From address. A message from [email protected] signed by provider.com passes DKIM but fails DMARC. Signing with your own domain (Step 2) is what makes it align.

The DMARC checker reads your policy and checks it against the Gmail and Yahoo rules.

Step 4: Move from p=none to p=reject

Monitoring mode protects nobody: a spoofed email still gets through. Once two to four weeks of reports show your real services passing, tighten the policy in steps:

  1. p=none while you find every legitimate sender in the reports.
  2. p=quarantine; pct=25, then 50, then 100, watching for real mail failing.
  3. p=reject once quarantine at 100% has run cleanly for a few weeks.

At p=reject, nobody can send email that looks like it comes from your domain. That protects your customers from phishing and your domain's reputation from abuse.

Common mistakes

  • Two SPF records, or more than 10 lookups.
  • DKIM switched on for the email platform but not for Google Workspace or Microsoft 365, so everyday mail fails DMARC.
  • Jumping straight to p=reject before checking the reports, and blocking your own invoices.
  • Adding the record with the full domain in the Host field when the DNS provider adds it for you, creating _dmarc.yourdomain.com.yourdomain.com.
  • Forgetting a tool that sends as you: a helpdesk, a CRM, a form builder.

How Sendflume sets this up

When you add a domain in Sendflume, the Domains page lists the exact records for your domain and checks them for you. If your DNS is at Cloudflare, GoDaddy or Namecheap, it can add them in one click. Campaigns stay blocked until the domain has DMARC, so nothing goes out in a way Gmail and Yahoo would refuse.

Questions

Do I need SPF, DKIM and DMARC?

Yes, if you send more than a handful of emails. Since 2024 Gmail has required SPF, DKIM and DMARC from anyone sending around 5,000 or more emails a day to its users, and Yahoo from anyone sending a significant volume. Outlook.com followed in 2025 at 5,000 a day. Smaller senders need at least SPF or DKIM, and all three still improve delivery.

How long do DNS changes take?

Usually minutes, and up to 48 hours in rare cases. If a checker cannot see a new record after an hour, check that the host name is right and that there is no second record.

Can I have two SPF records?

No. A domain with two SPF records fails SPF. Merge them into one record with every include: in it.

What DMARC policy should I use?

Start with p=none and a rua address for reports. Move to quarantine and then reject once the reports show every service you use is passing.

Does DMARC stop my email going to spam?

It helps, because Gmail and Yahoo expect it, but it is not enough on its own. What you send, and to whom, matters as much. See why emails go to spam.

Read next

Email that lands in the inbox.

Send campaigns and app email from your own domain, with SPF, DKIM and DMARC set up for you. Free to start.

No credit card needed.