Email Deliverability Basics: SPF, DKIM and DMARC Explained
SPF, DKIM and DMARC prove your email really comes from your domain. Here is what each record does, example DNS entries, and the mistakes that break delivery.

SPF, DKIM and DMARC are three DNS-based standards that let receiving mail servers verify that email using your domain really came from you. SPF lists which servers may send for your domain, DKIM adds a cryptographic signature to each message, and DMARC tells receivers what to do when those checks fail and sends you reports. Together they improve deliverability and make it much harder for others to spoof your domain.
Key takeaways
- SPF and DKIM authenticate mail; DMARC ties them to the visible From address and sets a policy.
- Publish exactly one SPF record and stay under its 10 DNS lookup limit.
- Every service that sends as your domain (your mailbox provider, newsletter tool, CRM, shop platform) needs to be covered.
- Start DMARC at
p=none, read the reports, then tighten toquarantineandreject.
Why this matters now
Email was designed without built-in sender verification, so anyone can put any address in the From line. Receiving providers increasingly rely on authentication to decide what reaches the inbox. Since February 2024, Gmail and Yahoo have required bulk senders (Google defines this as sending close to 5,000 or more messages a day to Gmail addresses) to authenticate with SPF and DKIM, publish a DMARC record, align the From domain, and offer easy unsubscribe. Smaller senders are required to have at least SPF or DKIM. Even if you send little mail, having all three in place avoids surprises.
SPF: who is allowed to send
Sender Policy Framework (SPF) is a TXT record on your domain listing the servers authorized to send its mail. A receiver checks the IP address that delivered the message against that list.
example.com. TXT "v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.25 -all"
v=spf1marks the record as SPF.include:pulls in a provider's own list of servers. Use the exact value your provider documents.ip4:/ip6:authorize specific addresses, such as your own server.-all(fail) or~all(softfail) says what to do with everything else. Many domains start with~alland move to-allonce confident; with DMARC enforcing, the practical difference is smaller.
Common SPF mistakes
- Two SPF records. Adding a second
v=spf1record for a new tool breaks SPF entirely. Merge them into one. - Too many lookups. SPF allows at most 10 DNS lookups (each
include,a,mx,redirectand nested include counts). Exceeding it produces a permanent error. Remove services you no longer use. - Using
+all. This authorizes the entire internet to send as you. - Forgetting what SPF checks. SPF validates the envelope sender (Return-Path), not the From address your readers see. That is why DMARC alignment matters.
DKIM: a signature on every message
DomainKeys Identified Mail (DKIM) has the sending server sign each message with a private key. The matching public key is published in DNS under a selector, and the receiver uses it to confirm the message was signed by your domain and the signed parts were not altered in transit.
s1._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
In the message headers, the signature references that selector:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=s1; ...
- Each sending service usually needs its own DKIM key and selector. Your mailbox provider, newsletter platform and helpdesk will each give you a record, often as a CNAME pointing to their key.
- Use 2048-bit keys where your provider and DNS host support them; 1024-bit keys are considered weak.
- Turn signing on. Publishing the DNS record is half the job; many platforms also require you to click "authenticate" or "verify" afterward.
- Watch long records. Some DNS panels need a 2048-bit key split into multiple quoted strings within one TXT record.
DMARC: policy, alignment and reports
Domain-based Message Authentication, Reporting and Conformance (DMARC) builds on SPF and DKIM. A message passes DMARC if SPF or DKIM passes and the domain that passed matches (aligns with) the domain in the visible From header. Your DMARC record tells receivers what to do with failures and where to send reports.
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r"
| Tag | Meaning |
|---|---|
p | Policy: none (monitor only), quarantine (treat as suspicious, often spam folder), reject (refuse). |
rua | Address for aggregate reports, usually daily XML summaries from receivers. |
adkim / aspf | Alignment mode: r (relaxed, subdomains match) or s (strict, exact match). |
pct | Percentage of failing mail the policy applies to, useful for gradual rollout. |
sp | Policy for subdomains, if different from the main domain. |
Rolling out DMARC safely
- Inventory your senders. List everything that sends as your domain: staff mailboxes, website contact forms, invoicing, newsletters, support desk, e-commerce receipts.
- Set up SPF and DKIM for each, ideally with a custom return-path domain so SPF aligns too.
- Publish
p=nonewithrua. Aggregate reports arrive as XML; a DMARC report viewer makes them readable. - Fix failing legitimate sources shown in the reports over a few weeks.
- Move to
p=quarantine, optionally withpct=25and increasing. - Move to
p=rejectonce reports show only spoofed or unknown mail failing.
Reading an aggregate report
Each aggregate report lists, per sending IP address, how many messages the receiver saw claiming to be from your domain, and whether SPF and DKIM passed and aligned. When reviewing them, sort sources into three groups:
- Known and passing: your mailbox provider and properly configured tools. Nothing to do.
- Known but failing: a legitimate service you forgot to configure, such as an invoicing app or a website contact form sending through the web server. Add DKIM or fix SPF for it before tightening the policy.
- Unknown: IPs you do not recognize. Look them up; if they are not a service you use, they are likely spoofing attempts that a
rejectpolicy will stop.
Protect domains that do not send mail
Parked domains and domains used only for websites can still be spoofed. Lock them down with a null SPF record and a reject policy:
example.org. TXT "v=spf1 -all"
_dmarc.example.org. TXT "v=DMARC1; p=reject"
Check your records and reputation
Use a Find DNS Records lookup to confirm your TXT records are published exactly as intended: one SPF record, a DMARC record at _dmarc, and DKIM keys at the right selectors. Typos, stray quotes and records added to the wrong host are common.
Authentication proves identity, but reputation still matters. If your sending IP or domain appears on a blocklist, mail can be rejected even with perfect records. A Blacklist Lookup checks your server's IP against common DNS-based blocklists; if it is listed, find the cause (a compromised account, a form abused by bots) before requesting removal.
Finally, think about the addresses you publish. Plain-text email addresses on web pages are harvested by spam bots, which leads to more junk and more spoofing attempts. An Email Privacy check shows whether a page exposes addresses, so you can switch to a contact form or obfuscate them.
Other habits that help deliverability
- Send only to people who opted in, and remove addresses that hard-bounce.
- Include a working one-click unsubscribe on marketing email; Gmail and Yahoo require it for bulk senders.
- Keep spam complaint rates low. Google advises staying below 0.1% and says rates should never reach 0.3%.
- Use a consistent From address and domain.
- Set up a valid reverse DNS (PTR) record if you run your own mail server.
For the technical details of SPF, the specification is RFC 7208.
Quick checklist
- One SPF record, all senders included, under 10 lookups, ending in
~allor-all. - DKIM enabled with 2048-bit keys for every sending service.
- DMARC published at
_dmarcwith a reporting address. - Reports reviewed and policy moved toward
reject. - Sending IP not on blocklists; email addresses not exposed on your site.