DKIM selectors and DNS records
A DKIM selector is the name in a signature's s= tag that tells receivers which public key to fetch. Receivers look the key up at <selector>._domainkey.<signing domain>, so a signature with s=mail2026 and d=example.com points to mail2026._domainkey.example.com. Selectors exist so one domain can have several keys at once, one per sending service or one per rotation, without any of them stepping on the others.
What is a DKIM selector?
Selectors split a domain's key namespace so the domain can publish multiple public keys at the same time. Examples include one per office, per date, per server, or per delegated partner. Every DKIM signature must name its selector in s=. Selectors can contain dots, which simply become extra DNS labels.
The selector is only the label. The DKIM record is what sits at that label.
What is a DKIM record?
A DKIM record is a DNS TXT record at <selector>._domainkey.<d= domain> that holds the public key. The lookup uses the signing domain from d=, not the From domain. For DMARC you want those two aligned (What is DKIM and how it works), but DNS doesn't care.
A typical record looks like this. The key is shortened, so this isn't a record to publish:
mail2026._domainkey.example.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
The tags are:
| Tag | Meaning |
|---|---|
v=DKIM1 |
Version. Recommended; if present it must come first. |
k=rsa |
Key type. rsa is the default; ed25519 is also defined. |
p= |
The public DKIM key, base64-encoded. Required. An empty p= means the key has been revoked. |
t=y |
Testing flag. Verifiers must treat the mail the same as unsigned mail, so DKIM gives you no benefit while it's set. |
t=s, h=, s=, n= |
Optional: no subdomains in i=, acceptable hash algorithms, service type, and free-text notes. |
Google's setup page shows the same shape: host google._domainkey, value v=DKIM1; k=rsa; p=<key>.
Long keys: several strings, one record
A single TXT string holds about 255 characters. Google's wording is "up to 255 characters". A 2048-bit key is longer than that, so it has to be split into several quoted strings inside one TXT record:
mail2026._domainkey.example.com TXT ( "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...first part..."
"...second part...IDAQAB")
Receivers join the strings with no intervening whitespace. That's very different from publishing two TXT records at the same selector, which gives undefined results. If your DNS host truncates the value or puts the strings out of order, every signature using that key fails. Key length choices are in 1024-bit vs 2048-bit DKIM keys.
TXT or CNAME?
Many providers ask you to publish a CNAME at the selector name that points to a key they host and rotate. Microsoft 365 uses two: selector1._domainkey and selector2._domainkey, with one active and one standing by for the next rotation. That's key delegation via CNAME.
Publish exactly the record type your provider gives you. Microsoft lists "TXT record instead of a CNAME record" among the common mistakes for Microsoft 365.
How to find your DKIM selector
The reliable way is to look inside a real message from that service:
- Send a message from the service to an external mailbox.
- Open the full headers. In Gmail that's Show original (Envelope From vs Header From shows how to read them).
- Find the
DKIM-Signature:header and reads=(the selector) andd=(the signing domain).
Google gives the same method for non-Google senders: view the message source and "locate the s value in the DKIM-Signature header." The receiver's Authentication-Results header often repeats it as header.s=.
What about finding the DKIM selector for a domain without a message? You usually need a sample message or the provider's instructions. Don't assume a lookup at a common selector name finds every key: some domains deliberately avoid selector names outsiders could harvest.
Your DMARC aggregate reports are the other good source. They list the DKIM domain, selector, and result for each sending source, so you can inventory the selectors actually in use across all your senders (A field-by-field walk-through of a DMARC aggregate report).
One selector per sender
Every service that signs as your domain should have its own selector and its own key. It is not recommended to share the same DKIM keys across several entities. That way you can rotate or revoke one sender's key without touching the rest.
A selector name may already be taken by another service. If google._domainkey is already in use, Google tells you to "enter a different prefix." Never reuse a selector name that's already live for a different key: you'd overwrite a working key, and mail signed with it would start failing (How to rotate a DKIM key).
Each signing domain needs its own keys under its own _domainkey name. If news.example.com signs as itself, its record sits at <selector>._domainkey.news.example.com. You must get a unique DKIM key from the Admin console for each domain.
How to set up DKIM
The generic order is the same everywhere. Step-by-step screens for Microsoft 365, Google Workspace, and email sending platforms are in DMARC for Microsoft 365, DMARC for Google Workspace, and Email sending platforms: SPF, DKIM and DMARC setup.
- Get the key and selector from the sending service, or generate the key pair yourself if you run your own mail server.
- Publish the record (TXT or CNAME, exactly as given) at
<selector>._domainkeyin the zone of the signing domain. Most DNS hosts append the zone automatically, so typemail2026._domainkey, notmail2026._domainkey.example.com. Otherwise you end up withmail2026._domainkey.example.com.example.com, which Microsoft lists as a common mistake. - Wait for DNS. DKIM can take up to 48 hours to start working after you add the key.
- Turn signing on at the sender. Publishing the record doesn't start signing: Google has a Start authentication step, and Microsoft 365 has its own enable setting.
- Check a real message. Send to an external mailbox, not to yourself, and confirm
dkim=passwith yourd=and yours=inAuthentication-Results.
If the receiver can't find a key at all, see DKIM signature not found. For other failures, see Why DKIM signatures fail.
Mistakes worth avoiding
- The doubled domain. Typing the full name into a DNS host that appends the zone.
- A truncated 2048-bit key, or its strings out of order.
- A TXT where the provider expects a CNAME, or only one of Microsoft's two CNAMEs, which breaks the next rotation.
- A proxied CNAME. On Cloudflare, DKIM CNAMEs must be set to DNS only, not proxied.
- Very low TTLs on Microsoft 365 DKIM CNAMEs. Microsoft links TTLs of 60 or 300 seconds to intermittent
dkim=temperrorand recommends at least 3600 seconds. - Putting the key at the root of the domain or at
_domainkey.example.com. It has to sit under its selector. - Leaving
t=yin place. Receivers must treat the mail like unsigned mail, so the signature gives you nothing.
One more: Microsoft advises against publishing DKIM records for parked domains that don't send mail. Those domains should still publish v=spf1 -all (Common SPF mistakes).
Free DMARC account
Turn raw DMARC reports into a readable dashboard
Point your rua address to our platform and read the results by sender and source instead of opening XML files.
- Results grouped by sending source
- SPF, DKIM and alignment results per sender
- The original XML reports are still there to download
FAQ
Can I have more than one DKIM record?
Yes, one per selector. Each sending service gets its own. Just don't publish two TXT records at the same selector.
Does the selector have to match anything?
It must match the s= in the signature exactly, under the same d= domain.
TXT or CNAME?
Whichever your provider specifies. A CNAME lets the provider host and rotate the key for you.
Why won't my DNS host accept my 2048-bit key?
It's longer than one 255-character string. Split it into quoted strings in one record, use the provider's CNAME option if it has one, or ask your DNS host.
Do subdomains need their own DKIM records?
Each domain that appears in d= needs its own keys under its own _domainkey name. For Microsoft 365, each subdomain you send from "requires its own DKIM configuration."