Back to Resources
Technical

DKIM, SPF & DMARC for Beginners: What They Are and How to Set Them Up

Confused about email authentication? Here's a no-fluff guide to setting up DKIM, SPF, and DMARC so your emails don't end up in spam.

Javier Gil

πŸ‘‹ Why Should You Care?

If you're sending cold outreach, product updates, or newsletter blasts, email deliverability is your oxygen. Without proper authentication, even legit emails get flagged as spamβ€”or worse, spoofed.

Enter the holy trinity:

  • β€’ SPF – Tells inboxes who's allowed to send on your behalf
  • β€’ DKIM – Proves the message wasn't altered in transit
  • β€’ DMARC – Tells inboxes what to do when SPF or DKIM fail

πŸ” Quick Definitions

TermStands forWhat It Does
SPFSender Policy FrameworkVerifies sending server IPs
DKIMDomainKeys Identified MailCryptographically signs your email headers
DMARCDomain-based Message Auth Reporting & ConformanceTells ISPs how to handle failed auth checks

πŸ”§ Step-by-Step: How to Set Them Up

βœ… 1. Set Up SPF (2 min)

β€’ Go to your domain DNS settings (e.g. GoDaddy, Cloudflare)

β€’ Add a TXT record like this:

Type: TXT
Name: @
Value: v=spf1 include:yourESP.com ~all

Replace yourESP.com with the service you're sending from (e.g. sendgrid.net, mailgun.org)

βœ… 2. Set Up DKIM (5–10 min)

β€’ Most ESPs give you CNAME or TXT records for DKIM.

β€’ Example from Mailgun:

Type: TXT
Name: mailo._domainkey
Value: v=DKIM1; k=rsa; p=MIGf... (your public key)

β€’ Add this to your domain DNS. Wait for propagation (~15 mins).

β€’ Then verify in your ESP's dashboard.

βœ… 3. Set Up DMARC (2 min)

β€’ Add a TXT record to instruct inboxes what to do:

Type: TXT
Name: _dmarc
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

β€’ You can change p=none to quarantine or reject once you trust your config.

β€’ rua = where reports will be sent. Optional but very useful.

πŸ›  Free Tools to Help

β€’ MxToolbox – check if SPF/DKIM/DMARC is set up correctly

β€’ DMARCian – visualize DMARC reports

β€’ EasyDMARC – step-by-step DMARC enforcement

πŸ” How They Work Together (Simplified Flow)

  1. 1. You send an email from your domain.
  2. 2. The receiving server:
    • - Checks SPF: is the sending IP allowed?
    • - Checks DKIM: is the signature valid?
    • - Applies DMARC: what should it do if one fails?
  3. 3. Result: βœ… Inbox πŸ“¬ or ❌ Spam / Reject

😱 Common Mistakes to Avoid

β€’ Multiple SPF records – combine them into one

β€’ Missing DKIM on reply-to domain – not just sender domain

β€’ No DMARC record – you're blind to spoofing risks

β€’ Aggressive DMARC policy too early – start with p=none to monitor first

πŸ§ͺ Bonus: Test Your Setup

Send a test email to:

β€’ https://www.mail-tester.com

β€’ Gmail (check headers: "SPF=pass DKIM=pass DMARC=pass")

🧭 What to Do Next

Once you're authenticated:

β€’ Use Lero to validate your email list (clean = higher inboxing)

β€’ Warm up your domain if it's new (e.g. Instantly, Mailreach)

β€’ Track bounce rates, especially after new campaigns

πŸ’‘ For a deeper understanding of email validation and deliverability best practices, explore our comprehensive guides:

πŸš€ TL;DR

StepTimeCritical?Tools
SPF2mβœ… YesDNS + MxToolbox
DKIM10mβœ… YesYour ESP + DNS
DMARC2mβœ… YesDNS + DMARCian

Once configured, these will significantly improve deliverability and protect your domain from spoofing or spam reputation damage.

❓ Frequently Asked Questions

Q1: Do I need all three (SPF, DKIM, DMARC)?

Yes, for maximum deliverability. Many inbox providers require all three for proper authentication.

Q2: How long does DNS propagation take?

Usually 15-30 minutes, but can take up to 48 hours in some cases.

Q3: What happens if I set DMARC to "reject" too early?

Legitimate emails might be rejected if SPF/DKIM aren't perfectly configured. Always start with p=none.

Q4: Can I use the same DKIM key for multiple domains?

No, each domain needs its own unique DKIM key pair for security.

Q5: Do I need different settings for different email services?

Yes, each ESP (Mailgun, SendGrid, etc.) provides their own SPF include and DKIM records.

🎯 Ready to Authenticate Your Domain?

Follow these steps to set up SPF, DKIM, and DMARCβ€”then validate your email list to maximize deliverability.

JG

Javier Gil

Founder & CEO

Serial entrepreneur with 10+ years in email technology and deliverability. Previously built and scaled email infrastructure for enterprise clients.

Expertise:

Email DeliverabilityAPI ArchitectureStartup GrowthData Privacy

Written by Javier Gil β€’ Founder & CEO at Lero

Ready to validate your emails?

Try Lero for free and validate up to 100 emails without any cost.