You have spent hours crafting the perfect email — a password reset notification, an invoice, a welcome message — and it lands in your recipient's spam folder. Or worse, it never arrives at all. The most common reason? Your domain is missing proper email authentication records.
SPF, DKIM, and DMARC are three DNS-based mechanisms that work together to prove that an email genuinely came from your domain. Without them, receiving mail servers have no reliable way to distinguish your legitimate messages from phishing attempts that spoof your address. This guide walks you through each protocol, how to configure them, and how to verify your setup with our SPF Record Test tool.
Email was designed in an era when trust was assumed. The SMTP protocol, which powers email delivery, has no built-in mechanism to verify that the "From" address is genuine. Anyone with a mail server can send an email claiming to be from ceo@yourcompany.com, and without authentication, the receiving server has no way to know it is a forgery.
This fundamental design flaw has led to decades of phishing, spam, and business email compromise (BEC) attacks. Email authentication protocols were developed to address this gap by allowing domain owners to publish machine-readable policies in their DNS records that tell receiving servers how to verify messages.
The benefits of proper email authentication include:
SPF allows you to specify which mail servers are authorized to send email on behalf of your domain. It works by publishing a TXT record in your DNS that lists the approved IP addresses and hostnames.
An SPF record is a single TXT record that starts with v=spf1 and contains a series of mechanisms:
v=spf1 ip4:203.0.113.0/24 include:_spf.google.com include:sendgrid.net -all
Let's break this down:
v=spf1 – Required version tag. Must be the first element.ip4:203.0.113.0/24 – Authorizes all IP addresses in this CIDR range.include:_spf.google.com – Authorizes all IPs listed in Google Workspace's SPF record (delegates to their record).include:sendgrid.net – Also authorizes SendGrid's mail servers.-all – The "all" mechanism defines the default policy. -all (hard fail) means reject anything not matching the previous mechanisms. ~all (soft fail) means accept but mark it. ?all (neutral) means no policy.+all – This effectively authorizes the entire internet to send email as your domain. Never do this.While SPF verifies the sending server, DKIM verifies the message itself. It uses public-key cryptography to sign outgoing emails so that the receiving server can verify the message has not been altered in transit.
DKIM-Signature header.DKIM public keys are published at a specific subdomain following the pattern selector._domainkey.yourdomain.com:
selector1._domainkey.example.com. 3600 IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEB..."
The selector allows you to have multiple DKIM keys simultaneously (for example, one for your main mail server and one for a third-party service). Each sending service will tell you what selector to use.
DMARC builds on SPF and DKIM by adding a policy layer and a reporting mechanism. It tells receiving servers what to do when SPF and DKIM checks fail, and it provides you with feedback about authentication results.
DMARC introduces the concept of alignment: the domain in the "From" header must match (align with) the domain used in SPF and/or DKIM checks. This prevents attackers from passing SPF with their own domain while spoofing yours in the visible "From" address.
A DMARC record is published as a TXT record at _dmarc.yourdomain.com:
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com; pct=100"
Key tags:
v=DMARC1 – Version tag (required).p= – Policy for the domain. Options: none (monitor only), quarantine (send to spam), reject (block entirely).rua= – The email address where aggregate reports should be sent. These XML reports contain statistics about authentication results.pct= – The percentage of messages to which the policy applies. Useful for gradual rollout.sp= – Policy for subdomains (optional; defaults to the main policy).p=none – This enables reporting without affecting mail delivery. Monitor the reports for 2–4 weeks to identify all legitimate sources of email for your domain.p=quarantine – Once you are confident all legitimate senders pass SPF and DKIM, start quarantining failures. Start with pct=10 and gradually increase.p=reject – The ultimate goal. This tells receiving servers to reject any email that fails DMARC. This is the strongest protection against phishing and spoofing.After configuring SPF, DKIM, and DMARC, you need to verify everything is working correctly:
spf=pass, dkim=pass, and dmarc=pass in the Authentication-Results header.If your emails are still going to spam even after authentication, check whether your sending IP or domain is on any blacklists, and make sure your email content itself is not triggering spam filters.
Email authentication is not optional in today's internet. SPF declares who can send, DKIM proves the message is genuine, and DMARC ties them together with a policy and reporting. Together, these three protocols dramatically improve your email deliverability and protect your domain from being used in phishing attacks. Take ten minutes today to check your records with our SPF Record Test — your deliverability will thank you.