Email security

What Is DKIM Alignment? Strict vs Relaxed, Explained With Examples

Your DKIM signature can pass while DMARC still fails. The missing link is alignment — whether the signing domain matches the domain your recipients see.

Cysoro Security TeamPublished · 7 min read
From: [email protected]DKIM d=mail.example.comSignature: PASSALIGNEDDMARC: PASS EMAIL SECURITY DKIMalignment Does your signature match your From?
Quick answer

DKIM alignment is the DMARC requirement that the domain in a DKIM signature (the d= tag) must match the domain in the visible From address. In relaxed mode, sharing the same organizational domain is enough, so d=mail.example.com aligns with From example.com. In strict mode, the two domains must match exactly. A message passes DMARC when DKIM passes and aligns, or SPF passes and aligns.

Key takeaways

  • DKIM alignment compares the DKIM d= domain with the visible From domain — a passing signature alone does not pass DMARC.
  • Relaxed alignment (the default) allows subdomains of the same organizational domain; strict alignment requires an exact match.
  • Most DMARC failures with passing DKIM come from third-party senders signing with their own domain instead of yours.

You set up DKIM, your signatures verify, and then DMARC still fails. This is one of the most confusing moments in email authentication — and it almost always comes down to one word: alignment.

What is DKIM alignment?

DKIM alignment is the DMARC rule that the domain in a DKIM signature must match the domain in the visible From address. DKIM alone only proves somebody signed the message; alignment proves the right domain signed it.

Every email carries several different domains. The From header is the one your recipient sees, for example [email protected]. The DKIM signature carries its own domain in the d= tag, for example d=mail.example.com. SPF, meanwhile, checks the envelope sender shown in the Return-Path. These three domains can all be different, and that gap is exactly what attackers exploit.

An attacker can send mail that appears to come from your domain while signing it with a domain they control. The signature is cryptographically valid, but it says nothing about your domain. DMARC closes that gap with identifier alignment, defined in RFC 7489 section 3.1: for DMARC to pass, at least one of SPF or DKIM must both pass authentication and align with the From domain.

Three domains, one checkFrom headerwhat recipients see[email protected]DKIM d= domainwho signed the messagemail.example.comReturn-PathSPF envelope senderbounce.example.comDMARC passes if SPF aligns OR DKIM alignsPassing authentication alone is not enough — the domain must match the From domain.
The three domains DMARC compares, and the pass rule. Illustration by Cysoro.

What is the difference between relaxed and strict DKIM alignment?

Relaxed alignment requires the same organizational domain; strict alignment requires an exact domain match. You choose the mode with the adkim tag in your DMARC record, and relaxed is the default.

The organizational domain is the registered domain: the public suffix plus one label. For example.com, the organizational domain is example.com. For example.co.uk, it is example.co.uk, because co.uk is a public suffix. RFC 7489 section 3.2 defines this using the Public Suffix List.

ScenarioFrom domainDKIM d= domainRelaxed (adkim=r)Strict (adkim=s)
Exact matchexample.comexample.comPassPass
Subdomain signs for parentexample.commail.example.comPassFail
Parent signs for subdomainnews.example.comexample.comPassFail
Different subdomainnews.example.commail.example.comPassFail
Third-party domainexample.comsendgrid.netFailFail
Look-alike domainexample.comexamp1e.comFailFail

Note that relaxed alignment is not the same as DKIM relaxed canonicalization. Canonicalization is about how the message body and headers are normalized before signing; alignment is about which domain signed. The similar names cause frequent confusion.

How does DMARC use DKIM alignment?

DMARC passes a message when either SPF passes and aligns, or DKIM passes and aligns. It does not require both, and it does not require the same mechanism to do both jobs.

That "either" matters in practice. Many organizations rely on DKIM alignment as their main path to DMARC compliance, because SPF breaks easily when mail is forwarded, while DKIM signatures usually survive forwarding. If you send through a marketing platform, DKIM alignment is almost always the route that works.

DMARC alignment is also what makes DMARC an anti-spoofing control rather than just a reporting tool. Without it, an attacker could pass SPF or DKIM for a domain they own while forging your From address, and DMARC would wave the message through.

Why does DMARC fail even though DKIM passes?

The most common cause is a third-party sender signing with its own domain. Your newsletter platform, CRM, or helpdesk sends mail from your From address but signs it with its own d= domain, so the signature verifies but does not align.

Other common causes include a subdomain mismatch under strict alignment, a misconfigured selector that signs with the wrong domain, and mail sent from a subdomain you forgot to cover. DMARC aggregate reports show the failing domains, so start there rather than guessing.

To find the culprit, look at your DMARC aggregate reports for sources with DKIM pass but DMARC fail. Each report lists the sending IP, the From domain, and the DKIM d= domain, which usually names the service responsible. You can also inspect a single message: paste its headers into our free email header analyzer to see the DKIM result, the signing domain, and whether SPF, DKIM and DMARC passed.

How do you fix DKIM alignment?

Fix alignment at the source: make every sender sign with your domain. That usually means setting up custom DKIM for each third-party service, not changing your DMARC policy.

  1. List every service that sends mail as you. Check DMARC reports, your DNS records, and ask teams about marketing, sales, support, HR and finance tools.
  2. Set up custom DKIM for each one. Most platforms publish two or three CNAME records you add to your DNS; they then sign with a subdomain of your domain, such as d=mail.example.com, which aligns under relaxed mode.
  3. Verify each sender individually. Send a test message from each service and confirm the DKIM d= domain and the DMARC result before moving on.
  4. Check SPF alignment too. If a service cannot sign with your domain, a custom Return-Path on your domain may give you SPF alignment instead.
  5. Move your DMARC policy up gradually. Start at p=none, watch reports until alignment failures disappear, then move to p=quarantine and finally p=reject.

Do not fix alignment by switching to strict mode or by loosening your policy. Strict mode makes the problem worse, and a loose policy leaves spoofing open. Our guide to what DMARC is and how to set it up walks through the safe path from monitoring to enforcement.

Fixing DKIM alignment in five steps1List sendersevery tool thatmails as you2Custom DKIMCNAME recordsper service3Test each onecheck d= domainand DMARC4Check SPF toocustom Return-Pathas backup5Enforcenone torejectNever skip a sender: one unaligned service can keep your whole domain at p=none.
Five steps to fix DKIM alignment before enforcing DMARC. Illustration by Cysoro.

Should you use strict or relaxed DKIM alignment?

Use relaxed alignment for almost every domain. It is the default, it covers legitimate subdomain senders, and Microsoft Learn notes that a strict failure on one check does not matter if the other check passes with relaxed alignment.

Strict alignment adds real risk for little gain. It breaks mail from subdomains, including the marketing and transactional subdomains most companies rely on, and it can push legitimate messages to spam or rejection. The only common reason to choose strict is when you have uncontrolled subdomains at third parties and want to stop them passing for your parent domain — and even then, fixing the subdomain setup is usually better.

You can also set the two modes independently: adkim=s with aspf=r, for example. That is useful if your DKIM signing is tightly controlled but your SPF setup relies on subdomains. Check your DMARC reports before changing either tag, and change one at a time.

Do not set strict alignment to "be safer"Strict alignment does not stop look-alike domains or mail from hacked accounts. It mainly stops your own subdomain senders. Test it at p=none first, and watch reports for a full sending cycle before enforcing anything.

What do Gmail and Yahoo require on alignment?

Since February 1, 2024, bulk senders to Gmail must authenticate with SPF and DKIM, publish a DMARC record, and align the From domain with the SPF or DKIM domain. Google defines a bulk sender as one sending close to 5,000 or more messages a day to personal Gmail accounts.

All senders to Gmail must set up SPF or DKIM, use valid forward and reverse DNS, send over TLS, and keep spam rates reported in Postmaster Tools below 0.3%. Bulk senders need both SPF and DKIM, a DMARC record of at least p=none, and one-click unsubscribe in marketing mail. Yahoo applies similar bulk sender rules.

Google also requires DKIM keys of at least 1024 bits, and recommends 2048-bit keys. Unauthenticated mail may be rejected with a 5.7.26 error. These requirements are in Google's email sender guidelines.

What are the common DKIM alignment mistakes?

The most common mistakes are signing with a vendor's domain, using strict alignment without testing, forgetting a subdomain sender, and rotating DKIM keys without updating DNS.

  • Leaving default DKIM on. Many platforms sign with their own domain until you configure custom DKIM. That mail authenticates but never aligns.
  • One selector for everything. Different services need their own selectors and keys, so a key rotation on one service does not break the others.
  • Forgetting transactional mail. Password resets, receipts and notifications often come from a different service than marketing mail, and they fail alignment silently.
  • Copying a DMARC record with adkim=s. A record copied from a blog or another company can turn on strict alignment you never intended.
  • Ignoring subdomains. A subdomain with no DMARC record inherits the organizational domain policy, but its senders still need aligned authentication of their own.

For the full picture, read our guide to what DKIM is and how it works, which explains selectors, keys and DNS records in detail.

The bottom line

DKIM alignment is the link between a valid signature and a trustworthy From address. Without it, DMARC cannot tell your mail from a forgery that happens to be signed by someone else.

Keep relaxed alignment, give every sender custom DKIM on your domain, and confirm alignment in your DMARC reports before you enforce p=reject.

You can check your own setup in seconds with the free DKIM checker.

Confirm the DMARC side too with the free DMARC checker.

Frequently asked questions

What is DKIM alignment in simple terms?

DKIM alignment means the domain that signed your email matches the domain in the From address your recipient sees. DKIM proves a message was signed by somebody, but alignment proves it was signed by you. Without alignment, DMARC treats the message as unauthenticated even though the signature is valid.

What is the difference between DKIM alignment and SPF alignment?

DKIM alignment compares the d= domain in the DKIM signature with the From domain. SPF alignment compares the envelope sender domain, shown in the Return-Path, with the From domain. DMARC checks both independently and passes if either one passes and aligns.

What is relaxed DKIM alignment?

Relaxed alignment, set with adkim=r, requires the DKIM signing domain and the From domain to share the same organizational domain. So d=mail.example.com aligns with From example.com, and d=example.com aligns with From news.example.com. Relaxed is the default when you omit the adkim tag.

What is strict DKIM alignment?

Strict alignment, set with adkim=s, requires the DKIM d= domain to match the From domain exactly, character for character. A subdomain no longer counts. Strict alignment is rarely needed and can break legitimate mail sent from subdomains.

Why does DMARC fail when DKIM passes?

The most common reason is a third-party sender signing with its own domain, for example d=sendgrid.net, while your From address is your domain. The signature is valid, but it does not align with your domain, so DMARC fails. The fix is to set up custom DKIM signing so the third party signs with your domain.

Should I use strict or relaxed DKIM alignment?

Use relaxed alignment unless you have a specific reason not to. Microsoft Learn describes relaxed as the default, with subdomains allowed, and strict as requiring an exact match. Most production domains run relaxed.

How do I check DKIM alignment?

Send a test message to a mailbox you control and inspect the Authentication-Results header, or paste the message headers into a header analyzer. Look for the DKIM result, the d= domain, and the DMARC result. Our free tools can check your published DKIM and DMARC records for you.

Does DKIM alignment matter for Gmail delivery?

Yes. Since February 2024, bulk senders to Gmail, meaning about 5,000 or more messages a day to personal Gmail accounts, must authenticate with SPF and DKIM and publish a DMARC record, and the From domain must align with the SPF or DKIM domain. Unaligned mail risks rejection.

Sources

  1. RFC 7489 — Domain-based Message Authentication, Reporting, and Conformance (DMARC)
  2. Google — Email sender guidelines
  3. Microsoft Learn — Set up DMARC to validate email in Microsoft 365
  4. DMARC.org — DMARC
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against RFC 7489 sections 3.1 and 3.2 and Google's email sender guidelines.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free