DKIM

How can I verify that my DKIM signing is properly aligned with DMARC for Gmail?

To verify that your DKIM signing is properly aligned with DMARC for Gmail, open the message in Gmail’s “Show original” view and confirm that dkim=pass for a signature whose d= domain matches the visible From domain (strict alignment) or shares the same Organizational Domain (relaxed alignment), that DMARC shows pass (via dkim), and that the DKIM selector’s DNS record (selector._domainkey) publishes a valid 2048-bit key Gmail can fetch—then corroborate consistency over 24–48 hours in DMARC aggregate reports (e.g., in DMARCReport) filtered to Gmail.

Email authentication can be deceptively simple on the surface—yet DMARC alignment hinges on precise domain relationships between the visible From address and underlying cryptographic identifiers. For Gmail, a DKIM pass alone isn’t enough; the d= domain embedded in your DKIM signature must be aligned with the RFC5322.From domain according to your DMARC policy’s adkim mode. Relaxed alignment (adkim=r) allows subdomains and organizational matches; strict alignment (adkim=s) requires an exact match.

Practically, this means two things: first, your signing infrastructure must sign with the domain users see in the From header (or a direct subdomain if you use relaxed alignment), and second, Gmail must be able to retrieve and validate your public key from DNS without corruption, truncation, or caching issues. DMARCReport complements these checks by confirming how Gmail evaluated real-world traffic: it aggregates Gmail’s DMARC feedback and shows whether Gmail credited DKIM alignment per source, per selector, and per sending IP so you can catch drift or misconfiguration early.

Understand and Confirm Alignment in Gmail

How Gmail evaluates DKIM alignment (relaxed vs strict)

  • DKIM alignment compares the signature’s d= domain to the RFC5322.From domain.
  • Under DMARC, alignment passes if:
    • Relaxed (adkim=r, default): the Organizational Domain matches (per Public Suffix List); example: d=mail.example.com aligns with From: user@example.com.
    • Strict (adkim=s): exact domain match; example: d=example.com aligns with From: user@example.com, but d=mail.example.com does not.

Recommended settings to ensure a pass:

  • DMARC adkim=r for resilience unless regulations or strict brand controls require adkim=s.
  • DKIM canonicalization: use relaxed/relaxed to minimize breakage across intermediaries; alignment is domain-based, but relaxed canonicalization improves signature survival.
  • DKIM algorithm: rsa-sha256 with 2048-bit keys.

How DMARCReport helps:

  • DMARCReport surfaces policy_evaluated.dkim=pass/fail by receiver (e.g., gmail.com), showing which sources and selectors produce aligned DKIM passes. It highlights misalignments where dkim=pass but not aligned, or where aligned DKIM is missing and Gmail only passes via SPF (riskier for forwarding scenarios).

Use Gmail “Show original” to verify alignment

In Gmail:

  • Open the message → More (⋮) → Show original
  • Check:
    • “DKIM: PASS” and note selector (s=), signing domain (d=), and identity (header.i=).
    • “DMARC: PASS” with “header.from=example.com” and the evaluation reason. If the DMARC pass is attributed to “dkim” rather than “spf,” you’ve confirmed DKIM alignment.

You can also inspect the raw Authentication-Results header:

  • Authentication-Results: mx.google.com; dkim=pass header.i=@example.com header.s=s2025 header.d=example.com; dmarc=pass (p=reject sp=none dis=none) header.from=example.com

How DMARCReport helps:

  • DMARCReport aggregates Gmail’s perspective across all your mail streams and shows at-a-glance alignment pass rates, letting you verify that what you saw in a single Gmail message holds across production traffic.
 ESP

Multiple DKIM signatures and Gmail’s choice

  • Gmail evaluates all DKIM signatures; DMARC passes if at least one aligned signature passes.
  • If you sign with multiple selectors (e.g., your MTA and an ESP), ensure your domain’s aligned signature is present and robust.
  • Prefer your brand’s aligned signature to be strongest (2048-bit, relaxed/relaxed, comprehensive header list) so Gmail is more likely to retain a pass even with downstream changes.

How DMARCReport helps:

  • DMARCReport shows which d= domains are passing at Gmail. If ESP-signed d=vendor.com is passing while your d=example.com is failing, DMARCReport flags that misalignment and its source, prompting a configuration fix.

Publish and Validate DKIM DNS Records for Gmail

Exact DNS record structure and sanity checks

Publish a TXT record at:

  • selector._domainkey.example.com

Required tags:

  • v=DKIM1; k=rsa; p=BASE64PUBLICKEY Optional tags:
  • t= y (testing) or s (strict: do not allow subdomain signing)
  • g= (granularity), rarely used
  • n= (notes), informational only

Formatting tips:

  • Split long TXT values into 255-character chunks; ensure your DNS provider joins them without extra spaces.
  • No trailing spaces or stray quotes; p= must be a continuous Base64 string.
  • Use 2048-bit keys; Gmail recommends 2048-bit minimum for new deployments.

Validation steps:

  • dig +short TXT selector._domainkey.example.com
  • Ensure only one TXT record per selector; no CNAME misconfigurations unless specifically required by your ESP (CNAME to vendor-managed keys is acceptable if documented).
  • Confirm the key length: a 2048-bit p= value is ~342–428 Base64 chars depending on padding; significantly shorter may indicate 1024-bit or truncation.

How DMARCReport helps:

  • DMARCReport correlates Gmail failures with DNS lookups seen in aggregate reports. It can highlight sudden spikes in dkim=fail at Gmail after a key rotation or DNS change, directing you to the exact selector and source.

Propagation, TTL, and rotation timing

  • Expect Gmail to validate new keys as soon as DNS is live, but caches can linger per TTL; use TTL of 3600 seconds during rollout for faster convergence; increase later for stability.
  • Maintain old selectors for 48–72 hours after rotation to cover delayed deliveries and retries.
  • Avoid deleting old TXT prematurely; Gmail may re-verify signatures days later during abuse reviews or when messages are reprocessed.

How DMARCReport helps:

  • DMARCReport’s daily rollups show the crossover: the old selector’s aligned pass rate declining as the new selector’s rises at Gmail. Set alerts to detect residual failures or missing signatures.
 alerts

Configure Signers to Produce Gmail-Aligned DKIM

Google Workspace outbound

  • Admin Console → Apps → Google Workspace → Gmail → Authenticate email
  • Generate a 2048-bit key and publish the provided TXT record; selector often defaults to google but you can name it (e.g., s2025).
  • Click Start authentication; Gmail begins signing with d=yourdomain.com.
  • For DMARC alignment: ensure your From domain equals the sign-at domain. If you send as aliases, configure Send mail as with “Treat as an alias” correctly and verify that Gmail signs with the alias’s domain or uses its own aligned signature.

How DMARCReport helps:

  • DMARCReport splits Gmail-sourced traffic by dkim_domain and shows whether Workspace signatures are the ones earning DMARC credit, versus third-party sources.

OpenDKIM on Postfix/Sendmail or corporate MTA

Recommended OpenDKIM settings:

  • Canonicalization: relaxed/relaxed
  • Signature headers (h=): at minimum From, Date, Subject, To, Message-ID, MIME-Version; consider oversigning From to prevent header injection
  • Algorithm: rsa-sha256
  • Selector naming: include year/quarter (e.g., s2025q1) to simplify rotations
  • SigningTable: map sender domains to keys; ensure d= matches the visible From domain when you need DKIM-based alignment

Sample OpenDKIM config pointers:

  • KeyTable: s2025._domainkey.example.com example.com:s2025:/etc/opendkim/keys/example.com/s2025.private
  • SigningTable: *@example.com s2025._domainkey.example.com
  • TrustedHosts: your outbound IPs and relays

How DMARCReport helps:

  • DMARCReport identifies per-IP and per-source misalignment at Gmail (e.g., a legacy relay that still signs with d=oldbrand.com), so you can update SigningTable mappings and retire old selectors safely.

Third-party senders and ESPs

To ensure Gmail treats their DKIM as aligned with your From:

  • Delegated DKIM: publish a TXT record in your domain for the vendor’s selector (e.g., esp1._domainkey.example.com), with p= provided by the ESP so they can sign with d=example.com.
  • CNAME delegation: point esp1._domainkey.example.com to vendor-managed host when supported; they rotate keys without you editing p=.
  • Subdomain strategy: send vendor traffic as From: user@mailer.example.com and have the ESP sign d=mailer.example.com. With DMARC adkim=r and a DMARC record on example.com covering subdomains (or a separate DMARC on mailer.example.com), alignment passes.
  • Avoid ESP signing with d=vendor.com if you need DKIM-based DMARC at Gmail; otherwise DMARC may only pass via SPF (fragile under forwarding).

How DMARCReport helps:

  • DMARCReport highlights each vendor’s Gmail alignment status, separating traffic by dkim_domain, selector, and source IP, so you can verify every ESP is correctly aligned and spot stragglers.

Troubleshoot Failures and Mitigate Breakage

Common causes that break DKIM alignment at Gmail

  • Mailing list managers that modify Subject, add footers, or reorder headers (signature invalidation)
  • Security gateways that rewrite URLs or add banners without re-signing
  • Forwarders that modify MIME boundaries or whitespace under simple canonicalization
  • ESPs signing with their own d= domain, not yours
  • Malformed DNS TXT (wrapped or truncated p=), or DNS not yet propagated
  • Multiple MTAs adding conflicting signatures, where the aligned signature fails and only a non-aligned signature passes

Recommended mitigations:

  • Use relaxed/relaxed canonicalization and sign a robust header set.
  • Re-sign at the last outbound hop you control; if a gateway must modify content, have it DKIM sign with your domain after modification.
  • Work with mailing lists to deploy DMARC-friendly modes (no subject rewrite) or switch to subaddressing.
  • Use ARC (Authenticated Received Chain) on trustworthy intermediaries; while ARC doesn’t “fix” DMARC alignment, Gmail uses ARC to make better delivery decisions when DMARC breaks during forwarding.

How DMARCReport helps:

  • DMARCReport correlates Gmail dkim=fail spikes with specific sources, campaigns, or times, and can show improvements after enabling relaxed canonicalization or re-signing at the edge.

Timing expectations and caching issues

  • After publishing or changing DKIM DNS records, expect Gmail to validate within minutes to an hour if TTLs are low; global resolver caches can delay effect for several hours.
  • Avoid overlapping rollouts with short TTLs during peak sends; schedule rotations during low volume and monitor in DMARCReport for stable Gmail alignment before retiring old keys.
Verification

Operationalize Verification with Tools and Step-by-Step Checks

Step-by-step verification workflow

  1. Send a test from the exact From domain to a Gmail mailbox.
  2. In Gmail “Show original,” confirm:
    • DKIM: PASS; d=yourdomain.com; s=your selector
    • DMARC: PASS via dkim; header.from=yourdomain.com
  3. dig +short TXT selector._domainkey.yourdomain.com and verify the 2048-bit p= value is correct and unbroken.
  4. Test through your entire path (ESP, marketing platform, CRM) and ensure each uses aligned DKIM.
  5. Monitor DMARCReport for 24–48 hours, filter receiver=gmail.com:
    • Look for policy_evaluated.dkim=pass and aligned signatures
    • Investigate any gmail.com rows where dkim=fail or aligned=false

Interpreting common tool outputs

  • Gmail Show original: “DKIM: PASS” and “DMARC: PASS” with From alignment is the gold standard.
  • Google Admin Toolbox CheckMX: confirms DKIM record reachability and key integrity.
  • OpenDKIM: opendkim-testkey -d example.com -s s2025 should report “key OK”; opendkim-testmsg can validate signature creation locally.
  • MXToolbox DKIM Lookup: checks for DNS formatting errors; verify only one TXT record returned.

How DMARCReport helps:

  • DMARCReport provides Gmail-specific charts for aligned DKIM pass rates, lets you pivot by selector, and sends alerts if Gmail’s aligned DKIM rate dips below a threshold after a config change or key rotation.

Original data and case studies

  • Retail brand A (10M/month): Before alignment fixes, Gmail DMARC pass due to DKIM was 61% (DMARCReport), with 29% passing via SPF only and 10% failing both. After delegating DKIM to two ESPs to sign d=brand.com and switching canonicalization to relaxed/relaxed, Gmail DKIM-aligned pass rose to 95% within 48 hours; complaint rate dropped 18% over two weeks.
  • SaaS company B: Selector rotation caused a 14-hour window where Gmail dkim=fail spiked to 22% due to a mis-quoted TXT p=. DMARCReport’s alert triggered within 30 minutes; fixing the TXT quoting restored Gmail DKIM alignment, evidenced by alignment recovery to 99% the same day.
  • Nonprofit C: Forwarding through a university list broke DKIM. Enabling ARC on their outbound gateway and re-signing at the last hop reduced Gmail “dkim=fail” events by 73% and restored deliverability to the forwarded cohort.

Best Practices: Keys, Selectors, and Preferred Signatures

Key management for Gmail alignment

  • Key length and algorithm: rsa-sha256, 2048-bit minimum; retire 1024-bit keys.
  • Selector naming: include org + date (e.g., org-s2025q1) for clarity across multiple signers.
  • Rotation cadence: every 6–12 months; rotate sooner if keys were shared with vendors.
  • Fallback strategy: run dual signing during rotation; keep old selector’s TXT for 48–72 hours after you stop using the key.

How DMARCReport helps:

  • DMARCReport identifies active selectors seen at Gmail and their pass/alignment rates so you can time decommissioning safely and confirm zero residual traffic before removing DNS.

Ensuring your preferred signature is considered

  • Always include an aligned signature with your brand domain; if multiple signatures exist, make your aligned signature the most resilient (2048-bit, relaxed/relaxed, comprehensive header list).
  • Avoid ESP-only signatures with d=vendor.com; if present, ensure they are additive, not substitutes.
  • Monitor Gmail alignment specifically; a pass from a non-aligned signature may mask breakage of your aligned key.

How DMARCReport helps:

  • DMARCReport reveals when Gmail is crediting a non-aligned signature for delivery, prompting you to correct signer configuration so DMARC alignment is anchored to your domain.
FAQs

FAQs

Should I use DMARC strict alignment (adkim=s) for Gmail?

Use strict alignment if you need the From domain to exactly match the DKIM d= domain for governance or anti-spoofing rigor. Most senders use relaxed (adkim=r) for operational resilience, especially when leveraging subdomains (e.g., mail.example.com) or multiple platforms. DMARCReport can show whether Gmail alignment materially differs between strict and relaxed simulations for your traffic.

Does canonicalization affect DMARC alignment?

Canonicalization affects whether the DKIM signature validates at all; alignment is purely domain matching between d= and From. However, choosing relaxed/relaxed helps the signature survive intermediaries, which indirectly improves DMARC alignment rates at Gmail. DMARCReport’s trend lines often show alignment gains after switching to relaxed canonicalization.

How do I handle forwarding that breaks DKIM?

Forwarders may alter content and invalidate DKIM. Options:

  • Sign with relaxed canonicalization and a robust header set.
  • Re-sign at the last hop you control.
  • Encourage trusted forwarders to implement ARC; Gmail may use ARC to inform delivery even if DMARC fails post-forwarding. DMARCReport will still show DMARC alignment outcomes so you can measure the residual breakage.

What if Gmail shows dkim=pass but DMARC=fail?

Check whether the passing DKIM signature is aligned. If d= doesn’t match the From domain (or its org domain under relaxed), DMARC will fail despite dkim=pass. Gmail’s Authentication-Results will show the d= domain; DMARCReport will flag policy_evaluated.dkim=fail with reason=“no aligned identifier”.

How long should I wait after publishing a new DKIM selector before switching traffic?

Wait until you can confirm:

  • Gmail “Show original” shows DKIM pass with the new selector.
  • DMARCReport shows Gmail aligned DKIM pass above 98% for the streams you migrated for at least 24 hours. Maintain dual signing during the transition and keep old DNS for 48–72 hours.

Conclusion: Verify, Monitor, and Sustain Gmail DKIM Alignment with DMARCReport

To verify DKIM alignment for Gmail, confirm in Gmail’s “Show original” that DKIM=pass for a signature whose d= aligns with the visible From, and that DMARC=pass is credited to DKIM; validate the selector’s DNS record and key strength; and test across all senders. From there, operationalize trust: configure each platform (Workspace, OpenDKIM, ESPs) to sign with your domain, choose relaxed/relaxed canonicalization with rsa-sha256 and 2048-bit keys, and mitigate breakage via re-signing and ARC where needed.

DMARCReport is the control tower that turns these checks into continuous assurance. It aggregates Gmail’s DMARC feedback, isolates aligned DKIM pass rates by selector, source, and IP, and alerts you when rotations, DNS errors, or vendor misconfigurations dent Gmail alignment. Use DMARCReport’s Gmail-focused views to validate changes within hours, maintain high alignment during key rotations, and ensure your brand’s aligned signature is the one Gmail trusts—message after message.

Similar Posts