Guide
How to set up DKIM: eight steps and a real test
Setting up DKIM follows the same loop at most sending services. The service usually makes a key pair, you publish the public half in DNS at <selector>._domainkey.<domain>, you turn signing on if the service asks you to, and you send a new message to see what arrives.
Three checks stay separate along the way: the record exists, the signature on one message verifies, and the signing domain aligns with the From domain (What is DKIM explains the difference). dkim.fyi makes the first two and compares two domain names for the third. Checked on 29 October 2026.
The eight steps
Work through these in order for each service that sends mail as your domain.
- List every service that sends mail as your domain.
- Open each service’s DKIM settings and copy the record it generates.
- Publish those records in your DNS.
- Check whether signing needs a switch.
- Send a new test message from the service.
- Read the authentication results for that message.
- Compare the signing domain (d=) with the From domain.
- Recheck after any change to senders, gateways, your DNS host or keys.
Step 1: list every service that sends as your domain
List each system that puts your domain in the From address: your mailbox provider, a marketing platform, a support desk, an application that sends by SMTP or an API. Several senders can each use their own selector and key, so one setup says nothing about the next.
If you cannot name them all, the DKIM selector finder reads the domain’s MX, SPF and DMARC records and tries known selectors.
Steps 2 and 3: copy the record and publish it
Copy the record name and value from the sending service’s own DKIM page and publish them exactly as shown. No generic page can print your values, because many services generate the selector or the target for each account.
| Record type | Providers | What the provider gives you |
|---|---|---|
| CNAME | Fastmail, HubSpot, Klaviyo, Mailchimp Transactional, Microsoft 365, Proton Mail, SendGrid, Zendesk | A CNAME that points at a name the provider gives you. SendGrid gives TXT when automated security is off, and Klaviyo’s Dynamic routing uses NS. |
| TXT | Cloudflare Email Routing, Google Workspace, Postmark, Zoho Mail | A TXT record that holds the public key. |
| TXT or CNAME | Amazon SES, Brevo, Mailgun | Either, by method or account. SES uses CNAMEs (Easy DKIM) or one TXT (BYODKIM), Brevo CNAMEs or one TXT, Mailgun CNAMEs (Automatic Sender Security) or a TXT for a manual key. |
Each provider page was last checked on 2026-10-10 (Amazon SES, Google Workspace, Mailgun, Microsoft 365, SendGrid) or 2026-10-24 (the rest).
Google Workspace generates the key in the Admin console (“Click the Generate New Record button.”). The default selector is google, the record is TXT, and Google offers 2048 bits where your DNS host supports it and 1024 where it does not. After Gmail is turned on for the organization, you wait 24 to 72 hours before you can get the key there. Microsoft 365 uses two CNAMEs, selector1._domainkey and selector2._domainkey, the same in every organization, and New-DkimSigningConfig makes a 1024-bit key unless you ask for 2048.
On key size, RFC 8301 says “Signers SHOULD use RSA keys of at least 2048 bits.” Google’s sender guidelines say “Sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer.”
Add the record at any DNS host
This checklist gives no host-specific syntax, because hosts differ. Three things apply at most DNS hosts.
- Name the record
<selector>._domainkey. Hosts differ on whether your domain goes on the end, so after saving, run the DKIM checker and record lookup with your domain and the selector. It looks up exactly<selector>._domainkey.<domain>, so a record saved under another name shows as not found. The DKIM record reference explains the tags in the value. - Check the length limit, if your host has one. Google says “You can not enter a 2048-bit key as a single text string with a 255-character TXT record limit.” A TXT record can hold more than one string, and RFC 6376 says “Strings in a TXT RR MUST be concatenated together before use with no intervening whitespace.” Ask your host how it takes a long value. The checker shows the joined value, not where it was split.
- Allow time. Google Workspace says “After adding a DKIM key, it can take up to 48 hours for DKIM authentication to start working.” The checker also keeps DNS answers for up to five minutes, so a record you just saved may not show at once.
Step 4: check whether signing needs a switch
At some services publishing the record is not enough. Google Workspace has a separate control: once the TXT record is in place, “Click Start authentication.” When it works, the status reads “Authenticating email with DKIM”.
Microsoft 365 has a DKIM toggle in the Defender portal. It does not enable while the CNAME is missing, and the status stays CnameMissing. Signing can also be switched on with only one of the two records published, and a later key rotation then fails because the second record is missing.
Other services start signing on their own. Proton Mail and Postmark start when they detect or verify the record.
Steps 5 to 7: test with a real message
Use a message sent after step 4, so it reflects the setup you just finished.
Step 5 is a new message to an address where you can see the headers. Google notes “You can’t verify DKIM is on by sending yourself a test message.” The DKIM test with a real email gives you a throwaway address for up to 20 messages in 24 hours. Press “Get an address”, send anything to it from the service, and each signature appears with its s= and d= values.
Step 6 is the verdict. The email test shows whether the header signature verified. The mailbox that received a message records its own verdict in an Authentication-Results header. In Gmail, click More next to Reply, then Show original. Google says the DKIM results “should say something like DKIM=pass or DKIM=OK”, and that if the header “doesn’t include a line about DKIM, messages sent from your domain aren’t signed with DKIM”. Read DKIM authentication results explains the values.
Step 7 compares two names. A message can carry a valid signature from any domain, so DMARC also requires the signing domain to align with the From domain. The same Organizational Domain is relaxed alignment and identical names are strict alignment (RFC 9989). In its Table 1, a signing domain of foo.example.com is relaxed against a From domain of news.example.com, news.example.com is strict against itself, and foo.example.net does not align. DKIM, SPF and DMARC compared shows where DKIM fits.
Step 8: recheck after every change
Repeat steps 5 to 7 when you add or remove a sending service, put a gateway in the mail path, move your DNS host or change a key. Google warns that “some outbound gateways add a footer to the bottom of every outgoing message. This can cause DKIM to fail because message contents are changed after the message was sent.”
RFC 6376 advises a new selector for each new key: “Signers are ill-advised to reuse selectors for new keys. A better strategy is to assign new keys to new selectors.” So after a key change, take the selector from a new message. At Microsoft 365 a rotation takes four days (96 hours) to start signing, so test again after that.
- The checker found my record. Is my mail signed?
Not necessarily. The checker shows that a key is published at that name, not that any message is signed with it, and signing may not have started yet (step 4).
- I set up several services. Does one good test cover them all?
No. A message carries the signatures its own sender added, so a test from one service says nothing about another. Send one new message from each service.
Try it
Sources
- Set up DKIM | Security & data protection | Google Workspace Help
- Troubleshoot DKIM issues | Security & data protection | Google Workspace Help
- Email sender guidelines - Gmail Help
- How to use DKIM for email in your custom domain - Microsoft Defender for Office 365 | Microsoft Learn
- Anti-spoofing for custom domains (SPF, DKIM, and DMARC)
- How do I set up DKIM for Postmark? | Postmark Support Center
- RFC 1035: Domain names - implementation and specification
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
- RFC 8301: Cryptographic Algorithm and Key Usage Update to DomainKeys Identified Mail (DKIM)
- RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC)