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.
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).
Google Workspace DNS records
- 1SPF (TXT)
- Host
- @
- Value
v=spf1 include:_spf.google.com ~all
Proves Google's servers are allowed to send mail for your domain.
- 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.
- 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.
Microsoft Azure DNS records
- 1SPF (TXT)
- Host
- @
- Value
v=spf1 include:spf.protection.outlook.com ~all
Proves Microsoft's outbound servers can send mail for your domain.
- 2DKIM (2 CNAMEs)
- Host
- selector1._domainkey / selector2._domainkey
- Value
selector1-<domain-guid>._domainkey.<tenant>.onmicrosoft.com
Enables rotating cryptographic signing inside Microsoft Defender.
- 3DMARC (TXT)
- Host
- _dmarc
- Value
v=DMARC1; p=none; adkim=r; aspf=r;
Tells Gmail and Outlook how to align SPF and DKIM checks.
Quick DNS cheat sheet
| Record | DNS type | Host / Name | What it does |
|---|---|---|---|
| SPF | TXT | @ (root domain) | Lists which mail servers can send from your domain |
| DKIM | TXT (Google) or CNAME (Microsoft Azure) | google._domainkey or selector1/selector2._domainkey | Signs every email so servers know it came from your domain untouched |
| DMARC | TXT | _dmarc | Matches 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
- In Google Admin Console, open Apps > Google Workspace > Gmail > Authenticate email.
- Pick your domain and click Generate new record (2048-bit if your DNS host takes it, otherwise 1024-bit).
- Add the TXT record at
google._domainkeyin your DNS panel. - 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
- In Microsoft Defender, open Policies & rules > Threat policies > Email authentication settings > DKIM.
- Pick your domain and copy both CNAMEs (
selector1._domainkeyandselector2._domainkey). - Add both in your DNS panel. On Cloudflare, turn Proxy OFF (DNS only) so the orange cloud won’t break the lookup.
- 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. Leaverua=off secondary domains or route it to an admin email. - Once SPF and DKIM pass for a week or two, you can switch
p=nonetop=quarantine.
Step 4: test all three before warmup
Don’t start warmup until every record passes:
- Test SPF, DKIM, DMARC and MX in one shot on our free DNS checker.
- Run our free domain health check and blacklist checker to confirm the domain is clean.
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%.
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.