SPF, DKIM and DMARC Alignment Practice

Free SPF, DKIM and DMARC practice for CompTIA Security+ (SY0-701) and SecurityX (CAS-005): read a message and its DNS records, then give the SPF result, the DMARC result or the SPF lookup count. Check my answer names the slip, such as an SPF pass taken as a DMARC pass, or ~all read as fail.

Practise

Message and records

Answer to see the working.

The messages and records are made up for practice, with example.com, example.net and example.org as the domains. Results given in the message, such as a DKIM pass, are what the receiver found.

Practise the exam

CompTIA Security+ SY0-701 objective 4.5 lists email security with DMARC, DKIM and SPF, and SecurityX CAS-005 objective 3.3 covers them when troubleshooting network infrastructure security. Start with the free real exam questions, then get the full pack.

CompTIA Security+ SY0-701611 real exam questions · US$39
Free: 153 questionsGet the full pack
CompTIA SecurityX CAS-005482 real exam questions · US$39
Free: 120 questionsGet the full pack

SPF and DMARC FAQ

Why can SPF pass and DMARC still fail?

DMARC relies only on the SPF check of the MAIL FROM domain, and that domain must also align with the From domain. RFC 9989 says any domain owner, even a bad actor, can publish an SPF record and get an SPF pass, so a pass for bounce.example.net does nothing for mail from example.com.

What is the difference between relaxed and strict alignment?

In relaxed alignment the two domains have the same Organizational Domain, so foo.example.com aligns with news.example.com. In strict alignment they must be identical. Both aspf and adkim default to r, relaxed; s asks for strict.

Do SPF and DKIM both have to align?

No. RFC 9989 says that if one or more of the Authenticated Identifiers align with the Author Domain, the message passes the DMARC check. One aligned SPF pass or one aligned, valid DKIM signature is enough.

Does a failed DKIM signature or SPF fail still align?

No. Alignment cannot exist with a DKIM signature that does not validate, and it cannot exist if SPF does not give a pass. A d= that matches the From domain counts only when its signature passes.

Which policy applies to a subdomain?

If the From domain has its own _dmarc record, that record's p applies. If the record is found at the Organizational Domain instead, a subdomain gets the sp policy, or p when there is no sp. The sp tag never applies to the Organizational Domain itself.

What happened to the pct tag?

RFC 9989 removed it. Only registered tags are processed and unknown tags must be ignored, so pct=50 no longer changes anything. Its testing role moved to the new t tag.

What does t=y do?

It asks the receiver to apply the policy one level below the one published: p=reject with t=y is treated as quarantine, and p=quarantine with t=y as none. It has no effect on a policy of none.

What is the difference between ~all and -all?

The qualifier sets the result when a term matches. With no qualifier, or +, it is pass; - gives fail, ~ gives softfail, and neutral comes from ?. Softfail is a weak statement that the host is probably not authorized. A record with no all term ends as neutral, as if ?all were at the end.

Which SPF terms count toward the 10 lookup limit?

RFC 7208 counts include, a, mx, ptr, exists and the redirect modifier, across the whole check, including the records an include reaches. More than 10 is a permerror. ip4, ip6, all and exp do not count.

Does the -all inside an included record end the check?

No. An include only asks whether the other record gives a pass. If it does not, the include does not match and the check carries on with the next term, so the outer record's own all decides.

What if a domain has two SPF records?

The check keeps the TXT records that begin with v=spf1. None left is the result none, and more than one is a permerror. A domain with no SPF record gets none, not neutral.

Must a receiver reject mail when DMARC fails?

Not exactly. RFC 9989 says mail that fails is handled under the receiver's own local policies, which may take the domain owner's policy into account. This drill names the policy the owner asks for.

Which exams cover SPF, DKIM and DMARC?

CompTIA Security+ SY0-701 objective 4.5, modify enterprise capabilities to enhance security, lists email security with DMARC, DKIM and SPF. CompTIA SecurityX CAS-005 objective 3.3 lists them under email security when troubleshooting network infrastructure security issues.

Sources
  • IETF, RFC 9989, DMARC (Standards Track, May 2026, obsoletes RFC 7489 and RFC 9091): relaxed and strict alignment, SPF and DKIM Authenticated Identifiers, pass when one aligns, the p, sp, adkim, aspf and t tags, policy discovery and the DNS Tree Walk, the removal of pct, and the alignment examples in Appendix B.1.
  • IETF, RFC 7208, SPF: record selection, qualifiers, the default result, include, redirect, ip4 networks and the 10 DNS lookup limit.
  • IETF, RFC 6376, DKIM: the d= signing domain.
  • Microsoft Learn, Set up DMARC: relaxed and strict alignment in practice.
  • Exam fit: CompTIA, Security+ SY0-701 exam objectives (4.5, email security) and SecurityX CAS-005 (objective 3.3, email security).
  • Checked 22 November 2026. The tool's own approach: the messages are invented; each organization that publishes DMARC does so at its own two-label domain, no psd tag is used and every From domain exists, so the Organizational Domain stays plain; SPF records use ip4, a, include, redirect and all only (mx, ptr, exists and macros are left out); ARC and forwarding are left out. An independent re-solver that reads only the exhibit and the buttons agreed with the drill on 4,000 generated problems. This is an independent practice tool, not made or endorsed by the IETF, Microsoft or CompTIA.

Checked 22 November 2026 against RFC 9989 (DMARC), RFC 7208 (SPF), RFC 6376 (DKIM) and the CompTIA SY0-701 and CAS-005 objectives.

More free tools

All free tools