SPF, DKIM, and DMARC: Step-by-Step DNS Configuration

Complete DNS tutorial with copy-paste templates for Google Workspace, Microsoft 365, and custom SMTP. Learn how to configure, test, and monitor your email authentication records.

Start Free Trial | Pricing | Features

๐Ÿš€ Call Tracking now live ยท Social Publishing coming soon โ€” Get Started Free โ†’
๐Ÿ‡ฌ๐Ÿ‡ง UK-Hosted Infrastructure AES-256 Encrypted GDPR & CASL Compliant Zero-Retention AI โ€” Your Data Is Never Stored
Back to Blog
2026-05-129 min readInfrastructure

SPF, DKIM, and DMARC: Step-by-Step DNS Configuration

Complete DNS tutorial with copy-paste templates for Google Workspace, Microsoft 365, and custom SMTP. Learn how to configure, test, and monitor your email authentication records.

By OutreachDesk Team

SPF, DKIM, and DMARC: Step-by-Step DNS Configuration

Proper DNS configuration is the foundation of reliable email delivery. This guide walks through each record type with exact values you can copy and paste โ€” whether you're on Google Workspace, Microsoft 365, or a custom SMTP provider.

Quick Context

RecordWhat It ProvesDNS Type
SPF"This server is allowed to send my email"TXT on @ (root)
DKIM"This email wasn't modified in transit"TXT or CNAME on subdomain
DMARC"Here's what to do if SPF or DKIM fail"TXT on _dmarc subdomain

Step 1: SPF Record

Google Workspace

DNS Host: @ (or yourdomain.com)

Record Type: TXT

Value:

v=spf1 include:_spf.google.com ~all

Microsoft 365

DNS Host: @

Record Type: TXT

Value:

v=spf1 include:spf.protection.outlook.com ~all

SPF Mechanism Reference

MechanismMeaningWhen to Use
-allHard fail โ€” reject everything not listedWhen you're 100% sure your list is complete
~allSoft fail โ€” accept but mark suspiciousSafer default. Start here.
?allNeutral โ€” make no judgmentNot recommended. Essentially disables SPF.

Step 2: DKIM Record

DKIM adds a cryptographic signature to every outgoing email. The recipient server verifies this signature against a public key in your DNS.

Key Length Requirements (2026)

Key LengthStatusGoogle/Yahoo
2048-bitโœ… RequiredMinimum accepted
1024-bitโŒ DeprecatedAuthentication failures
512-bitโŒ Never useTrivially crackable

Each provider generates DKIM keys differently. Google gives you a TXT record. Microsoft creates CNAME records. Custom SMTPs typically give 2โ€“3 CNAMEs pointing to their DKIM infrastructure.

Step 3: DMARC Record

DMARC ties SPF and DKIM together and defines your enforcement policy:

DNS Host: _dmarc

Record Type: TXT

Starting Value:

v=DMARC1; p=none; rua=mailto:[email protected]; fo=1

DMARC Tag Reference

TagPurposeExample
p=Policy: none / quarantine / rejectp=quarantine
pct=% of failing mail to apply policy topct=25
rua=Aggregate report destinationrua=mailto:dmarc@...
fo=1Generate forensic report on any failurefo=1

Step 4: Test Everything

  1. Send a test to [email protected] โ€” You'll receive an automated reply with full SPF/DKIM/DMARC analysis
  2. Check OutreachDesk's DNS Health Dashboard โ€” Color-coded green/amber/red for all four record types
  3. Review DMARC aggregate reports โ€” Weekly at minimum. They're your early warning system for configuration drift and spoofing attempts
โฑ๏ธ Propagation Note: DNS changes typically propagate in 5โ€“10 minutes for most providers, but can take up to 48 hours in rare cases. Test after 15 minutes โ€” if records aren't visible yet, wait and retest.

Ready to apply these tips?

OutreachDesk gives you all the tools you need for email outreach โ€” privacy-first on your cloud.

Get Started Free