The DNS records
Salesforce's example for the domain example.com, with selectors example-sf-a and example-sf-b. The token in each target differs per key, so copy both values from the DKIM Key Details page.
CNAME Record (primary selector)
Type: CNAME · Host: example-sf-a._domainkey
example-sf-a.k4tyd2.custdkim.salesforce.com.
Alternate CNAME Record
Type: CNAME · Host: example-sf-b._domainkey
example-sf-b.e6mxu6.custdkim.salesforce.com.
Salesforce uses the alternate selector to rotate keys automatically, so publish both.
Set it up and turn on signing
- From Setup, type DKIM Keys in the Quick Find box, open DKIM Keys and click Create New Key. The new key starts as Inactive.
- Choose the RSA key size (Salesforce says 2048-bit unless an application needs smaller keys). Enter a selector and an alternate selector: up to 62 letters, digits and hyphens each, unique for the domain.
- Enter the domain and a domain match pattern, such as
example.comfor both. Salesforce no longer recommends wildcards in the pattern, and you can't edit the domain after saving. - Wait for the CNAME values (usually within 15 minutes; reload if the page says Publishing in progress), then add both records at your DNS host.
- When the DKIM Key Details page shows a green checkmark, go back to DKIM Keys, click Edit, then Activate and OK. The button stays disabled until Salesforce sees the CNAMEs; DNS can take up to 72 hours.
DMARC alignment
Salesforce signs a message only when an active key's domain matches the entire domain in the From address, so a key for example.com doesn't cover mail.example.com: each domain and subdomain needs its own key. When the signature is added, d= is that From domain, which aligns for DMARC. An active key also counts as verifying the sending domain under Salesforce's email requirements. If several active keys match, the longest domain match pattern wins.
Key length and rotation
Salesforce rotates DKIM keys every 30 days. On day 25 it creates the alternate key and publishes it behind the alternate CNAME; on day 30 that key starts signing. After activation, no further action is needed. Keys can't be copied into a sandbox, so recreate them there after a refresh. Marketing Cloud is a separate product with its own setup, through its Sender Authentication Package or Private Domain add-on, not through Setup > DKIM Keys.
Common mistakes
- Publishing only one CNAME. Activation and rotation need both the primary and the alternate record.
- The root domain doubled, or two trailing dots, in the host or target. Salesforce lists both as common reasons activation fails.
- A CNAME on the wrong subdomain. The record must sit under the exact domain the key was created for.
- One key for every subdomain. The From domain must match the key's domain exactly, so create a key per sending subdomain.
Check your Salesforce DKIM key
Enter your domain and the selector from your Salesforce account. Free, reads public DNS only.
Frequently asked questions
Why is the Activate button greyed out for my Salesforce DKIM key?
Salesforce keeps it disabled until it can see both CNAME records in DNS. Check that both are published under the right domain without the domain doubled, wait for the green checkmark on the key details page, then activate.
How often does Salesforce rotate DKIM keys?
Every 30 days. Salesforce publishes the next key behind your alternate CNAME on day 25 and switches signing to it on day 30. Because both records are CNAMEs, you don't change DNS for a rotation.
Does one Salesforce DKIM key cover my subdomains?
No. The key's domain must match the entire From domain, so mail from support.example.com needs its own key and its own two CNAMEs, separate from the key for example.com.
Sources
- Salesforce Help: Create a DKIM key
- Salesforce Help: Considerations for DKIM keys
- Salesforce Help: Activate a DKIM key
- Salesforce Help: Best practices to set up DKIM
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
- RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM
Checked against Salesforce's documentation on October 9, 2026. Providers change their setup screens; if yours differs, follow the values your admin console shows.
DKIM records for other providers
- Microsoft 365CNAME: selector1, selector2
- Google WorkspaceTXT: google
- Zoho MailTXT: you choose (e.g. zoho)
- GoDaddyCNAME: secureserver1, secureserver2
- FastmailCNAME: fm1, fm2, fm3
- Proton MailCNAME: protonmail, protonmail2, protonmail3
- Amazon SESCNAME or TXT: <token1>, <token2>, <token3> (Easy DKIM), your own (BYODKIM)
- SendGridCNAME or TXT: s1, s2
- MailgunTXT or CNAME: assigned by Mailgun (e.g. pic, krs, smtp), pdk1, pdk2 (Automatic Sender Security)
- PostmarkTXT: <timestamp>pm (e.g. 20131031155228pm)
- MailchimpCNAME: k2 and a second CNAME (Marketing), mte1, mte2 (Transactional)
- BrevoTXT or CNAME: mail (TXT), 2 CNAMEs from your account
- HubSpotCNAME: hs1-<number>, hs2-<number>
- KlaviyoCNAME: km1, km2 (marketing), kt1, kt2 (transactional), ks1, ks2 (service)
- ZendeskCNAME: zendesk1, zendesk2
Compare every provider's selectors in one table · SPF record for Salesforce
Related guides
How to find a domain's DKIM selector, and check its key
Find a DKIM selector from the s= tag in an email header, see the selectors Microsoft 365, Google Workspace and common senders use, then check the key.
8 min read SPF, DKIM & DMARCHow to rotate DKIM keys without breaking email
How often to rotate DKIM keys, which key length to use, how to name selectors, and how to rotate in Microsoft 365, Google Workspace and on your own server.
9 min read SPF, DKIM & DMARCDKIM "body hash did not verify" and other DKIM failures: causes and fixes
Fix DKIM failures: body hash did not verify, signature did not verify, no key for signature and short keys. Causes from mailing lists to broken TXT records.
9 min readLast updated