Why it matters
- A DMARC record tells mail servers what to do with messages that carry your domain's name and pass neither SPF nor DKIM: deliver them, quarantine them or reject them. It also has reports sent to you on what is sent in your domain's name.
- When a domain has no record, RFC 7489 says mail servers should not apply DMARC to its messages, so you have no say over messages that impersonate it.
- Gmail asks those who send more than 5,000 messages a day to Gmail accounts to set up DMARC, and allows its policy to be
none. - The record on the organizational domain covers its subdomains too: the
sptag sets their policy, and when it is absent,pdoes.
How to fix
Add a TXT record named _dmarc on the domain, starting with v=DMARC1. Google advises starting with the policy none and following the reports:
dns
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:[email protected]"- Google says to wait 48 hours after setting up SPF or DKIM before setting up DMARC.
- Once the reports show your mail passes, tighten the policy to
quarantine, thenreject. - If the domain never sends mail, the record M3AAWG recommends asks mail servers to reject what fails the check, which, for a domain that sends no mail, is all mail in its name:
dns
_dmarc.example.com. TXT "v=DMARC1; p=reject"- One record only at
_dmarc: two records that each start withv=DMARC1void DMARC altogether. - The
ptag is required, and its value isnone,quarantineorreject. Write a;afterv=DMARC1and between the tags.
How we detect
- We take the page's organizational domain from its name, as RFC 7489 (§3.2) defines it from the Public Suffix List: a page on
www.shop.example.com.sahas the domainexample.com.sa. - We ask a DNS resolver for the TXT records of that domain's
_dmarcname alone (§6.1), and for no other type or name, as DNS over HTTPS (RFC 8484): Cloudflare's resolver, or the one the scanner is set to, through the same egress proxy as the rest of the scan's traffic. A scan that runs on a machine without an egress proxy asks that machine's DNS servers instead. A mail server asks for the record of the domain in the sender's address, then for its organizational domain's when it finds none (§6.6.3), so the record we read is the one every subdomain without its own falls back to. - The rule fails when no record starts with the tag
vwhose value isDMARC1, in capitals and exactly, with spaces allowed around the=(§6.3 and §6.4), or when more than one does. It fails, with a message of its own, when the one record has noptag, or apwhose value is notnone,quarantineorreject(§6.3; in any letter case, and wherever among the tags it stands), and when a record starts withv=DMARC1but no;follows it, which the grammar of §6.4 requires. RFC 7489 (§6.6.3) lets a receiver read a record with a validruaand no validpasp=none; we still fail it, since the record does not set the policy the RFC requires. - When no answer comes in time, or the DNS server answers with an error, we do not judge: the report says the rule could not run. A scan with no way to ask DNS leaves the rule out, and the report says so.
- We do not check the other tags (
sp,rua,pct), nor records of subdomains' own. Pages on an IP address, on a local name such aslocalhostor one that ends in.test, on a private address, or on a site a platform gives its customers, such asuser.github.io,shop.myshopify.comorsite.vercel.app, are left out: the DNS of that zone is the platform's, and its customers cannot change it. The rule does not apply to them.