Check SPF, DKIM and DMARC with dig: The Command-Line Trio

The three email authentication records are one dig command each: SPF at the root TXT, DKIM at selector._domainkey, and DMARC at _dmarc. Reading them is pattern matching: SPF must start v=spf1 and stay under 10 lookups, DKIM must carry a non-empty p= key, and DMARC must carry a p= policy. The commands below are the same checks our tools run, so the browser route and the terminal route always agree.

RecordCommand
SPFdig example.com TXT +short
DKIMdig default._domainkey.example.com TXT +short
DMARCdig _dmarc.example.com TXT +short
All three livedig example.com TXT +short, then the two subdomain lookups above

Reading the SPF answer

A healthy SPF starts with v=spf1 and ends with an all mechanism, usually ~all or -all.

Count the DNS-querying terms: every include, a, mx, exists, and redirect consumes one of the 10 allowed lookups (RFC 7208).

Two v=spf1 records on the same name is a permerror: receivers stop evaluating entirely.

Reading the DKIM answer

A healthy DKIM record has v=DKIM1, a k= field (rsa is standard), and a long p= value with the public key.

An empty p=, like v=DKIM1; p=, means the key was revoked or never published: mail signed with that selector will fail.

The selector matters: mail signed with s=20230601 must be checked at 20230601._domainkey, not at default._domainkey.

Reading the DMARC answer

A valid record starts v=DMARC1 and must carry a p= tag: none, quarantine, or reject.

A rua= address means aggregate reports arrive daily; enforcement without rua is flying blind.

No record at _dmarc is itself the finding: the domain has no DMARC policy at all.

Frequently asked questions

Which selector does my DKIM use?+

Read the DKIM-Signature header of a real message you sent: the s= value is the selector. Common defaults are default, google, selector1, and selector2.

Why does dig show my record but mail still fails?+

dig proves publication, not alignment: DMARC also needs the From domain to align with the SPF or DKIM domain. Check alignment with the DMARC checker.

Does +short hide anything important?+

It trims DNS noise, not data. Drop +short when debugging to see TTLs and record types in full.

Verify with our free tools: DNS record lookup, propagation checker, flush DNS cache guide.

Last verified: 2026-10-29