SPF, DKIM and DMARC checker
Before your mail lands in spam, check what receivers read in DNS: one valid SPF record within its 10 lookups, a DMARC policy that does something, and DKIM keys that are long enough. Your browser asks public resolvers directly; nothing goes through or stays with ANAROQ. Below the check, write SPF and DMARC records locally.
Write SPF and DMARC records
These generators run in your browser and send nothing. Publish the result at your DNS provider as a TXT record, then check again above.
SPF record
Choose everything that sends mail as your domain. A domain has exactly one SPF record: if you already have one, merge it rather than adding a second.
v=spf1 -allNothing chosen: this is the record of a domain that sends no mail. It costs no lookup.
DMARC record, step by step
DMARC tells receivers what to do with mail that fails both SPF and DKIM alignment, and where to send reports. Move one step at a time, and only when the reports show that all your own mail passes.
v=DMARC1; p=noneNext: read the reports, add the services that fail to SPF or DKIM, then move to quarantine.
What it does
It reads the e-mail authentication records of a domain from public DNS-over-HTTPS resolvers, from your browser: the SPF record and every record it includes, the DMARC policy, the DKIM keys of the selectors you enter, and the MX records. It reports what makes receivers treat your mail as unauthenticated: more than one SPF record, more than 10 DNS lookups, +all, a missing or monitoring-only DMARC policy, missing or short DKIM keys. Two generators write SPF and DMARC records locally.
How it works
- Enter the domain of your From address, and the DKIM selectors you know (the s= value of the DKIM-Signature header of a message you sent).
- Read the notice: pressing the button sends the DNS names of the check to the resolvers listed there.
- Press Check e-mail DNS. The SPF includes are followed one level at a time, so a check takes a few seconds.
- Read the findings, most serious first, each with what to change and the RFC behind it. Use the generators below to write a fixed record.
What it checks
- SPF
- Exactly one record that starts with v=spf1, with valid terms; its include and redirect targets followed and every lookup counted against the limit of 10 (RFC 7208 §4.6.4); what all says about other servers (+all, ?all, ~all, -all); ptr and terms after all.
- DMARC
- One record at _dmarc of the domain, or of its parent domain; a valid p, and sp, pct, rua, adkim and aspf; p=none is reported as monitoring only, and missing reports as a gap (RFC 7489).
- DKIM
- For each selector you enter: whether a key is published, whether it is valid, revoked or in testing mode, and its size. RSA under 1024 bits is refused; under 2048 is below what signers should use (RFC 8301).
- MX
- The mail servers and their order; a domain without MX, a null MX (RFC 7505), and an MX that points to an IP address.
Example
example.com added a newsletter and a CRM service to its SPF record. These made-up answers (documentation names and addresses) are the checker's real findings: the includes now need 11 DNS lookups, DMARC is still p=none without reports, and the DKIM key of selector s1 is 1024 bits.
Result for example.com
SPF
v=spf1 a mx include:spf.mail-a.example include:spf.newsletter.example include:spf.crm.example ~all11 of 10 DNS lookups allowed, with the includes.
Include tree
- example.com
- include:spf.mail-a.example
- include:_s1.mail-a.example
- include:_s2.mail-a.example
- include:_s3.mail-a.example
- include:spf.newsletter.example
- include:_ip.newsletter.example
- include:spf.crm.example
- include:spf.mail-a.example
DMARC
v=DMARC1; p=noneFound at _dmarc.example.com.
| Tag | Meaning | Value |
|---|---|---|
| p | Policy for the domain | none |
| sp | Policy for subdomains | none |
| pct | Share of failing mail the policy applies to (%) | 100 |
| rua | Where aggregate reports go | — |
| adkim | DKIM alignment (r relaxed, s strict) | r |
| aspf | SPF alignment (r relaxed, s strict) | r |
DKIM
| Selector | Status | Key |
|---|---|---|
| s1._domainkey.example.com | Published | rsa, 1024 bits |
MX
| Preference | Mail server |
|---|---|
| 10 | mx1.example.com |
| 20 | mx2.example.com |
Findings
5 findings: 1 error, 0 high, 2 medium, 1 low, 1 info.
Error1
- ErrorAQ-MAIL-005
The SPF record needs 11 DNS lookups, with its includes; the limit is 10. Past it, receivers stop with an error (permerror) and SPF fails for all your mail.
Fix: Remove includes of services you no longer send with, replace
aandmxwithip4:/ip6:of fixed servers (they cost no lookup), or send bulk mail from a subdomain with its own SPF record.
Medium2
- MediumAQ-MAIL-023
The DMARC policy at
_dmarc.example.comisp=none: monitoring only. Mail that fails SPF and DKIM is still delivered.Fix: Once the reports show that all your own mail passes, move to
p=quarantineand then top=reject. The generator below explains each step. - MediumAQ-MAIL-034
The DKIM key of selector
s1is RSA with 1024 bits. Keys under 1024 bits are refused; signers should use at least 2048.Fix: Create a 2048-bit key in your mail service under a new selector, publish it, switch signing to it, and remove the old selector after a few days.
Low1
- LowAQ-MAIL-025
The DMARC record at
_dmarc.example.comhas noruaaddress: nobody receives the aggregate reports that show who sends mail as this domain.Fix: Add
rua=mailto:with a mailbox that you read, or one of a DMARC report service.
Info1
- InfoAQ-MAIL-011
The SPF record ends with
~all(soft fail): mail from other servers is marked, not refused. With a DMARC policy this is common;-allis stricter.
Limits
- It sees what public resolvers answer from where you are, at this moment.
- DKIM selectors cannot be discovered from DNS: only the ones you enter are checked.
- SPF includes that use macros (%{…}) are filled in per message and are not followed, so the lookup count can be higher. The checker stops following includes once the count passes 10.
- It does not send a test message, check blocklists or read BIMI, and it cannot say whether a given message passes: that depends on the server it came from.
- Whether a name is a root domain is decided without the Public Suffix List, as in the DNS go-live checker; the parent domain for DMARC follows the same rule.
Methodology: how the numbers are worked out
Sources
Related
Next step
A free public tool by ANAROQ, a company building compute infrastructure. What ANAROQ is building