What Is DKIM? Email Signatures, DNS Records, and Troubleshooting

By Dave TanguayPublished Editorial draft

Quick Answer

DKIM, or DomainKeys Identified Mail, adds a digital signature to an email. The sending service signs selected message content with a private key, and the receiver checks it using a public key available through DNS. Set up the provider’s exact DNS records, enable signing, and verify a received message. A valid DKIM signature identifies a signing domain and protects the signed content’s integrity; it does not encrypt the message, guarantee inbox delivery, or automatically establish DMARC alignment.

You can publish a DKIM record and still send messages without the intended signature. The DNS record and the sending service have different jobs. DNS makes a verification key available; the service must use the matching private key to sign outgoing mail.

This distinction is useful when mail works from one application but fails from another. Employee mail, website notifications, and newsletters may use different signing services and selectors. Our email authentication overview compares DKIM with the other checks.

How DKIM works

The sending system calculates a signature over selected message headers and body content, then adds a DKIM-Signature header. The receiving system uses the signature’s domain and selector to find the public key and verify the signed material. A change to signed content can invalidate the check.

The DKIM specification separates the signing organization from the message’s claimed author. A signature from a service’s domain can be valid even when the visible From address uses another domain. The receiver still has to decide what that signing identity means for the message.

DKIM does not hide the body or attachments from someone authorized to read the email. It also cannot establish that the sender’s offer, invoice, or link is trustworthy. Treat signing, transport protection, account security, and content review as different checks.

Understand domains and selectors

Two signature fields identify the key lookup:

d=
The signing domain associated with the signature.
s=
The selector identifying a particular key under that signing domain.

Consider this abbreviated teaching example. It contains no usable cryptographic signature:

DKIM-Signature: v=1; a=rsa-sha256;
 d=example.com; s=mail2026;
 [remaining signature fields omitted]

The corresponding lookup name is mail2026._domainkey.example.com. The selector allows multiple keys to coexist, which is useful when a business uses different services or rotates keys. A selector is not the mailbox name and is not necessarily default or google. Use the actual signature or sending-provider settings to find it.

For one provider-specific example, Salesforce explains finding a DKIM selector in message headers. The useful diagnostic habit is to record the selector from the affected message instead of guessing one from another service.

TXT records and CNAME delegation

A provider may ask you to publish a TXT value containing the public key. Another may supply CNAME records that point selector names to keys managed by that provider. Follow the supplied record type, name, and value exactly. A CNAME is an alias used to reach the verification key, not the private key itself.

Google Workspace’s DKIM setup process generates DNS information and then requires authentication to be started. Microsoft 365’s custom-domain DKIM instructions use provider-generated CNAME targets and an enablement step. Microsoft specifically directs administrators to obtain the actual values from the tenant rather than construct them from an example.

The authoritative DNS service may be different from the mail provider. If Cloudflare hosts the active zone, publishing a key only in an unused cPanel zone will not make that public record available. Our cPanel and Cloudflare guide covers this arrangement.

DNS interfaces differ in how they handle full names. Entering a full selector name into a field that appends the domain can create a doubled name. Long TXT values can also be displayed as multiple quoted strings. Check the resolved value and provider requirements before manually changing quotes or splitting the key.

Configure DKIM for a sender

  1. Confirm the sending service and domain. List the application, visible From domain, signing owner, and any separate subdomain. Do not assume the mailbox provider sends the website’s messages.
  2. Preserve the current setup. Save the existing selector records and provider settings before replacing or removing keys.
  3. Obtain exact values. Generate or retrieve the records from the service responsible for signing. Keep private keys out of DNS, support messages, public repositories, and blog examples.
  4. Publish at authoritative DNS. Use the correct selector, type, target or public-key value, and supported record handling.
  5. Complete provider verification and enable signing. Confirm the provider reports the intended domain enabled, not merely that a DNS lookup returned something.
  6. Test the real route. Send an authorized message through that service and check its signature and authentication result at the receiver.
  7. Record the outcome. Keep the domain, selector, service, time, destination, and result so another maintainer can distinguish an old key from a current one.

Use supported cryptography and provider-managed rotation where available. RFC 8301 recommends RSA keys of at least 2048 bits and prohibits the older SHA-1 signing algorithm. Other DKIM algorithms also exist; choose settings the sending service supports and maintain them according to current instructions.

Verify a received message

Inspect the full original message or the receiving provider’s authentication view. Record the DKIM result and the domain and selector associated with that result. A message can carry multiple signatures, so match the reported result to the intended signature rather than stopping at the first appearance of the word “pass.”

A read-only DNS query for the teaching selector could be Resolve-DnsName -Name mail2026._domainkey.example.com -Type TXT in Windows PowerShell, or dig TXT mail2026._domainkey.example.com where dig is installed. If the provider uses delegation, inspect the CNAME and its destination as needed. These example queries have not been run against your domain.

A successful lookup establishes that a key is available through that lookup path. It does not prove a particular application used the key. Google’s DKIM troubleshooting guide combines DNS checks with inspection of real message headers.

Use the results generated by the destination system, not a sender-supplied imitation of an Authentication-Results header. Keep full message contents and personal addresses private when asking for help. A redacted signature domain, selector, receiving-system result, message ID, and timestamp are a better starting point than an unprotected mailbox export.

Troubleshoot common failures

DKIM symptoms and focused checks
Symptom What to investigate
No intended signature Check the actual outbound service, domain eligibility, and whether signing was enabled. Publishing DNS alone is insufficient.
Selector or key not found Compare d= and s= from the message with authoritative DNS. Look for doubled domain names, deleted old selectors, or a wrong CNAME target.
Key is found but signature fails Check whether the signer and DNS key match, whether signed content changed in transit, and the receiver’s specific failure explanation.
Only some applications fail Map each application to its real sender and selector. A working staff mailbox does not verify a store or form sender.
Passes DKIM but fails DMARC Compare the passing signature’s signing domain with the visible From domain. Also inspect the SPF alignment path.

Make one explained correction at a time and retain the before-state. Deleting every old selector can break messages that were signed earlier or still use an older configuration. Changing SPF will not repair a signature mismatch.

Plan key rotation

Rotation changes which private key signs mail and which public key receivers need. The handoff must account for messages already signed, queued delivery, and cached DNS. Publish and verify the new selector before switching the signer when the provider’s procedure requires that order, then retain the old verification record for the provider’s recommended transition period.

Some services manage this process through delegated records. Amazon SES describes its signing options in its DKIM authentication documentation. Microsoft 365 uses two selectors to support its rotation process. Keep the records and procedure associated with the actual provider; copying another platform’s rotation steps can interrupt verification.

When retiring a service, confirm it no longer sends occasional messages before removing its delegation. Document the service owner and the reason for retirement so a future maintainer does not restore an obsolete sender accidentally.

Connect DKIM with DMARC

Suppose the visible From address is billing@example.com. A passing signature with d=example.com provides an aligned DKIM path. A valid signature with d=example.net does not align with that visible From domain. An aligned subdomain can qualify under relaxed alignment; strict alignment requires an exact match.

Our DMARC guide explains the policy and alignment rules. SPF provides a separate authentication path. Configure both where required by the receiving providers, while remembering that the protocol’s DMARC pass can come from one passing, aligned path.

Key Takeaways

  • DNS publishes access to a public verification key; the sending service must enable signing.
  • Use the real message’s signing domain and selector to investigate failures.
  • Configure each sending route and preserve keys through an orderly rotation.
  • A passing signature still needs the appropriate alignment for DMARC and does not guarantee delivery.

Frequently Asked Questions

Is a DKIM record enough to start signing?

No. Complete the sending provider’s setup and enable signing for the intended domain. Verify an actual received message afterward.

Can a domain have several DKIM records?

Yes. Different selectors can support different services or keys. Each selector must resolve in the way its provider requires; do not place conflicting record types at the same name.

Does DKIM encrypt email?

No. DKIM supplies a signature that a receiver can verify. It does not conceal the body or attachments.

Why can DKIM pass while DMARC fails?

The passing signature may use a domain that does not align with the visible From domain. Without another passing, aligned path, DMARC can still fail.

Will DKIM fix every spam-folder problem?

No. Authentication is one part of the receiving provider’s decision. Check the actual evidence with the business email troubleshooting guide.

If the affected mail comes from your website, bring the sending service, signature domain, selector, and non-sensitive error details to a website support inquiry. The form-delivery guide helps trace the earlier steps before mail reaches the receiver.

Archives