DKIM selectors are labels in the s= tag of a DKIM-Signature header. They tell receivers which DNS record holds the public key, at selector._domainkey.example.com. One domain can use many selectors for multiple senders and key rotation.
The rest of this guide shows where the selector appears, how to find yours, how to publish and test the record, and how to manage selectors over time.
What are DKIM selectors?
A DKIM selector is a text label that tells a receiving server which public key to fetch from DNS to verify a DKIM signature. It is carried in the s= tag of the DKIM-Signature header. Because a domain can publish many selectors, several services can each sign with their own key.
DKIM works with a key pair. The sending system signs each message with a private key. The matching public key is published in DNS. The selector is the pointer that lets a receiver find the right public key when a domain has more than one.
Every DKIM-Signature header must carry these seven tags:
- v=1: the DKIM version.
- a=rsa-sha256: the signing algorithm.
- d=example.com: the signing domain.
- s=selector1: the selector.
- h=from:to:subject:date: the header fields covered by the signature.
- bh=...: the hash of the message body.
- b=...: the signature itself.
Optional tags such as c= (canonicalization) and t= (signing time) often appear as well.
The specification is in RFC 6376.
Where is the DKIM selector record published in DNS?
The record is a DNS record at the name selector._domainkey.example.com, where selector is the value of the s= tag and example.com is the value of the d= tag. The receiving server builds this name from the signature header and queries it as a TXT record. If the name is a CNAME, the resolver follows it to the TXT record at the target, but the lookup is still a TXT query.
For a signature with s=selector1 and d=example.com, the receiver looks up selector1._domainkey.example.com. A typical TXT record looks like this:
selector1._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
The tags mean:
- v=DKIM1: the record version.
- k=rsa: the key type.
- p=: the base64-encoded public key. An empty p= value means the key has been revoked.
The fixed label _domainkey sits between the selector and your domain. The selector itself is chosen by whoever sets up the key, which is often your email provider.
How do I find my DKIM selector?
Send an email from your domain to a mailbox you control, open the full message source, and search for DKIM-Signature. The value after s= is the selector. The d= value beside it is the signing domain, and together they give the DNS name to check.
Two common ways to view the headers:
In Gmail
- Open the received message.
- Click the three vertical dots in the message toolbar.
- Choose Show original.
- Search the page for DKIM-Signature and read the s= tag.
In Outlook (desktop)
- Double-click the message to open it in its own window.
- Go to File, then Properties.
- Read the Internet headers box and find the DKIM-Signature line.
- Read the s= tag.
Here is a sample header:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=dkim1;
h=from:to:subject:date:message-id; bh=...; b=...
Here d=example.com is the signing domain and s=dkim1 is the selector. The public key is therefore at dkim1._domainkey.example.com.
A message can carry more than one DKIM-Signature header. For example, your own system and a third-party sender may each add one. Each has its own selector, and you should check them all.
You need a real message for this step. DNS has no way to list the selectors a domain has published, so you cannot discover them by querying the domain. If you have no message to hand, check your email provider's DKIM settings page, which shows the selector it asked you to publish. Once you know the selector, the DKIM record lookup shows the published key.
How many DKIM selectors can a domain have?
A domain can have as many DKIM selectors as it needs. Each selector is a separate DNS record. Giving each one its own key pair is good practice rather than a protocol rule, and it lets every sending service sign with its own key. Adding or retiring one selector does not affect the others.
Common reasons to use several selectors:
- Multiple senders. Your mailbox platform, marketing platform and support desk can each have a separate selector.
- Key rotation. You can publish a new selector, switch signing to it, and remove the old one later.
- Containing a compromise. If one service's private key is exposed, you can revoke that selector without touching the rest.
Give selectors names you will recognise later, such as a provider name plus a date. Vague names make it hard to tell which record belongs to which sender.
Should I publish DKIM as a TXT or CNAME record?
Use whichever your provider tells you to. Some providers give a TXT record that holds the public key directly. Others give a CNAME that points the selector name at a key they host, which lets them rotate keys without asking you to change DNS.
A CNAME record looks like this:
selector1._domainkey.example.com. IN CNAME selector1.provider-dkim.example.net.
The receiver follows the CNAME and reads the TXT record at the target. A selector name cannot hold both a CNAME and a TXT record, so publish one or the other.
DNS limits each quoted string in a TXT record to 255 characters, and a 2048-bit key is longer than that. The key is therefore split into several quoted strings in one record, which receivers join back together with nothing in between. Many DNS interfaces do this split for you.
How do I check that a DKIM selector is working?
Query the selector's DNS name and confirm it returns a valid record, then send a test message and confirm the signature verifies. A missing record, a truncated key or a wrong selector name are the usual causes of failure.
From a terminal, you can query the record directly, or use the DKIM record lookup:
dig +short TXT selector1._domainkey.example.com
If nothing comes back, the record cannot be found. Check these points:
- The selector in s= matches the DNS name exactly.
- The record is published on the domain in d=, not a different one.
- DNS changes have had time to propagate.
If a record comes back but verification still fails, the record exists but is wrong. Check these points:
- The p= value is complete, with no stray spaces or missing characters.
- The key matches the private key your sending system signs with.
- No other system rewrites the message after signing, for example by adding a footer.
To confirm a pass, send a test message and open its full headers. Look for the Authentication-Results header added by the receiving server. A working setup shows dkim=pass, with your domain in header.d= (Gmail shows header.i=@yourdomain instead) and your selector in header.s=.
The free domain scanner checks a domain's DMARC, SPF, DKIM and related records in one pass.
DKIM selectors, DMARC and key rotation
DMARC passes on DKIM only when the signature verifies and the d= domain aligns with the domain in the From header. The selector does not affect alignment. It only locates the key. If you need to confirm your DMARC policy, the DMARC record lookup shows what you have published.
Once you know which selectors your senders use, DMARC aggregate reports help you see which sources sign correctly and which fail. DMARC monitoring from yourDMARC collects and visualises those reports for your domains. Failing sources are easier to spot when you can match them to a selector.
For key rotation, keep this order:
- Publish the new selector's public key in DNS.
- Wait until the new record resolves from public DNS resolvers before you go on.
- Switch your sending system to sign with the new selector.
- Leave the old record in place for a while so in-flight messages still verify.
- Remove the old selector once it is no longer used.
Use 2048-bit RSA keys. RFC 8301 says signers must use keys of at least 1024 bits and should use at least 2048 bits, so treat 1024 as the floor, not the target. Do not use rsa-sha1. Signing with DKIM is also expected by bulk-sender rules. See email sender compliance for how those requirements relate to DMARC.
Key takeaways
- A DKIM selector is the s= value in the DKIM-Signature header. It names the key a receiver should use.
- The public key lives at selector._domainkey.example.com, where example.com is the d= domain.
- Find your selector by opening the full headers of a message you sent and reading the s= tag. DNS cannot list a domain's selectors.
- A domain can have many selectors, so each sender can have its own key and you can rotate keys safely.
- Publish exactly what your provider gives you, as a TXT or a CNAME, and never both at the same name.
- Test with a DNS query and a real message, look for dkim=pass in Authentication-Results, and use DMARC reports to confirm that each sender signs and aligns.










