DKIMEmail authentication explained

What is DKIM?

DKIM (DomainKeys Identified Mail) signs every outgoing message with a private key and publishes the matching public key in DNS at <selector>._domainkey.<domain>. The receiving server reads the selector and domain from the DKIM-Signature header, fetches the key and checks that the signed headers and body arrived unchanged. A pass proves the domain in d= sent the message.

How it looks in DNS

TXT
Name
google._domainkey
Value
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu...IDAQAB

Google Workspace's default selector with a 2048-bit RSA key (shortened); the signing server keeps the private half

Part by part

The DKIM record taken apart

The example above, left to right. Every part is something a receiving server reads.

TXT at google._domainkey

google._domainkeyv=DKIM1k=rsap=MIIBIjAN…IDAQAB

  1. google._domainkeyWhere the key lives: the selector (google), then _domainkey, under your domain. Each sending service has its own selector
  2. v=DKIM1Version of the key record. Recommended; if present it must come first
  3. k=rsaKey type. rsa is the default; ed25519 is the newer, shorter alternative from RFC 8463
  4. p=MIIBIjAN…IDAQABThe public key, base64. An empty p= means the key is revoked and every signature with this selector fails

Look up the DKIM record of any domain

The same check as our DKIM checker: the record is read live from DNS in your browser and every part is explained. Try your own domain, or a big sender to see a working record.

Try

Without a selector the checker tries the ones providers document and other common names. Lookups go from your browser to Cloudflare's public DNS resolver.

  • Selectors Google, Microsoft, SendGrid and others document
  • Key length read from the published key
  • Who hosts each key, from its CNAME
  • Where to generate a new key for your provider

How it works

How a DKIM signature is made and checked

  1. The sender signssource (opens the vendor's page in a new tab)

    The sending server hashes the body (bh=), signs the chosen headers with its private key (b=) and adds a DKIM-Signature header naming the domain (d=) and the selector (s=)

  2. The receiver finds the keysource (opens the vendor's page in a new tab)

    It queries TXT at <s>._domainkey.<d>, such as selector1._domainkey.example.com

  3. It checks the hashessource (opens the vendor's page in a new tab)

    It normalises the headers and body (simple or relaxed canonicalization), recomputes the body hash and verifies the signature with the public key

  4. It records the resultsource (opens the vendor's page in a new tab)

    dkim=pass, fail, or neutral and temperror when the key is missing or DNS fails; a message can carry several signatures

  5. DMARC checks the domainsource (opens the vendor's page in a new tab)

    A DKIM pass counts for DMARC when d= matches the From domain: the same organizational domain (relaxed) or the exact name (strict)

DKIM is the record that survives forwarding. SPF breaks when a message is relayed, because the forwarding server is not on your list; a DKIM signature still verifies as long as the signed headers and body are intact. That makes an aligned DKIM signature the most reliable way to pass DMARC.

You rarely write the key yourself. Each sending service generates it and either shows a TXT value to paste or asks for CNAME records that point to a key it hosts and rotates (Microsoft 365, SendGrid, Mailchimp, Amazon SES). The selector is how several services sign for the same domain without clashing: Microsoft 365 uses selector1 and selector2, Google Workspace uses google, Postmark a timestamp ending in pm.

A DKIM checker needs the selector, because DNS cannot list every name under _domainkey. The DKIM checker tries the selectors of common providers; the selector of any message is in its DKIM-Signature header as s=.

Reference

DKIM-Signature header tags

  • v=Required:YesVersion, always 1
  • a=Required:YesSigning algorithm: rsa-sha256, or ed25519-sha256 (RFC 8463); rsa-sha1 must no longer be used
  • d=Required:YesThe signing domain; DMARC compares it with the From domain
  • s=Required:YesThe selector: the key is at <s>._domainkey.<d>
  • h=Required:YesThe signed header fields, colon-separated; From must be one of them
  • bh=Required:YesHash of the canonicalized body
  • b=Required:YesThe signature itself, base64
  • c=Required:NoCanonicalization for header/body: simple (default) or relaxed, which tolerates whitespace changes
  • l=Required:NoBody length signed; risky, because content appended after it is not covered
  • t= / x=Required:NoSigning time and expiry

Sourcesource (opens the vendor's page in a new tab)

Rules and limits

What receivers enforce on DKIM

Troubleshooting

Common DKIM errors and fixes

For cold email

Mailboxes that come with the DNS records done

Outreach2day buys the domains, publishes SPF, DKIM and DMARC, creates the mailboxes and starts warmup, then sends your campaigns from its own sequencer or exports the mailboxes to Instantly or Smartlead.

  • SPF, DKIM and DMARC set for youOn every domain, checked after setup and kept in place
  • $2.50 a mailbox a month12-mailbox minimum; warmup and the sending engine included
  • 1,000+ mailboxesA volume price per mailbox, quoted on a call

Questions

What does a DKIM record look like?

A TXT record at <selector>._domainkey.<domain> with a value such as v=DKIM1; k=rsa; p=<public key>. Many providers instead ask for a CNAME at that name pointing to a key they host, so they can rotate it for you.

What is a DKIM selector?

The label before ._domainkey that tells a receiver which key to fetch. Each service that signs for your domain uses its own selector (google, selector1, k2, s1), so their keys never collide. It is in every signed message as s=.

Should a DKIM key be 1024 or 2048 bits?

2048. RFC 8301 says signers should use at least 2048-bit RSA keys, and Google recommends 2048. Use 1024 only if your DNS host truly cannot store the longer value.

What is the difference between DKIM and SPF?

SPF lists the servers allowed to send for the envelope domain; DKIM signs each message so the content and the signing domain can be verified. DKIM survives forwarding and SPF does not, and DMARC accepts either one if it aligns with the From domain.

How do I find the DKIM selector of a domain?

Open a message from that domain, show the original or raw headers and read s= in the DKIM-Signature header. The checker above also tries the selectors that common providers use.

Deliverability call

Talk to our deliverability team

Book a call with the people who run our mailbox infrastructure. We look at your current setup and tell you what to change. Running 1,000+ mailboxes? We also quote a volume price below every vendor list price in our comparisons, warmup and sending included.

  • Review your domains, DNS records and current inbox placement
  • Size the setup: domains, mailboxes per domain and daily volume per mailbox
  • Plan warmup and the move from your current provider or sequencer
  • 1,000+ mailboxes: a volume price per mailbox for your setup

Free call

See open times in your time zone and book on this page.

Or open the booking page