SPF, DKIM and DMARC are the three DNS records that determine whether your emails land in the inbox or the spam folder. Since 2024, Google requires these authentication standards from all bulk senders โ ignoring them means your emails will reliably end up in spam or be rejected outright. This guide walks you through the setup step by step.
What Is Email Authentication and Why Does It Matter?
Email authentication is a set of technical standards that allows email providers to verify whether an email actually comes from the claimed sender domain. The problem: the original email protocol (SMTP) has no built-in sender verification. Anyone can technically send an email with any sender address.
The three authentication standards solve this problem in different ways:
| Standard | Protection Mechanism | Against |
|---|---|---|
| SPF | Whitelist of authorized mail servers | Email spoofing from unauthorized servers |
| DKIM | Cryptographic signature of the message | Tampering during transmission |
| DMARC | Policy for authentication failures | Unauthorized use of your domain |
Why all three are necessary:
SPF alone can be bypassed by attackers who spoof the "From" address. DKIM alone gives no instruction on what to do with unsigned emails. Only DMARC combines both and defines a binding policy.
Since February 2024, Google requires that all senders sending more than 5,000 emails per day to Gmail must set up SPF, DKIM and DMARC. Microsoft is following suit in 2025. For cold email outreach, these standards are no longer optional โ they are mandatory.
Setting Up SPF โ Step by Step
What Is an SPF Record?
An SPF record is a TXT entry in your DNS settings that lists which servers are allowed to send emails on your behalf. Receiving mail servers check this entry when an email arrives from your domain.
The Basic Structure of an SPF Record
v=spf1 include:_spf.google.com ~all
This record says: "All servers from Google Workspace are authorized to send emails for this domain. All other servers should be marked as suspicious."
Each part has a specific meaning:
| Element | Meaning |
|---|---|
v=spf1 | SPF protocol version (always identical) |
include:domain.com | Authorizes all servers of the named provider |
ip4:1.2.3.4 | Authorizes a single IPv4 address |
ip4:1.2.3.0/24 | Authorizes an IP address range |
~all | Soft Fail: mark other servers as suspicious |
-all | Hard Fail: reject other servers |
?all | Neutral: no statement about other servers |
SPF Records for the Most Common Email Providers
| Provider | SPF Record |
|---|---|
| Google Workspace | v=spf1 include:_spf.google.com ~all |
| Microsoft 365 | v=spf1 include:spf.protection.outlook.com ~all |
| Zoho Mail | v=spf1 include:zoho.eu ~all |
| IONOS | v=spf1 include:mxes.spf.ionos.de ~all |
| Strato | v=spf1 include:spf.strato.de ~all |
| Mailchimp (Transactional) | v=spf1 include:servers.mcsv.net ~all |
Adding an SPF Record in DNS
In Cloudflare:
- Dashboard โ Your Domain โ DNS โ Records
- Add record: Type
TXT, Name@, TTLAuto - Content: paste your SPF record
- Save โ proxy status must be set to "DNS only"
In IONOS:
- Control Center โ Domains & SSL โ DNS
- Add record โ Type TXT
- Hostname:
@, Value: SPF record
In Strato:
- Customer Center โ Domain Management โ DNS Settings
- Add TXT record, leave prefix empty
Most important rule: Only one single SPF record is allowed per domain. If you use multiple email providers, combine them in one record:
v=spf1 include:_spf.google.com include:spf.protection.outlook.com ip4:123.45.67.89 ~all
Jetzt kostenlos starten โ ohne Kreditkarte
1 Mailbox ยท 1 Kampagne ยท 50 Prospects. Starte in unter 5 Minuten mit anicampaign.io.
Setting Up DKIM โ The Digital Signature
How DKIM Works
DKIM (DomainKeys Identified Mail) uses a key pair: a private key on your mail server and a public key in your DNS settings. Each outgoing email is signed with the private key. The receiving server reads the public key from DNS and verifies the signature โ proving that the email came from you and was not altered in transit.
DKIM Setup in Google Workspace
- Open Google Admin Console (admin.google.com)
- Navigate to Apps โ Google Workspace โ Gmail โ Email Authentication
- Select your domain
- Click "Generate new record" (2048-bit recommended)
- Google shows you the TXT record to enter in DNS
- Add the record to your DNS provider (Name:
google._domainkey, Type: TXT) - Wait 15-30 minutes, then click "Start DKIM Authentication"
DKIM Setup in Microsoft 365
- Exchange Admin Center โ Mail Flow โ DKIM
- Select your domain
- Enable DKIM signatures
- Microsoft shows you two CNAME records
- Add both CNAME records to your DNS
- Wait for DNS propagation, then enable in M365
What a DKIM Record Looks Like
Name: google._domainkey.yourdomain.com
Type: TXT
Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
The long string after p= is your public key โ generated by your email provider and unique to each domain.
Important: You never need to know or enter the private key. Your email provider manages it automatically.
Setting Up DMARC โ The Policy
What DMARC Does
DMARC (Domain-based Message Authentication, Reporting and Conformance) is the conductor: it connects SPF and DKIM and defines what happens to emails that fail one or both checks. It also provides you with reports so you can see who is sending emails on your behalf.
The DMARC Staged Rollout Model
Never start with a strict policy. The right approach:
| Phase | Record | Meaning | Duration |
|---|---|---|---|
| Phase 1 | p=none | Monitoring, no action | 2-4 weeks |
| Phase 2 | p=quarantine; pct=25 | 25% of suspicious emails to spam | 2 weeks |
| Phase 3 | p=quarantine; pct=100 | All suspicious emails to spam | 2-4 weeks |
| Phase 4 | p=reject | Reject suspicious emails | Permanent |
Setting Up the DMARC Record
Phase 1 (Start):
Name: _dmarc.yourdomain.com
Type: TXT
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; fo=1
Phase 4 (Full protection):
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc@yourdomain.com; fo=1; adkim=s; aspf=s
DMARC Parameters Explained
| Parameter | Value | Meaning |
|---|---|---|
p= | none/quarantine/reject | The policy |
rua= | mailto:... | Address for aggregate reports |
ruf= | mailto:... | Address for failure reports |
pct= | 0-100 | Percentage of affected emails |
fo= | 0/1/d/s | When to send failure reports |
adkim= | r/s | DKIM alignment (relaxed/strict) |
aspf= | r/s | SPF alignment (relaxed/strict) |
Tip for the rua address: Create a dedicated mailbox like dmarc-reports@yourdomain.com since you will receive many automated reports. Alternatively, DMARC analysis services like dmarcian.com or Postmark can process and visualize these reports for you.
Common Mistakes and How to Avoid Them
Mistake 1: Multiple SPF Records
Problem: You have two TXT entries with v=spf1 in your DNS.
Symptom: SPF fails with "PermError โ too many SPF records".
Solution: Combine everything into a single SPF record:
v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
Mistake 2: Setting Up DMARC Before SPF and DKIM
Problem: DMARC set to p=reject before SPF and DKIM are working.
Symptom: All legitimate emails are rejected.
Solution: Always follow this order: 1. Set up SPF, 2. Set up and verify DKIM, 3. Start DMARC with p=none.
Mistake 3: Too Many DNS Lookups in SPF Record
Problem: SPF allows a maximum of 10 DNS lookups when resolving the record.
Symptom: SPF fails with recipients who have many providers.
Solution: Minimize include: directives. Replace chains with direct IP addresses where possible. Use SPF flattening tools like dmarcian SPF Surveyor.
Mistake 4: Wrong Proxy Status in Cloudflare
Problem: TXT records are set to "Proxied" (orange cloud status).
Symptom: DNS resolution for SPF/DKIM/DMARC fails.
Solution: All DNS records for email authentication must be set to "DNS only" (grey status).
Mistake 5: Wrong DKIM Selector
Problem: The selector entered in DNS does not match the configured selector.
Symptom: DKIM signature not found.
Solution: For Google Workspace, the default selector is google. Check with: dig TXT google._domainkey.yourdomain.com
Mistake 6: Starting with p=reject Immediately
Problem: DMARC set to reject without a prior monitoring phase.
Symptom: Legitimate emails that are not yet fully authenticated are rejected โ including newsletter services, CRM systems, etc.
Solution: Always start with p=none and analyze reports for at least 2-4 weeks.
Verification with Tools
After setup, verify all three records. Wait at least 15-30 minutes after DNS changes.
MXToolbox (mxtoolbox.com)
The standard for email diagnostics. Separate checkers for each record:
- SPF: mxtoolbox.com/spf.aspx โ gives a green checkmark or exact error description
- DKIM: mxtoolbox.com/dkim.aspx โ enter domain and selector (e.g.
google) - DMARC: mxtoolbox.com/dmarc.aspx โ shows the complete record and syntax errors
- Blacklist: mxtoolbox.com/blacklists.aspx โ checks against 100+ blacklists simultaneously
Google Admin Toolbox (toolbox.googleapps.com)
Particularly helpful for Google Workspace users. The "Check MX" tool verifies all email-relevant DNS records for your domain in one step.
mail-tester.com
The most practical test: send a real email to the generated test address and receive a spam score from 0-10 with a detailed report. Shows SPF, DKIM, DMARC, blacklist status and content issues all in one view.
Target score: 9/10 or higher.
Automatic Monitoring with anicampaign.io
anicampaign.io continuously checks SPF, DKIM and DMARC for your sending domains and notifies you immediately when issues arise โ before your campaigns suffer.
Frequently Asked Questions
What is SPF and why do I need it?
SPF (Sender Policy Framework) is a DNS record that specifies which servers are allowed to send emails for your domain. Without SPF, email providers cannot verify your emails and will often route them to spam.
What is the difference between DKIM and SPF?
SPF checks whether the sending server is authorized, while DKIM cryptographically signs the email. They complement each other: SPF protects the sender, DKIM protects the message itself.
What happens if I configure DMARC incorrectly?
Incorrectly configured DMARC with a "reject" policy can cause all your emails to be rejected. Always start with p=none (monitoring mode) and only switch to "quarantine" or "reject" after 2-4 weeks.
How long does it take for DNS changes to take effect?
DNS propagation can take anywhere from 15 minutes to 48 hours, with 1-4 hours being typical. Tools like MXToolbox show you the current status.
Do I need SPF, DKIM and DMARC for cold email?
Yes, all three are essential for professional cold email outreach. Without proper authentication, your emails are very likely to end up in spam.