Skip to content
DMARC Pulse

Salesforce

Salesforce DKIM: create the key, add CNAMEs and activate

Salesforce DKIM setup: create the key in Setup, publish its two CNAME records, activate it, and fix a greyed-out Activate button.

Before you start

Salesforce DKIM is set up on the DKIM Keys page in Setup: create a key, add the two CNAME records Salesforce generates, then click Activate. DKIM (DomainKeys Identified Mail) signs each message so receiving servers can check that it came from your domain and wasn't altered.

  • Access. You need the Customize Application permission and edit rights on the domain's DNS zone. Salesforce says it can't directly support the DNS part.
  • Domains. Create one key per domain and subdomain you send from. The key's domain must match the entire From domain.
  • How the mail leaves. The key signs mail sent through Salesforce. Salesforce says Send through Gmail and Send through Office 365 need no separate DKIM setup. Marketing Cloud and Account Engagement (Pardot) have separate documentation.

Salesforce now fails delivery when the sending domain isn't verified, and an active DKIM key verifies it.

Steps

Create DKIM keys in Salesforce

  1. In Setup, use Quick Find to select DKIM Keys, then click Create New Key.
  2. Set RSA key size to 2048-bit, as RFC 8301 recommends.
  3. In Selector, enter a DKIM selector of up to 62 letters, digits and hyphens, starting with a letter or number. Enter a different one in Alternate Selector.
  4. In Domain, enter your From domain, such as example.com, and avoid your org's My Domain name. You can't edit this after saving.
  5. In Domain Match Pattern, enter the same domain. Salesforce advises against wildcards for domains you own.
  6. Click Save. Salesforce hosts the public keys itself and generates your CNAME records, usually within 15 minutes.

Publish the CNAME records

  1. In DKIM Keys, click the key's selector. If TXT Record Status shows Publishing in progress, wait a few minutes.

  2. Check the format your DNS host expects. If it appends your domain, enter only myselector._domainkey. Make sure each name is free: a CNAME can't share its name with another record. If the name is in use, leave it alone and create a key with another selector.

  3. Add the CNAME Record and Alternate CNAME Record at your DNS host, using the values on that page:

    Host Type Value
    myselector._domainkey.example.com CNAME myselector.XXXXXX.custdkim.salesforce.com
    myalternate._domainkey.example.com CNAME myalternate.XXXXXX.custdkim.salesforce.com

    XXXXXX is a code Salesforce generates.

On Cloudflare, make sure neither record is Proxied.

Caution: a CNAME can't share its name with another record. If the name is in use, leave it alone and create a key with another selector.

Activate the key

  1. Wait for DNS to update, which can take up to 72 hours.
  2. Reload DKIM Key Details, which doesn't refresh itself. A green circle with a white checkmark and a confirmation message means the key is ready.
  3. In DKIM Keys, click Edit for the key, then Activate and OK. Salesforce starts signing mail from the domain.

Salesforce rotates the key every 30 days without action from you. Leave both CNAME records in place, because a receiver that finds no key fails the signature.

Confirm it worked

  1. Enter your domain and selector in the DKIM checker, or run nslookup -type=TXT myselector._domainkey.example.com 1.1.1.1. A good answer shows your CNAME, then a TXT record with the public key. A lookup can return only the key active in the rotation, so check the other selector too.
  2. Send a message from production to a mailbox at another provider.
  3. Paste the headers into the Email Header Analyzer. You want dkim=pass with header.d= on your From domain.

Common problems

Activate stays greyed out. Salesforce enables it only after both CNAME records resolve correctly. Look for a proxied CNAME, another record on the same name, a key created for a different domain or a reused selector.

DKIM passes and DMARC fails. Salesforce says alignment fails when the key's Domain doesn't match the From domain, and RFC 9989 counts only an aligned signing domain. Create a new key for the right domain. See also SPF for Salesforce.

Not allowed to send from an unauthorized domain. Email Composer shows this when the domain isn't verified. For automations, search your email logs for 550 5.7.1 Delivery not authorized, message discarded. Activate a key for that domain or set up an authorized email domain.

A relay breaks the signature. Salesforce says a relay can alter signed headers, and it suggests deactivating the key and relying on the relay's DKIM. Caution: confirm the relay signs your domain first. The verification rule applies to email relay, so set up an authorized email domain before you deactivate, or delivery can fail.

Check it now

Find and validate DKIM keys

Frequently asked questions

Where do I create DKIM keys in Salesforce?
In Setup, use Quick Find to select DKIM Keys, then click Create New Key. You need the Customize Application permission to manage DKIM keys.
Why is the Activate button greyed out?
Salesforce keeps it disabled until it recognizes the correct CNAME records in DNS. DNS changes can take up to 72 hours. Reload the DKIM Key Details page, then check that both records resolve and that neither is proxied.
Do I need to rotate Salesforce DKIM keys myself?
No. Salesforce rotates the key every 30 days, and it says no further action is required after you activate it. Leave both CNAME records in place.
Is a DKIM key required to send email from Salesforce?
Salesforce requires each sending domain to be verified, and delivery fails if it is not. An active DKIM key satisfies this. A verified authorized email domain is the alternative. Mail sent through the Gmail and Office 365 integrations is exempt.
Do I need a separate DKIM key for each subdomain?
Yes. Salesforce says to create a separate DKIM key for each domain and subdomain, and the key's domain must match the entire domain in the From address.
Can I copy a DKIM key from production to a sandbox?
No. Salesforce says you can't copy a DKIM key to a sandbox, and keys created in a sandbox have to be recreated after a refresh.

Sources consulted

RFC 6376 §3.6.2.1 Namespace
checked 2026-11-09
RFC 8301 §3.2 Key Sizes
checked 2026-11-09
RFC 8601 §2.7.1 DKIM
checked 2026-11-09

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.