SPF, DKIM and DMARC Test: How to Check by Hand
Run an SPF, DKIM and DMARC test by hand: dig or nslookup for each record, Gmail's Show original for a real message, and what pass, fail and permerror mean.

On this page
An SPF, DKIM and DMARC test has two parts. First you look up the three DNS records with dig or nslookup: one SPF record on the domain, a DKIM key at <selector>._domainkey.<domain> and a DMARC record at _dmarc.<domain>. Then you send a real email to a Gmail address you own, open Show original and check that the Authentication-Results header says spf=pass, dkim=pass and dmarc=pass. The DNS part shows what you published; the header shows what a receiving server decided.
If you only need the DNS part, the free SPF, DKIM and DMARC checker reads all three records and MX for any domain in your browser, with no sign-up. This guide is the manual method: the commands, the header and how to read each result.
What you test | Where | Command or place | A pass looks like |
|---|---|---|---|
SPF | TXT on the domain |
| One |
DKIM |
|
|
|
DMARC |
|
| One |
A real message | Gmail, Show original | Authentication-Results header |
|
What Each Record Proves
SPF (Sender Policy Framework) lists the servers allowed to send mail for the domain in the envelope sender, also called the Return-Path. DKIM (DomainKeys Identified Mail) signs each message with a private key; the receiver checks the signature with the public key you publish in DNS. DMARC checks that SPF or DKIM passed for a domain that matches the visible From address, and tells receivers what to do with mail where neither does. Tags and limits: SPF, DKIM, DMARC.
Test them after every change: records break quietly when a new tool sends without an SPF entry or a provider rotates a DKIM key.
Mailbox providers also require them. Google asks everyone who sends to Gmail for SPF or DKIM, and senders of 5,000 or more messages a day to personal Gmail accounts for SPF, DKIM and DMARC (at least p=none) with alignment (Google sender guidelines). Microsoft applies the same three requirements to domains that send 5,000 or more messages to Outlook.com, Hotmail and Live.com addresses, and rejects non-compliant mail with 550 5.7.515 (Microsoft support).
Check SPF, DKIM and DMARC by Hand
Use dig on macOS and Linux, nslookup -q=TXT <name> on Windows, or Google Admin Toolbox Dig in a browser. The examples use acme.io; replace it with the domain in your From address.
Look up SPF. Query the domain's TXT records and find the one that starts with
v=spf1.Find the DKIM selector. Open an email you sent and read the
s=value in its DKIM-Signature header.Look up DKIM. Query the TXT record at
<selector>._domainkey.<domain>.Look up DMARC. Query the TXT record at
_dmarc.<domain>.Read a real message. Send an email from the domain to a mailbox you own and check its Authentication-Results header.
d=acme.io
dig +short TXT $d
dig +short TXT s1._domainkey.$d
dig +short TXT _dmarc.$d
On Outreach2day domains, SPF, DKIM, DMARC and a redirect to your website are set up automatically; these steps confirm them.
SPF Record Test
A domain can have many TXT records, and exactly one may start with v=spf1. A typical answer is "v=spf1 include:_spf.mailprovider.example ip4:192.0.2.10 ~all".
Check three things. The record ends in ~all or -all. It lists every service that sends as the domain. It stays within 10 DNS lookups: each include costs one lookup plus the lookups inside it. As Microsoft's SPF guide puts it, "having fewer than 10 include: statements doesn't guarantee fewer than 10 DNS lookups."
A record can parse and still fail:
More than 10 lookups:
include,a,mx,ptr,existsandredirectcount, nested ones included;ip4,ip6andalldo not (RFC 7208, section 4.6.4). Over the limit, the result ispermerror.Two
v=spf1records: also apermerror(RFC 7208, section 4.5). Merge them into one.The
ptrmechanism: RFC 7208 says not to publish it.
DKIM Test
Replace s1 in the command with the s= value from the DKIM-Signature header. A published key starts with v=DKIM1; k=rsa; p= and a long base64 string.
Some providers publish a CNAME at the selector that points to a key they host, as Microsoft 365 does for selector1 and selector2 (Microsoft DKIM guide); dig follows it. An empty answer means a wrong selector or no key. An empty p= means the key was revoked (RFC 6376, section 3.6.1).
A key in DNS proves only that a key exists. The DKIM test that counts is a signed message that verifies, so finish with the header check below. In the header, d= is the signing domain: for DMARC it must be your From domain or share its organizational domain, such as mail.acme.io for acme.io. A signature with your provider's own domain passes DKIM and does nothing for DMARC.
DMARC Test With dig
The dig +short TXT _dmarc.acme.io answer looks like "v=DMARC1; p=none; rua=mailto:dmarc@acme.io".
Look for one record (Microsoft's DMARC guide says to "ensure only one _dmarc TXT record exists"), a p= of none, quarantine or reject, and a rua= address for reports. Typical mistakes: policy= in place of p=, a report address without mailto:, and a record published on the domain itself instead of at _dmarc.<domain>.
RFC 9989 reads a record without p= as p=none, drops the pct tag, and marks a test phase with t=y (RFC 9989, section 4.7). If the domain has no record yet, the DMARC record generator writes one for your rollout stage.
Read the Authentication-Results Header
DNS shows what you published. The header shows what a receiver decided about one real message, including problems DNS cannot show, such as a provider that signs with its own domain.
Send an email from the mailbox you are testing to a Gmail address you own. In Gmail on a computer, open it, click More next to Reply and choose Show original (Google: trace an email with its full header). The page starts with an SPF, DKIM and DMARC summary. Below it, search for Authentication-Results, as Google's DKIM troubleshooting steps direct. The field has this shape (RFC 8601):
Authentication-Results:
mx.google.com;
dkim=pass header.i=@acme.io
header.s=s1;
spf=pass smtp.mailfrom=a@acme.io;
dmarc=pass header.from=acme.io
smtp.mailfrom: the envelope (Return-Path) domain that SPF checkedheader.d, orheader.iin Gmail: the domain that signed DKIMheader.from: the From domain that DMARC compares with the other two
DMARC passes when spf=pass or dkim=pass is on a domain with the same organizational domain as header.from. That is relaxed alignment, the default; strict alignment (aspf=s or adkim=s) needs an exact match.
In Outlook, open the message's internet headers. Microsoft 365 adds compauth, a composite result, and shows dmarc=bestguesspass when the domain has no DMARC record and the message would have passed one (Microsoft: anti-spam message headers).
Read the Result
Each check returns one result per message:
Check | Result | Meaning | Fix |
|---|---|---|---|
SPF |
| The sending IP is in the envelope domain's SPF record | Confirm that domain aligns with From |
SPF |
| IP not listed; the record ends in | Add the service's |
SPF |
| The record ends in | End it with |
SPF |
| No SPF record | Publish one |
SPF |
| Two records, more than 10 lookups or bad syntax | |
SPF |
| A DNS error; a later retry may succeed | Retry; if it repeats, check your DNS host |
DKIM |
| The signature verified with the published key | Confirm |
DKIM |
| Wrong key in DNS, or the message changed after signing | |
DKIM |
| The message was not signed | Turn on DKIM in the sending service |
DMARC |
| An aligned SPF or DKIM pass | Raise the policy once every sender passes |
DMARC |
| No aligned pass | |
DMARC |
| No DMARC record | Publish one with |
The policy in the record decides what happens to a DMARC failure. p=none only asks for reports. With p=quarantine, failing mail is treated as suspicious, and Microsoft 365 sends it to Junk Email. With p=reject, failing mail should be refused, and Microsoft 365 rejects it with 550 5.7.1.
Sources: SPF in RFC 7208, sections 2.6 and 8.5; DKIM in RFC 8601, section 2.7.1; DMARC in RFC 9989, sections 5.3.5 and 4.7; Microsoft 365 handling in its DMARC guide, with the Honor DMARC record policy setting on.
Free guide20 min read
Send 100,000 cold emails a month
Domains and mailboxes you need, DNS, warmup, lists, copy and follow-ups, with a launch checklist, sent to your inbox.
Fix What the Test Found
Fix the one thing the result names, then test again.
Fixing SPF PermError
"PermError: too many DNS lookups" means the record needs more than 10 lookups. Remove include entries for services you no longer use. Replace an include with the provider's ip4 and ip6 ranges, and update the record when the provider changes them. Or move a sending service to a subdomain with its own SPF record. All causes: SPF PermError.
Two v=spf1 records on one domain cause a permerror too: merge all sources into one record. The SPF flattening tool counts what each include costs and flattens only the includes you pick; the SPF record generator rebuilds the record from your list of senders.
Fixing DKIM Signature Failures
"DKIM signature did not verify" usually means the public key in DNS does not match the private key that signed. Check in this order:
Does
d=match the domain you expect?Does the selector in
s=exist in DNS and hold the current key?Did something change the message after signing, such as a footer, a link rewriter or a mailing list?
Copy the key from your sending service again and paste it into the TXT record, checking for extra spaces and missing characters. Some DNS panels split long keys into several quoted strings; that is allowed as long as nothing is lost. After a key rotation, publish the new key before the provider starts signing with it. More causes: why DKIM fails.
Fixing DMARC Alignment Failures
DMARC fails when neither SPF nor DKIM passes for a domain aligned with the From address, so a message can pass SPF and still fail DMARC. Example: a marketing tool sends with a Return-Path on sendgrid.net. SPF passes for sendgrid.net, your From is acme.io, and SPF does not align. If the tool also signs DKIM with its own domain, DMARC fails.
Fix it in the sender's settings: turn on "custom domain", "domain authentication" or "sender authentication" so the tool signs DKIM with your domain and, where it can, uses a Return-Path on your domain. Forwarding and other cases: DMARC fail.
Reading DMARC Aggregate Reports
Within a day or two of publishing rua=, aggregate reports start to arrive from providers such as Gmail and Yahoo: XML files, usually one per provider per day. A DMARC report parser turns them into tables with the sending IPs, their SPF and DKIM results, alignment and message counts.
- Email sentFrom: acme.io
- Receiver checksSPF, DKIM, alignment
- Daily reportXML to your rua address
Ask two questions of every report. Do you recognize every IP? An unknown one is either an internal system nobody listed or someone spoofing your domain. Which legitimate senders fail alignment? Set up their domain authentication. Once every legitimate source passes, move from p=none to p=quarantine and then to p=reject.
To audit many domains at once, the email DNS audit skill runs these checks in Claude or ChatGPT.
SPF, DKIM and DMARC Test Questions
How Do I Check SPF, DKIM and DMARC?
Look up the records, then read a real message. Run dig +short TXT (or nslookup -q=TXT on Windows) for the domain, <selector>._domainkey.<domain> and _dmarc.<domain>. Then send an email to a Gmail address you own, open Show original and check Authentication-Results for spf=pass, dkim=pass and dmarc=pass. The steps are in Check SPF, DKIM and DMARC by Hand.
How Do I Run a DKIM Test?
Send an email from the domain to a mailbox you own and read its DKIM-Signature header for d= (the signing domain) and s= (the selector). Look up <selector>._domainkey.<domain> with dig to confirm the key is published. Then check the message's Authentication-Results for dkim=pass with your own domain in header.d or header.i.
How Long Until DNS Changes Show Up in a Test?
A new record is usually visible within minutes, unless a resolver cached the earlier "no record" answer; that can stay cached up to the zone's negative-caching TTL (RFC 2308). A changed record shows up when the old value's TTL expires: with a TTL of 3600 seconds, within an hour on most resolvers. DMARC aggregate reports cover a full day, so expect the change there a day later.
All Three Pass. Why Does My Mail Still Go to Spam?
Authentication proves who sent the message, and filters still judge the sender and the mail. Check whether your domain or sending IP is on a blocklist with the email blacklist check, check your spam rate in Google Postmaster Tools, and look at the content: broken links, link shorteners and image-only messages. Google asks senders to keep the spam rate below 0.1% and never reach 0.3% (Google). How to avoid spam filters covers the rest.
Do Subdomains Need Their Own SPF Records?
Yes, if they send mail. SPF is checked for the exact domain in the Return-Path, so the record on acme.io does not cover support.acme.io.
How Do I Set Up SPF, DKIM and DMARC for Cold Email?
Give every sending domain its own SPF record, DKIM key and DMARC record; p=none with a rua address meets Google's bulk-sender rule. Test each domain before warmup starts. SPF, DKIM and DMARC for cold email lists what each domain needs, and domains for cold email covers choosing them.
Outreach2day sets up SPF, DKIM, DMARC and a redirect to your website automatically on every domain, along with mailboxes and warmup, so this test is how you confirm the records on each domain.
Keep reading
Send 100,000 cold emails a month
How to send 100,000 cold emails a month while keeping quality, engagement and conversion rates high: domains, mailboxes, warmup, leads, copy and scaling
Step-by-step playbook · 20 min readDeliverability10 min read
How to Avoid Spam Filters: What They Check
Deliverability8 min read
7 Email Deliverability Best Practices
Deliverability12 min read
Google Workspace SPF, DKIM and DMARC Setup
Answer2 min read
What Does 550 5.7.26 Mean, and How Do I Fix It?
Free tool
Email header analyzer