Domain Security: SPF, DKIM & DMARC Explained

Email spoofing is one of the most common attack vectors on the internet. Anyone can send an email claiming to be from your domain β€” unless you've configured SPF, DKIM, and DMARC. These three protocols work together to authenticate email and protect your domain's reputation.

Check Your Email Security β†’

Why Email Authentication Matters

Without email authentication, attackers can send emails that appear to come from your domain. This is called email spoofing, and it's used in phishing attacks, business email compromise (BEC), and spam campaigns. The consequences include:

The good news: SPF, DKIM, and DMARC are all implemented through DNS records, so you can set them up without installing any software.

πŸ“‹ SPF (Sender Policy Framework)

SPF tells receiving mail servers which IP addresses and servers are authorized to send email on behalf of your domain. It's implemented as a TXT record on your domain.

example.com.  IN  TXT  "v=spf1 include:_spf.google.com include:sendgrid.net -all"

Breaking this down:

⚠️ SPF has a 10 DNS lookup limit. Each include: counts as a lookup, and nested includes count too. Exceeding this limit causes SPF to fail silently.

πŸ”‘ DKIM (DomainKeys Identified Mail)

DKIM adds a cryptographic signature to every outgoing email. The receiving server verifies this signature using a public key published in your DNS. This proves the email hasn't been tampered with in transit.

selector._domainkey.example.com.  IN  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBg..."

Key concepts:

DKIM is usually configured by your email provider (Google Workspace, Microsoft 365, etc.) and you just need to add the DNS record they provide.

πŸ›‘οΈ DMARC (Domain-based Message Authentication, Reporting & Conformance)

DMARC ties SPF and DKIM together and tells receiving servers what to do when authentication fails. It also provides reporting so you can monitor who's sending email as your domain.

_dmarc.example.com.  IN  TXT  "v=DMARC1; p=reject; rua=mailto:dmarc@example.com; pct=100"

DMARC policies:

The rua tag specifies where to send aggregate reports. These XML reports show you all servers sending email as your domain β€” invaluable for identifying unauthorized senders.

Implementation Roadmap

Here's the recommended order for implementing email authentication:

  1. Start with SPF β€” list all services that send email for your domain. Deploy with ~all (soft fail) first.
  2. Configure DKIM β€” enable in your email provider and add the DNS record. Most providers have one-click setup.
  3. Deploy DMARC with p=none β€” start monitoring. Set up a rua address to receive reports.
  4. Analyze DMARC reports β€” review for 2-4 weeks. Identify any legitimate senders you missed in SPF.
  5. Tighten SPF to -all β€” switch from soft fail to hard fail.
  6. Move DMARC to p=quarantine β€” start quarantining spoofed emails.
  7. Finally, p=reject β€” maximum protection. Spoofed emails are rejected outright.
βœ… Quick check: Use our free tool to instantly see if your domain has SPF and DMARC configured. Enable "Include SSL & Email Security" for the full analysis.

Common Mistakes

For a complete domain security assessment, combine email security checks with SSL certificate verification, DNS record analysis, and WHOIS data review. You can also check your IP address to understand your own network configuration.

Check Your Domain Security β†’

Related Guides

πŸ” What is WHOIS? πŸ“‘ How to Read DNS Records πŸ”’ How to Check SSL Certificates 🌐 What's My IP Address?