DKIM is the part of email authentication that people find hardest to check, for a simple reason: unlike SPF or DMARC, there is no fixed place to look. The public key lives at a name that includes a selector, and the selector can be almost any word the email provider chose. Ask "does example.com have DKIM?" and the honest answer is "which selector?".
This guide explains how DKIM signing works, how to find the selector a domain actually uses, how to read the key record in DNS, and what to do when the key is missing, too short or revoked.
How DKIM works in one minute
When a mail server sends a message, it signs selected headers and the body with a private key and adds a DKIM-Signature header. Two tags in that header matter for lookup:
d=is the signing domain, for exampleexample.com.s=is the selector, for exampleselector1ormail2026.
The receiver builds the DNS name s._domainkey.d, here selector1._domainkey.example.com, fetches the TXT record there and uses the public key in it to verify the signature. If the message was altered in transit or the key does not match, DKIM fails.
Selectors exist so a domain can have several keys at once: one per sending service, and a new one during key rotation while the old one is still in use.
A typical key record looks like this:
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
| Tag | Meaning |
|---|---|
v |
Version, DKIM1; optional but must come first if present |
k |
Key type, rsa (default) or ed25519 |
p |
Base64 public key; an empty p= means the key is revoked |
t |
Flags: y means testing mode, s means strict subdomain matching |
h |
Allowed hash algorithms, for example sha256 |
How to find the selector
The reliable way is to read it from a real message:
- Send yourself an email from the domain or service you want to check.
- Open the full headers. In Gmail use Show original; in Outlook open the message properties or "View message source"; other clients have a similar option.
- Find the line starting
DKIM-Signature:and read thes=andd=values.
Some messages carry two signatures, for example one from your domain and one from the sending platform's own domain. The one whose d= matches your From domain is the one that counts for DMARC.
If you cannot get a message, try the common defaults. Some widely seen examples are google for Google Workspace and selector1 / selector2 for Microsoft 365, but providers and configurations differ, so treat any guess as unconfirmed until you see it in a header.
Check a DKIM key with our tool
The DKIM Checker queries Cloudflare DNS and parses the key for you.
- Open the DKIM Checker and enter the domain, for example
example.com. - Type the selector into the Selector field and click Check DKIM. You can also paste a full name such as
selector1._domainkey.example.cominto the domain box and the tool splits it for you. - If you do not know the selector, click Try common selectors. The tool tries a list of frequently used names and shows each one it finds as a button you can switch between.
- Read the badge: Valid key, Valid with warnings or Problem.
- Review the findings and the tag table. The table shows each tag's meaning and, for RSA keys, the measured Key length in bits.
- If the name is a CNAME, the tool shows where it points. That usually means your email provider hosts and rotates the key for you.
Other ways to check DKIM
From a terminal:
dig +short TXT selector1._domainkey.example.com
nslookup -type=txt selector1._domainkey.example.com
This returns the raw record, often split into several quoted strings. It does not tell you the key length or whether the base64 is valid. You can decode the key with OpenSSL if you paste it into a PEM file, which works but takes a few steps.
The most complete test is the one receivers do: send a message to a mailbox you control and read the Authentication-Results header, which shows dkim=pass or dkim=fail with a reason. That confirms the private key actually matches, something no DNS lookup can prove.
Problems and fixes
No record at the selector
Check the spelling of the selector and the domain. A frequent cause is DNS panels that automatically append the zone name, turning selector1._domainkey into selector1._domainkey.example.com.example.com. Look up the exact name to confirm, or check the zone with the TXT Record Lookup.
Key shorter than 2048 bits
The checker marks keys under 1024 bits as failures and 1024-bit keys as a legacy minimum. Generate a 2048-bit key in your provider's admin panel, publish it under a new selector, switch signing to it, and remove the old record after a few days.
Key too long for the DNS panel
A 2048-bit key is longer than 255 characters, the maximum for one TXT string. DNS stores it as several strings that receivers join together. Most providers split it automatically; some require you to paste it in quoted chunks. If verification fails after publishing, compare the stored value with the original character by character.
Empty p= (revoked key)
An empty p= tells receivers the key has been withdrawn on purpose. If mail is still being signed with that selector, it will fail. Either publish the current key or change the sender to a live selector.
Testing flag left on
t=y tells receivers the domain is testing DKIM, and some treat such signatures as if they were absent. Remove it once signing works.
Where DKIM fits
DKIM alone does not tell receivers what to do with failing mail; DMARC does. Once your keys are healthy, check your policy with the DMARC Checker and read how to move DMARC from p=none to p=reject. Keep SPF tidy with the SPF Record Checker as a second path to a DMARC pass.
Frequently asked questions
Can I find a domain's DKIM selector from DNS alone?
Not reliably. DNS has no index of selectors, so you either read s= from a signed message or guess common names. The "Try common selectors" button automates the guessing but cannot find custom names.
Is a 1024-bit DKIM key still acceptable?
It still verifies at most receivers, but 2048-bit keys are the current recommendation. Rotate to 2048 bits when your provider supports it.
Can a domain have more than one DKIM key?
Yes. Each selector is a separate key, so a domain can have one per sending service and extra ones during rotation.
Why does my DKIM record show as a CNAME?
Some providers ask you to point selector._domainkey at a record on their domain. They then host the key and can rotate it without you editing DNS again.
What does dkim=fail with body hash did not verify mean?
The message body changed after signing, often because a gateway, disclaimer tool or mailing list modified it. The DNS key is usually fine in that case.