Sign up for a free deliverability tracker

How to set up DKIM, SPF and DMARC for cold email

Copy-paste SPF, DKIM and DMARC records for Google Workspace and Microsoft Azure domains, plus how to test them and avoid common DNS mistakes.

How-ToConrad NiedzielskiBy Conrad NiedzielskiUpdated 4 min read
On this page

Before warming a cold email domain, add three DNS records: SPF (who can send for you), DKIM (a signature proving the email came from your domain) and DMARC (the rule tying both to your From address).

Gmail and Outlook expect all three. Switch between Google Workspace and Microsoft Azure below and copy the records into your DNS host (Cloudflare, Namecheap, Porkbun or GoDaddy).

Copy-paste DNS records by provider

Google Workspace DNS records

  1. 1SPF (TXT)
    Host
    @
    Value
    v=spf1 include:_spf.google.com ~all

    Proves Google's servers are allowed to send mail for your domain.

  2. 2DKIM (TXT)
    Host
    google._domainkey
    Value
    v=DKIM1; k=rsa; p=<key from Google Admin>

    Signs every message so receiving servers know it was not altered.

  3. 3DMARC (TXT)
    Host
    _dmarc
    Value
    v=DMARC1; p=none; adkim=r; aspf=r;

    Ties SPF and DKIM to your From domain without flooding your inbox.

Quick DNS cheat sheet

RecordDNS typeHost / NameWhat it does
SPFTXT@ (root domain)Lists which mail servers can send from your domain
DKIMTXT (Google) or CNAME (Microsoft Azure)google._domainkey or selector1/selector2._domainkeySigns every email so servers know it came from your domain untouched
DMARCTXT_dmarcMatches your From address to SPF and DKIM and tells servers how to handle failures

Step 1: set up your SPF record

Only add one SPF record per domain. Two v=spf1 TXT records trigger a hard SPF error (PermError) at Gmail and Outlook.

Add one TXT record on your root domain (@):

  • Google Workspace:
v=spf1 include:_spf.google.com ~all
  • Microsoft Azure:
v=spf1 include:spf.protection.outlook.com ~all

Use ~all (softfail), never +all (lets anyone spoof you). Skip SendGrid or Mailgun on cold domains: they ban cold email and eat your 10-lookup SPF limit.

Step 2: turn on DKIM signing

DKIM signs every outgoing email so receiving servers can check it against your DNS key.

For Google Workspace

  1. In Google Admin Console, open Apps > Google Workspace > Gmail > Authenticate email.
  2. Pick your domain and click Generate new record (2048-bit if your DNS host takes it, otherwise 1024-bit).
  3. Add the TXT record at google._domainkey in your DNS panel.
  4. Wait 5 to 15 minutes, then click Start authentication in Google Admin.

Note: Google DKIM keys don’t expire, so once it’s active you’re done.

For Microsoft Azure

  1. In Microsoft Defender, open Policies & rules > Threat policies > Email authentication settings > DKIM.
  2. Pick your domain and copy both CNAMEs (selector1._domainkey and selector2._domainkey).
  3. Add both in your DNS panel. On Cloudflare, turn Proxy OFF (DNS only) so the orange cloud won’t break the lookup.
  4. Once both resolve, switch Sign messages for this domain with DKIM signatures to On.

Step 3: add your DMARC record

DMARC ties SPF and DKIM to your From address. Without it, Gmail and Yahoo treat your domain as unverified.

Add a TXT record at _dmarc:

v=DMARC1; p=none; adkim=r; aspf=r;

Three mistakes to skip:

  • Skip ruf=: Gmail and Microsoft mostly ignore forensic reports anyway.
  • Keep rua= out of live cold inboxes: Daily XML reports flood your inbox and bury replies. Leave rua= off secondary domains or route it to an admin email.
  • Once SPF and DKIM pass for a week or two, you can switch p=none to p=quarantine.

Step 4: test all three before warmup

Don’t start warmup until every record passes:

Passing DNS only gets you to the starting line

Passing SPF, DKIM and DMARC stops day-one failures, not spam placement next month. Across 26.6 million cold emails in our State of Cold Email Deliverability study, 28% of active domains stopped getting replies in a week with bounce rates still under 1%.

Silent burn: replies drop 71% while bounces stay under 1%28% of active domains went silent

100 active domains in a single week

28 went the whole week with zero replies despite normal bounce rates.

  • 28 silent
  • 72 replying

30-day reply rate

71% fewer replies
  • Replying domains2.19%
  • Silent domains (0 replies in 30+ leads)0.63%

30-day bounce rate

Both look healthy
  • Replying domains0.93%
  • Silent domains0.72%

After DNS passes, inbox placement comes down to low daily limits, no open or click tracking, and checking each domain’s reply rate against healthy domains.

Don’t want to set up DNS on dozens of domains? Peeker sets up SPF, DKIM, DMARC, forwarding and sequencer uploads on every Google Workspace and Microsoft Azure order in under 24 hours, with free daily reply tracking. You can also connect existing domains free.

DNS setup checklist

  • One SPF TXT record on @ (never two v=spf1 records).
  • DKIM TXT (Google) or both selector CNAMEs (Microsoft Azure, Cloudflare proxy OFF) live and turned on.
  • DMARC TXT record live at _dmarc without flooding a cold inbox with XML reports.
  • All three green on /tools/dns-checker before starting 14-day warmup.

Common questions

Do I need SPF, DKIM and DMARC on every secondary cold email domain?

Yes. DNS lives on each domain, not your account. Every secondary domain (like trypeeker.com or peekerhq.co) needs passing SPF, DKIM and DMARC before warmup.

Why does my SPF record fail even though I added Google or Microsoft?

Usually you have two v=spf1 TXT records on @ (which breaks SPF) or passed the 10-DNS-lookup limit with too many tools. Merge it into one TXT record with only your sending provider.

Should DMARC be p=none, p=quarantine or p=reject for cold email?

Start with p=none so you don’t block your own mail while testing. Once SPF and DKIM pass on our free DNS checker, p=none or p=quarantine both meet Gmail, Yahoo and Outlook rules.

Does Peeker set up SPF, DKIM and DMARC automatically?

Yes. Every Google Workspace ($3.50 down to $2.80/inbox) and Microsoft Azure ($60 or $30/domain for 50 inboxes) domain from Peeker ships with SPF, DKIM, DMARC and forwarding done in under 24 hours.

Conrad Niedzielski

Conrad Niedzielski · Co-founder, Peeker

Published · updated

All articles

Free tracking · or buy inboxes

Stop guessing which domains are burned

Connect your sequencer and see every domain's status, free on any inbox. Or order Google and Microsoft inboxes.

  • Free tracking on any inbox

    Even ones you didn't buy from us.

  • Burned domains swapped

    From your spare domains, or new ones.

  • Inboxes in under 24 hours

    Most orders. Big ones can take a few days.

  • Works with your sequencer

    Instantly, Smartlead, EmailBison, PlusVibe.