How-to
SPF, DKIM and DMARC Explained Without the Jargon
Why your perfectly designed emails land in spam — and the three DNS records that fix it.
You built a beautiful email template. The signup flow works. Then a new user writes in: "I never got the verification email." It's sitting in their spam folder — or it never arrived at all.
Content and design rarely cause this. The usual culprit is that your domain hasn't proved the email really came from you. Since 2024, the largest mailbox providers have required bulk senders to authenticate their mail, and unauthenticated messages from new domains are increasingly treated with suspicion even at low volume.
Three DNS records fix most of it: SPF, DKIM and DMARC. Here's what each one does, in plain words.
The problem: email has no built-in identity
The email protocol was designed in an era of trust. Anyone can send a message claiming to be from support@yourbank.com. Without extra checks, the receiving server has no way to know whether it's genuine.
SPF, DKIM and DMARC are three layers added later to answer one question: is this sender allowed to send mail for this domain, and was the message tampered with?
SPF: the guest list
Sender Policy Framework is a list, published in your DNS, of the servers allowed to send email for your domain.
When Gmail receives a message claiming to be from your domain, it looks up your SPF record and checks whether the sending server is on the list.
A typical SPF record is a TXT record on your root domain:
v=spf1 include:_spf.example-mailhost.com ~all
v=spf1marks it as an SPF record.include:adds your email provider's servers to the guest list.~allsays "anyone else is suspicious" (a soft fail).-allis the strict version.
Two common mistakes:
Two SPF records. You may only have one. If you use several services — a mailbox provider plus a newsletter tool — merge them into one record with several
include:entries.Too many lookups. SPF allows at most ten DNS lookups. Each
includecan contain more, so a long list can quietly exceed the limit and break validation.
DKIM: the tamper-proof seal
DomainKeys Identified Mail adds a cryptographic signature to every outgoing email. Your mail provider signs messages with a private key; you publish the matching public key in DNS.
The receiving server fetches the public key and checks the signature. If it matches, two things are proven: the message was signed by someone authorised for your domain, and the content wasn't altered in transit.
You usually don't write DKIM records by hand. Your email provider generates the key and gives you a TXT or CNAME record to add, at a name like selector._domainkey.yourdomain.com. Many hosting panels have a one-click "enable DKIM" option that publishes it for you.
DMARC: the policy and the reporting
SPF and DKIM produce results, but they don't tell the receiver what to do when a check fails. DMARC (Domain-based Message Authentication, Reporting and Conformance) does.
It also adds an important rule called alignment: the domain the reader sees in the "From" line must match the domain that passed SPF or DKIM. Without alignment, a spammer could pass SPF with their own domain while displaying yours.
A starter DMARC record, as a TXT record at _dmarc.yourdomain.com:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
p=nonemeans "don't block anything yet, just report."rua=is where receivers send daily aggregate reports.
Once reports show your legitimate mail passing consistently, tighten the policy step by step: p=quarantine (send failures to spam), then p=reject (refuse them outright).
Setting it up: the order that works
Inventory your senders. List every service that sends email as your domain: your mailbox host, your app's transactional mail, newsletter tools, support desks, invoicing software.
Publish one SPF record that includes all of them.
Enable DKIM for each sending service, using the records each provider gives you.
Add DMARC at
p=nonewith a reporting address.Wait and read the reports for two to four weeks. They'll reveal senders you forgot about.
Tighten DMARC to
quarantine, thenreject, once everything legitimate passes.
DNS changes can take anywhere from minutes to a day to propagate, so don't panic if checks fail immediately.
How to test
Send a message to a deliverability tester such as mail-tester.com. It scores your setup and lists exactly what's missing.
In Gmail, open a message you sent, choose "Show original," and look for
SPF: PASS,DKIM: PASSandDMARC: PASS.Query your records from a terminal:
dig txt yourdomain.com +shortanddig txt _dmarc.yourdomain.com +short.
Symptoms that point to authentication problems
Messages arrive at some providers but land in spam at others.
Recipients see warnings such as "this message may not be from who it claims."
Deliverability testers report missing or failing records.
Messages from your app work, but emails sent from a newsletter tool on the same domain don't — usually a sign that one sender is missing from SPF or has no DKIM.
Beyond authentication
Authentication gets you through the door; reputation keeps you there. A few habits matter:
Send transactional mail (password resets, receipts) from a consistent, dedicated address.
Don't send marketing blasts from the same setup that sends security emails.
Include a plain-text version of every HTML email.
Make unsubscribing easy for anything non-essential.
Never buy email lists.
The short version
SPF says who may send. DKIM proves the message is genuine and unchanged. DMARC says what to do when either fails and makes sure the visible sender lines up with the checks.
Set up all three, start DMARC in monitoring mode, read the reports, then tighten. It's an afternoon of DNS work that saves you months of "check your spam folder" support replies.
Related reading: Laravel queues and cron on shared hosting · DPDP consent managers: startup checklist
Frequently asked questions
What is the difference between SPF, DKIM and DMARC?
SPF lists which servers may send email for your domain. DKIM adds a cryptographic signature proving the message wasn't altered. DMARC sets the policy for failures and requires the visible From domain to align with SPF or DKIM.
Why are my emails going to spam?
Missing or failing authentication is the most common technical reason, especially for new domains. Check your SPF, DKIM and DMARC records with a deliverability tester.
Can I have two SPF records?
No. A domain must have only one SPF record. Merge multiple senders into a single record with several include entries.
Which DMARC policy should I start with?
Start with p=none to collect reports without blocking mail. Move to p=quarantine and then p=reject once all legitimate senders pass.
Related
Software
Windows 10 ESU Now Runs to October 2027: How to Check Your PC Is Enrolled
Windows 10 Extended Security Updates for home users now last until 12 October 2027. But only enrolled PCs get them. Here's how to check, how to enroll...
How-to
How to Check Your PF Balance on WhatsApp: EPFO's New Service, Step by Step
EPFO's WhatsApp service lets you check your PF balance, see your last five transactions and download your passbook from your UAN-linked number. Here's...
How-to
Running a Local LLM on a 12GB GPU: A Practical Starter Guide
A 12GB graphics card can run genuinely useful language models locally — if you understand quantization, context length and the VRAM budget. Here's how...
The stream
All storiesUpcoming Phones in India: December 2026 Launches to Wait For
Xiaomi 18 Pro, iQOO 16 and OnePlus 16R are the big flagships expected in India around December 2026, with Vivo X500 and Motorola Signature 27 already out. Here's what's confirmed so far.
Windows 10 ESU Now Runs to October 2027: How to Check Your PC Is Enrolled
Windows 10 Extended Security Updates for home users now last until 12 October 2027. But only enrolled PCs get them. Here's how to check, how to enroll for free, and when to plan your move.
GTA 6 PC Release Date: Everything Rockstar and Take-Two Have Actually Said
There is no official GTA 6 PC release date. Take-Two says any PC news will come from Rockstar. Based on GTA 5 and Red Dead Redemption 2, the realistic window is late 2027 to 2028.
ChatGPT Advanced Voice Is Being Retired on 11 December: What GPT-Live Changes
On 11 December 2026, ChatGPT retires Advanced and Standard voice and moves everyone to GPT-Live. Here's what GPT-Live does differently, what happens to custom GPTs and video, and your old chats.
ChatGPT Go Free Year Ending in India: Will You Be Charged ₹399, and How to Cancel
If you claimed free ChatGPT Go in India last year, your 12 months are ending. Here's when the ₹399 charge kicks in, how to cancel on web, Android and iPhone, and whether staying on Go is worth it.