Home / Guides / How to Check SPF, DKIM and DMARC Records of a Domain

Updated

How to Check SPF, DKIM and DMARC Records of a Domain

SPF is the TXT record of the domain that starts with v=spf1; DMARC is the TXT record of _dmarc.domain that starts with v=DMARC1; DKIM is at selector._domainkey.domain. One DNS-over-HTTPS query per record is enough: curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=_dmarc.google.com&type=TXT' returns v=DMARC1; p=reject.

1. Query the records

curl -s -H 'accept: application/dns-json' \
  'https://cloudflare-dns.com/dns-query?name=_dmarc.google.com&type=TXT' | jq -r '.Answer[].data'
# "v=DMARC1; p=reject; rua=mailto:..."

curl -s -H 'accept: application/dns-json' \
  'https://cloudflare-dns.com/dns-query?name=google.com&type=TXT' | jq -r '.Answer[].data' | grep spf1
# "v=spf1 include:_spf.google.com ~all"

DNS over HTTPS works from any machine with curl, without a local resolver tool.

2. Read the result

3. Common mistakes

4. Many domains

Plainprobe Domain & Tech Stack Intelligence returns SPF, DMARC, DKIM (common selectors), MTA-STS, an e-mail security score, SSL, RDAP dates and the detected technologies as one JSON record per domain, at $0.003 per domain. For the DKIM key and how to find its selector, see How to look up a DKIM record. To see which provider receives the mail, see How to find a domain's e-mail provider.

Limits to keep in mind

FAQ

How do I check a domain's DMARC record?

Query the TXT record of _dmarc.example.com. A valid record starts with v=DMARC1 and its p= tag says what receivers should do with failing mail: none (monitor), quarantine or reject.

How do I check a domain's SPF record?

Query the TXT records of the domain itself and keep the one that starts with v=spf1. There must be only one SPF record, and it should end with ~all or -all.

Can I check DKIM without knowing the selector?

Not reliably. DKIM keys live at selector._domainkey.example.com and the selector is chosen by the sender, so a checker can only try common selectors (google, selector1, selector2, k1 and so on).

Can I check SPF and DMARC for many domains at once?

Yes: loop over the domains with a DNS-over-HTTPS query per record, or use a bulk tool that returns one JSON record per domain with the parsed policy and a score.

Related tool