DKIM Record Syntax, Selectors & 2048-Bit Key Rotation

How DKIM cryptographic signatures survive email forwarding, why 2048-bit keys need 255-byte TXT chunking, and how to rotate keys with zero downtime.

RFC 63762048-bit RSA255-Byte Chunking

Copy-Ready DNS Records & Configuration

Host / NameTypeValueTTLPurpose
s2026._domainkey TXT v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A... 3600 2048-bit RSA public key (split into 2 quoted strings in BIND)
selector1._domainkey CNAME selector1.domainkey.provider.example.com 3600 CNAME delegation for automatic provider-managed rotation
revoked._domainkey TXT v=DKIM1; p= 3600 Empty p= tag explicitly revokes a retired/compromised selector

Interactive SPF, DKIM, DMARC & CAA Record Builder

Select Email Providers (Lookup Weight Shown)

1. SPF TXT Record (Host: @)


      
2. DMARC TXT Record (Host: _dmarc)


      
3. DKIM TXT Record Template


      
4. Complete BIND Zone Snippet (SPF + DMARC + CAA)

    

Step-by-Step Deployment Checklist

  1. Choose descriptive, date-stamped selectors (e.g. `s202601` or `google`, `resend`) so multiple ESPs can sign mail for the same domain simultaneously.
  2. Generate a **2048-bit RSA** key (or dual RSA + Ed25519) — 1024-bit keys are increasingly flagged as weak by enterprise receivers.
  3. For zero-downtime rotation: publish the new selector DNS record first, wait 2× TTL, switch your mail server to sign with the new selector, and keep the old DNS record live for 7 days for in-flight mail.
  4. To revoke a compromised key immediately, replace its TXT value with `v=DKIM1; p=` (empty public key).

Common Pitfalls to Avoid

JetBrains Plugin + Gumroad

Never Commit SMTP Passwords, DKIM Private Keys, or API Secrets to Git

EnvGuard for JetBrains IDEs scans .env, YAML, and DNS config files locally before commit — paired with our DevOps & AI Automation Kits on Gumroad.

Frequently Asked Questions

How many DKIM records can one domain have?

Unlimited! Unlike SPF (limited to 1 record per hostname), each ESP uses its own unique `<selector>._domainkey` subdomain, so you can safely publish 10+ DKIM selectors.

Why do 2048-bit DKIM keys exceed 255 characters?

A 2048-bit RSA public key is ~392 base64 characters. Per RFC 1035, a single DNS TXT string maxes out at 255 octets, so BIND and Route 53 require splitting it into two adjacent quoted strings (Cloudflare splits automatically).

Does DKIM survive email forwarding?

Yes — unlike SPF (which breaks when a server forwards mail from a new IP), DKIM signs the message headers and body hash, so it stays valid across standard forwarding.

Related DNS & Email Auth Guides