How to find a DKIM selector in an email's headers

By TechCompare · Updated · How we check

Open a message from the domain, find the DKIM-Signature header, and read s= for the selector and d= for the domain. The key sits at the selector, then _domainkey, then the domain.

A DKIM public key lives at a name like selector1._domainkey.example.com, and the selector part is up to whoever set up signing. DNS has no way to list the selectors a domain uses, so you can't look a key up without one. The easy way is to read it from a message: every signed email carries it in the s= tag of its DKIM-Signature header.

Topic
Find a DKIM selector
DKIM
Category
Email records
SPF, DKIM and DMARC

How this is calculated

Every mail app can show a message's raw headers. In Gmail, open the message, pick Show original from the three dot menu, and search for DKIM-Signature. In classic Outlook for Windows, open the message, go to File, then Properties, and read the Internet headers box. Apple Mail shows them under View, then Message, then All Headers.

In the DKIM-Signature header, look for a pair like d=example.com and s=selector1. The d= tag is the signing domain and s= is the selector, so that key is at selector1._domainkey.example.com. A message can carry more than one signature, often one for your domain and one for the service that sent it, so check the d= tag of each. Gmail's Authentication-Results header repeats the selector as header.s=.

Some services use the same selector names for every customer. Google Workspace suggests google, Microsoft 365 uses selector1 and selector2, and SendGrid uses s1 and s2. Others make up a selector per domain, and the only places to find it are a message header and the service's setup page.

Once you have it, enter the selector in the DNS Lookup. It reads the key, tells you whether it's RSA or Ed25519 and how long an RSA key is, and flags a key that's been revoked.

Verdict

Read the selector from a real message instead of guessing, since a wrong guess just looks like a missing key. Check both selectors if your provider uses two, because one may be waiting for the next key rotation. If the key is RSA, make sure it's at least 1024 bits, and use 2048 where your DNS host allows it.

More DNS scenarios

TXT records
The free text record that holds verification codes, SPF, DKIM keys and DMARC policies.
View details
SPF vs DKIM vs DMARC
SPF checks the sending server, DKIM checks the message, and DMARC ties both to the From address.
View details
MX records
How senders find your mail servers, what the priority number does, and the null MX for domains that take no mail.
View details

Frequently asked questions

Can I list all the DKIM selectors for a domain?
No. DNS answers questions about exact names and has no command to list what's under _domainkey. Lists of common selectors only catch the usual defaults. A real message's header is the only sure source.
Why does a message have two DKIM signatures?
The sending service often signs with its own domain as well as yours. Only a signature whose d= domain matches the From address, or shares its main domain under relaxed alignment, counts for DMARC, so that's the one to check.
What does an empty p= tag mean?
The key has been revoked. RFC 6376 says an empty p= means the domain no longer stands behind that selector, so any signature made with it fails. It's normal for an old selector after a key rotation.