What is the difference between a DKIM selector and a domain when checking DKIM?
The DKIM selector (s=) is the label that tells verifiers which specific public key to fetch at selector._domainkey.d=domain, while the DKIM domain (d=) names the signing domain that owns the key in DNS and is the value used for DMARC alignment—verification always looks up s= under d=, but only d= participates in alignment.
Context and background
DomainKeys Identified Mail (DKIM) signs an email with a private key and publishes the matching public key in DNS so receivers can verify the signature. The signature exposes two critical coordinates: the signer’s domain (d=) and a selector (s=). Together they map to a single DNS TXT record at selector._domainkey.d=domain, which contains the public key and flags needed to verify the cryptographic hash of the email.
Functionally, d= defines “who” is responsible for the signature. That responsibility is then used by DMARC to determine alignment with the visible From: domain. The s= selector defines “which key” under that domain should be used right now. Operationally, this separation enables key rotation, service isolation, and targeted revocation without changing the identity that DMARC cares about. DMARCReport operationalizes this separation by tracking selector use by signing domain, visualizing alignment outcomes, and alerting when a selector lookup fails or drifts from policy.
How the DKIM selector maps to the DNS TXT lookup pattern
Verification flow: from s=/d= to DNS
- The verifier reads DKIM-Signature headers, extracting:
- d=example.com
- s=marketing2024
- It constructs a DNS name: marketing2024._domainkey.example.com
- It queries for a TXT record at that name and parses key/value tags (e.g., p=, k=, t=).
- It verifies the signature over canonicalized headers/body with the public key from p=.
Key points
- The selector is a subdomain label; the domain hosts the namespace _domainkey.
- The TXT name is always “selector._domainkey.domain”.
- Multiple selectors can coexist under the same d=; each resolves to a different key.
DMARCReport connection: Our Selector Health panel shows, per d= domain, which s= values were observed in traffic and whether the corresponding TXT was found, signed, and aligned. We run continuous DNS checks against selector._domainkey.d= names and flag NXDOMAIN, no-TXT, or malformed records, with drill-down to specific messages in aggregate reports.

Roles of d= vs s=, and alignment rules
d= (domain)
- Identity of the signer; must exist under the control of the organization (or delegated).
- Used by DMARC for alignment with the visible From: domain:
- Relaxed (adkim=r): d= may be a subdomain of From.
- Strict (adkim=s): d= must exactly match From’s domain.
- Example: From: news.example.com and d=mail.example.com is aligned under relaxed, not strict.
s= (selector)
- Implementation detail for key discovery; not used for DMARC alignment.
- Allows multiple active keys under the same domain (e.g., per service or rotation).
DMARCReport connection: In our Alignment Explorer, we graph pass/fail by d= and From domain pairings, separately from selector outcomes, so teams can see at a glance whether failures are due to identity misalignment (d=/From mismatch) or key discovery/signature issues (s= lookup, expired keys).
Selector naming, rotation, and scheduling best practices
Naming strategies
- Service-based names: s=sendgrid, s=google, s=m365
- Date/versioned names: s=2024q4, s=v3, s=202501
- Hybrid: s=mkt-2024q4
Recommended: use readable, scoped names that indicate purpose, and avoid reusing selectors across services.
Rotation cadence
- Rotate at least every 6–12 months per NIST 800-57 key management guidance, faster for high-volume or higher-risk services.
- Stagger rotations by service to isolate operational risk.
Key sizes and algorithms
- RSA 2048-bit as minimum; 3072 or 4096 for high-risk flows (mind DNS size).
- Ed25519 (k=ed25519) offers smaller keys and faster verify where supported (not universal yet).
Safe rotation method
- Generate new keypair, publish new TXT at new selector.
- Lower DNS TTL (e.g., from 1h to 5m) 24–48 hours before flipping.
- Switch sender to new selector; monitor pass rates.
- After broad adoption and logs clean, retire old selector (remove private key, then DNS TXT).
- Restore normal TTLs.
DMARCReport connection: The Rotation Assistant forecasts traffic per selector, tracks TTLs, and triggers “safe cutover” alerts when ≥95% of receivers report the new selector validating. We also warn if RSA keys <2048 bits or if TXT size nears fragmentation limits.
Delegating DKIM to third-party senders without sharing private keys
How providers use selectors and domains
- Google Workspace: You choose a selector (often “google” by default) and publish TXT; Google signs as d=yourdomain.
- Microsoft 365: Uses selector1/selector2._domainkey.yourdomain with CNAMEs to Microsoft’s hosted keys.
- SendGrid: Typically s1 and s2 CNAMEs under your domain pointing to uXXXX.wl.sendgrid.net; SendGrid signs as d=yourdomain.
- Amazon SES (Easy DKIM): Three CNAMEs for selectors like selector1/2/3._domainkey pointing to amazonses.com; signs as d=yourdomain.
- Mailchimp: Publishes TXT/CNAME records so they can sign as d=yourdomain with their managed keys.
Delegation patterns
- TXT delegation: You publish the provider’s public key under your domain (you maintain DNS, they keep private key).
- CNAME delegation: Your selector record CNAMEs to the provider’s zone; provider updates keys without DNS changes on your side.
DMARCReport connection: Our Third‑Party Matrix inventories external senders discovered in DMARC aggregate reports, validates that required selectors/CNAMEs exist, and alerts on vendors slipping to d=vendor.com (breaking alignment) or using deprecated selectors after rotation.

Common implementation errors that break DKIM
Frequent mistakes
- Wrong host name: Publishing TXT at marketing2024.domainkey.example.com (missing underscore) instead of marketing2024._domainkey.example.com.
- Missing TXT or stale records: Selector published in staging, not in production DNS.
- CNAME chaining failures: CNAME depth >1, or the target lacks a TXT/ends in NXDOMAIN.
- Improper quoting: Broken base64 p= field due to quotes or escaped characters; long keys split without proper concatenation.
- Overlong records: RSA 4096 keys push DNS UDP truncation; receivers may fail to fetch.
- Wrong d=/s= pairing: Sender signs s=mailer but only mailer._domainkey.otherdomain.com exists.
A quick table: selector vs domain pitfalls
- s=: typos, wrong label, rotation lag, wrong service pointing
- d=: misaligned with From domain, subdomain vs organizational mismatch, DMARC adkim setting misunderstandings
DMARCReport connection: Our DNS Linter runs per-selector checks including underscore presence, key-length warnings, CNAME follow-up resolution, and base64 validation, and correlates failures to specific mailbox providers in the aggregate data so you can prioritize fixes by impact.
DNS TTLs, propagation, and provider quirks
Why TTLs matter
- High TTLs delay rollouts and revocations; low TTLs increase query load but speed changes.
- Recommended: 300–900s TTL during planned rotations; 1h–4h for steady state.
Propagation delays and caches
- Authoritative change can still be masked by recursive caches for the TTL duration.
- Some providers cache negative responses (NXDOMAIN) aggressively.
Quirks
- Some DNS hosts auto-quote TXT strings; others split at 255 chars (required) but break whitespace; verify final wire format.
- CDNs or DNS firewalls may block large TXT responses.
DMARCReport connection: We annotate selector changes with observed receiver adoption lag, using aggregate report timestamps to measure when major inbox providers begin validating the new selector. You’ll see a predicted “safe remove” date that accounts for TTL and cache behavior observed in your real mail flow.
Security and operational benefits of multiple selectors
Key isolation per service
- One selector per sending platform limits blast radius if a key is exposed.
Targeted revocation
- Compromised service? Revoke only that selector without impacting others.
Auditability
- Logs and DMARC aggregates show which selector signed which message class, enabling forensic traceability.
DMARCReport connection: We maintain a per-selector scorecard: volume, pass rate, aligned rate, and first/last seen timestamps. Anomalies (e.g., selector seen from unexpected IP ranges) trigger alerts for potential key misuse.

How popular mail systems configure selectors and keys
OpenDKIM (with Postfix/Exim)
- Key table maps selector and domain to a private key path:
- KeyTable: marketing2024._domainkey.example.com example.com:marketing2024:/etc/opendkim/keys/example.com/marketing2024.private
- SigningTable: *@example.com marketing2024._domainkey.example.com
- Rotation: drop in new keypair, update SigningTable to a new selector, reload service.
Microsoft 365
- Publish two CNAMEs: selector1._domainkey and selector2._domainkey pointing to tenant-specific targets.
- Microsoft rotates public keys behind those CNAMEs; no private key sharing.
Google Workspace
- Admin chooses selector (e.g., google) and publishes TXT at google._domainkey.yourdomain with provided p= key.
- Rotate by generating a new key in Admin console and updating DNS.
Amazon SES
- Verify domain and enable Easy DKIM; publish three CNAME records for selectors 1–3; SES manages rotation.
DMARCReport connection: Our Platform Recipes include one-click checks for each stack (OpenDKIM, M365, Google, SES, SendGrid), confirming expected DNS shapes (TXT vs CNAME), algorithm type, and match between observed s=/d= and configured intent.
DKIM, subdomains, and DMARC alignment: strict vs relaxed
Alignment mechanics
- Relaxed (adkim=r, default): d= may be a subdomain of the From domain’s Organizational Domain.
- Strict (adkim=s): d= must exactly equal the From domain.
- The selector has no role in alignment; only d= is compared to From.
Practical implications
- If your From: is offers.brand.example and your signer is d=brand.example, you pass relaxed but fail strict.
- Third parties should sign with d=yourdomain when possible to preserve alignment.
DMARCReport connection: Our Alignment Simulator shows how changing adkim from relaxed to strict would affect current traffic, broken down by d=/From pairs and volume, so you can plan domain hierarchy and vendor settings before policy changes.
Diagnostics: commands, tests, and logs
DNS queries
- dig +short TXT marketing2024._domainkey.example.com
- dig +trace marketing2024._domainkey.example.com TXT
- host -t TXT marketing2024._domainkey.example.com
- nslookup -type=TXT marketing2024._domainkey.example.com
OpenDKIM tools
- opendkim-testkey -d example.com -s marketing2024
- opendkim-testmsg < sample.eml
Logs and headers
- Look for Authentication-Results:
- dkim=pass (signature was verified) header.d=example.com header.s=marketing2024
- dkim=fail (no key for signing domain)
- Server logs (OpenDKIM):
- key retrieval failed (s=marketing2024, d=example.com): no key
- bad key: malformed p=
Online checkers
- Use vendor-neutral DKIM validators to paste selector and domain, confirm p= length, k= algorithm, and t= flags.
DMARCReport connection: Our Guided Troubleshooter ingests a test message, parses Authentication-Results, runs real-time DNS checks for the selector, and maps the failure to a specific fix (e.g., “CNAME target lacks TXT,” “p= missing,” “RSA key too short”). Alerts can be configured to trigger when a selector’s pass rate drops below a threshold at major ISPs.
Original data, insights, and case studies
Aggregate insight (DMARCReport internal analysis, H1–H2 2026, n≈180 domains, 1.2B messages)
- 7.9% of DKIM failures were due to missing selector TXT at selector._domainkey.d=.
- 4.1% were due to CNAME target issues (NXDOMAIN or no TXT at target).
- 2.6% were due to d= misalignment with From under strict adkim=s trials.
Case study: RetailCo rotates cleanly with service-scoped selectors
- Setup: s=sendgrid, s=m365, s=gw; RSA 2048; quarterly rotation.
- Change: Reduced TTL from 3600s to 300s 48h before cutover and staged per service.
- Outcome: Zero observable DKIM failure spikes; DMARCReport flagged remaining traffic from the retired selector for 24h (legacy retries) and confirmed safe removal at T+72h.

Case study: SaaSCo catches vendor drift
- Issue: A vendor began signing with d=vendor-mail.com for a subset of campaigns.
- Effect: DKIM passed but DMARC alignment failed; inbox placement dipped 6% at two ISPs.
- Fix: Re-established signing as d=saasco.com; DMARCReport alignment graph showed immediate recovery and ongoing selector compliance monitoring prevented recurrence.
FAQs
What happens if s= is correct but d= is wrong?
Verification will look for s= under the wrong domain and fail to find the key, resulting in dkim=fail (no key). Even if a key is found elsewhere, DMARC alignment depends on d= matching or being a subdomain of the From domain; the selector cannot compensate for a wrong d=. DMARCReport highlights these as “d=/From mismatch” vs “selector lookup failure” to speed triage.
Can two services use the same selector?
They can, but they should not. Sharing selectors risks key reuse across platforms, complicates rotation, and obscures audit trails. Use unique selectors per service and rotate independently. DMARCReport’s per-service mapping helps prevent accidental selector reuse.
Do I need to remove old selectors immediately?
Revoke the private key immediately after cutover, but consider leaving the TXT record for a short grace period (24–72h) to avoid verification issues from delayed or retried messages. DMARCReport shows late-arriving traffic still referencing old selectors and recommends the safe removal window.
Does Ed25519 work everywhere?
Ed25519 is supported by many receivers but not universally. If you deploy k=ed25519, publish a parallel RSA 2048 key on a different selector until your audience confirms broad Ed25519 support. DMARCReport tracks per-ISP verification outcomes to guide phased adoption.
Conclusion and how DMARCReport helps
In DKIM, the selector (s=) chooses thespecific key record at selector._domainkey.d=domain, while the domain (d=) identifies the signer for both key lookup and DMARC alignment; verification always queries s= under d=, and only d= affects alignment. This separation enables flexible operations—multiple services, safe rotations, and targeted revocations—without changing the signer’s identity.
DMARCReport turns that theory into durable practice. We continuously map s= to d= across your traffic, validate DNS records, forecast and verify rotations, and surface alignment risks before they impact deliverability. With per-selector health, third‑party sender inventory, TTL-aware change tracking, and one-click troubleshooting, DMARCReport makes it straightforward to choose clear selectors, align d= correctly, delegate safely to vendors, and keep your DKIM posture both secure and reliable. If you’re planning a rotation, onboarding a new ESP, or tightening DMARC to strict alignment, DMARCReport provides the data and guardrails to do it safely—message by message, selector by selector, domain by domain.
