DMARC (Domain-based Message Authentication, Reporting and Conformance) ties SPF and DKIM together and tells receivers what to do when a message claiming to be from your domain fails authentication. This builder produces a valid record and explains every tag as you go.
How it works
DMARC is published as a single TXT record at _dmarc.<your-domain>. The record
is a list of tags; the builder assembles them in the correct order and validates
each:
v=DMARC1— the version, always first.p=— the policy:none(monitor),quarantine(spam), orreject(block). This is the only required tag besides the version.sp=— an optional separate policy for subdomains.pct=— apply the policy to only a percentage of failing mail, for staged rollout.rua=— the address for daily aggregate reports (the data you act on).ruf=— the address for per-message forensic reports (often unsupported).adkim=/aspf=— DKIM and SPF alignment mode, relaxed (default) or strict.
Crucially, DMARC only passes when SPF or DKIM both passes and aligns with
the From domain. Authentication alone is not enough — alignment is what stops a
spoofer who authenticates their own unrelated domain.
The recommended rollout
Moving straight to p=reject risks blocking your own legitimate mail. The safe
sequence is:
1. p=none with rua → collect reports, find all your senders
2. p=quarantine → start protecting; watch reports for false positives
3. p=reject → full enforcement once everything is aligned
A typical monitoring record looks like:
v=DMARC1; p=none; rua=mailto:[email protected]; adkim=r; aspf=r
and a hardened one:
v=DMARC1; p=reject; rua=mailto:[email protected]; adkim=s; aspf=s
Tips
- Always publish an
ruaaddress before enforcing — without reports you are flying blind and may silently block real mail. - Keep
pctas a ramp: tryp=quarantine; pct=25, then raise it as reports stay clean. - Relaxed alignment is fine for most senders; switch to strict only once you are certain all your mail signs/sends from the exact From domain.
- Validation here is offline. After publishing, confirm the record resolves with a DNS TXT query and watch the first aggregate reports arrive within a day or two.