DKIM check: is my signing key published, and is it any good?
DKIM is a digital signature added to every message you send. The receiver fetches your public key from DNS and checks the signature against it, which proves the message was not changed on the way and that your domain's key signed it. This page finds the key, tells you in plain words whether it is sound, and reads the DKIM signature from a real message so you can see what is actually happening.
Look up a DKIM key
A DKIM key is found by its selector, a name you cannot work out from the domain. If you leave it empty we try about forty names that real senders use. If you know it, enter it for a precise answer. Only the domain and selector are looked up in DNS.
Read a message header
The surest way to know which key is in use is to look at a message you actually sent. Open it in a mail app that can show the original source (in Gmail: open the message, choose the ⋮ menu, then Show original), copy the header, and paste it here. It is read entirely in your browser; nothing you paste is sent anywhere. We only look up a key if you click the button on a result.
How DKIM works, in six steps
- You generate a pair of keys. The private key stays with whatever sends your mail (your provider or your server). The public key goes in your DNS.
- The public key is published as a TXT record at
selector._domainkey.yourdomain.com. The selector is just a label, so you can have several keys at once. - When a message is sent, the sender signs chosen headers and the body with the private key and adds a
DKIM-Signatureheader. It names the signing domain (d=) and the selector (s=). - The receiver reads
d=ands=, looks ups._domainkey.din DNS, and checks the signature with that public key. - If the signature matches, the result is pass: the message is intact and was signed by someone holding the domain's key.
- DMARC then asks whether the signing domain lines up with the visible From address. A valid signature from a different domain proves nothing about the From address.
Where to find your selector
Your email provider's DKIM page always shows the exact name and record; it is the authority. These are the names these services usually use, taken from what real senders publish in DNS.
| Service | Selector names you will usually see | Notes |
|---|---|---|
| Google Workspace | google | The default; you can pick another name when you generate the key. |
| Microsoft 365 | selector1, selector2 | Both are CNAME records pointing into your onmicrosoft.com domain, which lets Microsoft rotate the keys. |
| Mailchimp / Mandrill | k1, k2, k3; mandrill | Mailchimp sets up its selectors as CNAMEs. |
| SendGrid | s1, s2 | CNAMEs to SendGrid. Older setups used smtpapi. |
| Zendesk | zendesk1, zendesk2 | CNAMEs. |
| HubSpot | hs1, hs2 | CNAMEs to HubSpot. |
| Brevo (Sendinblue) | brevo1, brevo2; older mail | |
| Proton Mail | protonmail, protonmail2, protonmail3 | CNAMEs. |
| Fastmail | fm1, fm2, fm3 | CNAMEs. |
| Amazon SES | Three random strings | Cannot be guessed. Copy the three CNAME records from the SES console. |
| Postmark and others | Chosen by the service | Often a long number or a name that includes the date. Read it from the dashboard. |
| Your own mail server | default, mail, or any name you choose | Whatever your signing software is configured to use. |
If you are not sure, send yourself a message and use the header reader above: the s= value is the selector, with no guessing.
What every part of a DKIM record means
A DKIM record is a list of tag=value pairs separated by semicolons, for example v=DKIM1; k=rsa; p=MIIBIjANBgkq.... Only p= is required.
| Tag | Meaning | Values |
|---|---|---|
v= | Version. Recommended; if present it must be the first tag and must be exactly DKIM1. A record with any other version is discarded. | DKIM1 |
k= | Key type. Defaults to rsa if left out. | rsa, ed25519 |
p= | The public key, base64 encoded. Empty means the key has been revoked. | base64 |
h= | Hash algorithms the key may be used with. If left out, all are allowed. Today only sha256 should be used. | sha256, sha1 |
s= | Services the key applies to. Defaults to * (everything). Anything that is not * or email means receivers ignore the key for mail. | *, email |
t= | Flags, separated by colons. y means the domain is testing DKIM, and receivers must not treat a failure differently from unsigned mail. s means signatures must use the exact domain, not a subdomain. | y, s |
n= | A note for humans. Ignored by receivers. | text |
Key size and type
- Under 1024 bits: receivers must treat the signature as invalid (RFC 8301). Replace the key.
- 1024 bits: still verified, but signers should use at least 2048 bits (RFC 8301). Move to 2048 when you can.
- 2048 bits: the usual choice. The record is around 400 characters, longer than the 255-character limit of a single DNS string, so it is stored as two or more quoted strings within one record. Most DNS hosts do this for you; some do not and reject the record or cut it off.
- Ed25519: keys are tiny and fit in one string (RFC 8463), but not every receiver verifies them yet, so publish an RSA key as well.
- Signing algorithm: must be
rsa-sha256(ored25519-sha256).rsa-sha1must not be used (RFC 8301).
Common problems
| What you see | Usual cause | Fix |
|---|---|---|
| “No DKIM key at that selector” | Wrong selector, or the record was published at the wrong name. Many DNS hosts append your domain, so google._domainkey.example.com becomes google._domainkey.example.com.example.com. | Enter only selector._domainkey as the host name. Check the exact selector in the provider's settings. |
| The key cannot be read | The key was truncated or changed when pasted, or quotation marks or spaces ended up inside the value. | Copy it again as one value. If the host has a per-string limit, split it into quoted strings in one record. |
Key found, but mail shows dkim=fail | The message was changed after signing (a footer added by a mailing list or gateway), or signed with a different key than the one published. | Read the header: compare the selector in the message with the one you checked. Disable body-modifying footers before the signing step. |
dkim=pass but DMARC still fails | The signature is valid but for another domain, such as the sending service's own domain. It does not line up with your From address. | Set up domain authentication (custom DKIM) in the service, so it signs as your domain. |
dkim=none | The message was not signed at all. | Turn on DKIM signing in your mail platform. Publishing the key alone does nothing. |
Revoked (empty p=) | The key was withdrawn on purpose, or the record was saved without its key. | Generate a new key and publish the whole record. |
| Fails only on forwarded mail | The forwarder changed the message, for example by rewriting the subject. | Not a problem with your key. DMARC passes if either SPF or DKIM aligns, and ARC helps some forwarders. Nothing to fix on your side. |
Changing or replacing a key safely
- Generate the new key in your provider's settings (choose 2048 bits).
- Publish it under a new selector, leaving the old record in place.
- Check it here until it is found and valid.
- Switch signing to the new selector.
- Send a test and confirm
dkim=passwith the new selector in the header. - Wait a few days so messages already in transit can be checked, then remove the old record.
Test it with a real message
- Send a message from the address and system you want to test to a Gmail account.
- Open it, choose ⋮ then Show original. Near the top you will see “DKIM” with
PASSorFAILand the domain. - Copy the header and paste it into the reader above to see the selector, algorithm, headers signed and whether the signing domain lines up with the From address.
Questions people ask
Do I need DKIM if I have SPF?
Yes. SPF checks the sending server, DKIM checks the message, and they fail in different situations (for example SPF breaks on forwarding, DKIM usually survives it). Google requires SPF or DKIM from all senders, and both plus DMARC from senders of more than 5,000 messages a day to Gmail users.
Can a domain have more than one DKIM key?
Yes, one per selector. Different services each use their own selector, and that is what makes key rotation safe.
Why can't you find my key without a selector?
DNS can only be asked for a name that is known, and DKIM keys are not listed anywhere. The selector is part of the name. That is why we try common names and why the header reader is the reliable route.
Does this check prove my mail is signed?
No. It proves the key is published and sound. Whether messages are signed with it is shown in a real message header, which is what the header reader looks at.
Sources
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures (record tags, signature rules)
- RFC 8301: Cryptographic algorithm and key usage update (rsa-sha1 forbidden, key sizes)
- RFC 8463: Ed25519 for DKIM
- Google: email sender guidelines