Email security checker: SPF and DMARC
Can mail servers catch a message that impersonates your site's domain?
- Checks your page
- Reads:DNS
- 2 rules
- Last updated
What we keep
The result appears here
Enter your page’s address and press “Check the page”. This is what the tool runs on it:
- No SPF record for the domainnot started
- No valid DMARC record for the domainnot started
What it checks
- One SPF record on the domain itself: a TXT record that starts with
v=spf1and names the servers allowed to send its mail. Two or more are an error with which mail servers read none of them. - One DMARC record at the domain's
_dmarcname: a TXT record that starts with the tagv=DMARC1and has aptag,none,quarantineorreject, which tells mail servers what to do with messages that pass neither SPF nor DKIM. - The domain checked is the organizational domain of the page's address: a page on
www.example.comhas the domainexample.com, and a DMARC record there covers its subdomains too. A site a platform gives you, such asyou.github.io,shop.myshopify.comorsite.vercel.app, has no domain of yours to check: the platform holds that zone's DNS, so the tool does not apply to it.
Example
example.com. TXT "google-site-verification=wA4bXl2mQv9s3TKpZ7uYcN1eRdHf0gJhK8oLiPqS6xE"
example.com. TXT "v=spf1 include:_spf.google.com ~all" _dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
How to fix
Add both records at your domain's DNS provider, in the control panel where you manage its records:
- SPF: a TXT record on the domain itself (the name
@in most control panels) that starts withv=spf1and names every service that sends your mail. If you send through Google Workspace alone, the record Google gives isv=spf1 include:_spf.google.com ~all. Each other mail service says in its guide what to add: put them all in one record. - DMARC: a TXT record named
_dmarcthat starts withv=DMARC1. Google advises starting with the policyp=noneand following the reports sent to theruaaddress, then tightening it toquarantineorreject, and waiting 48 hours after setting up SPF or DKIM before setting up DMARC.
- If the domain never sends mail, M3AAWG recommends these two records:
example.com. TXT "v=spf1 -all"
_dmarc.example.com. TXT "v=DMARC1; p=reject"FAQ
Yes. M3AAWG recommends that every domain that sends no mail publish an SPF record that allows no server (v=spf1 -all) and a DMARC record with the policy p=reject, so no one can send mail in its name.
No. SPF names the servers allowed to send; DMARC tells mail servers what to do with a message that passes neither SPF nor DKIM, and has reports sent to you on what is sent in your domain's name. Google advises setting up SPF and DKIM, then DMARC.
Because a DKIM key is in DNS under a name that starts with a selector each mail service chooses and names in its messages, as RFC 6376 says, so a scan of a page cannot know where to look.
Because no answer to the DNS question came in time, or the DNS server answered with an error. A question without an answer says nothing of the records, so we do not judge them.
What this tool runs
- No SPF record for the domainmoderate
spf-missing - No valid DMARC record for the domainmoderate
dmarc-missing
How we measure
We take the page's organizational domain from its address, as RFC 7489 defines it from the Public Suffix List, then ask a DNS resolver for the TXT records of two names alone: the domain itself and its _dmarc name, and for no other type or name, within ten seconds at most. The question goes as DNS over HTTPS (RFC 8484) to Cloudflare's resolver, or to the one the scanner is set to, through the same egress proxy as the rest of the scan's traffic: the domain's name goes to that resolver, and nothing else of the page. SPF fails when no record starts with v=spf1 followed by a space or the record's end (RFC 7208), or when more than one does. DMARC fails when no record starts with the tag v whose value is DMARC1, in capitals (RFC 7489), when more than one does, or when the one record has no p tag with the value none, quarantine or reject. We check nothing further in the records, nor DKIM. When no answer comes, we do not judge, and the report says the check could not run. Pages on an IP address, a local name, a private address, or a site a platform gives its customers are left out. The same records give the same result every time.