Fix Exchange Online New-DkimSigningConfig Public Key TXT Record Errors
Question details
The user needs to enable DKIM for a custom domain after New-DkimSigningConfig reports a public key TXT record error.

- Product
- Microsoft Exchange Online
- Device & OS
- not provided
- Scenario
- Configuring DKIM signing for a custom Microsoft 365 email domain.
- Observed behavior
- The New-DkimSigningConfig command returns an error, and the option to enable DKIM may be unavailable in the admin interface.
Confirm that the custom domain is added and verified under Settings > Domains in the Microsoft 365 admin center. Have access to its public DNS provider and an account with permission to manage DKIM in Exchange Online.
Publish and verify the Microsoft 365 DKIM CNAME records
Use this approach when the selector records are missing, incorrect, or not yet visible in public DNS.
For a custom Microsoft 365 domain, publish the two CNAME records supplied for that domain rather than creating your own DKIM public key TXT records. Microsoft manages the keys behind the CNAME targets.
Open the Microsoft Defender portal at security.microsoft.com and go to Email & collaboration > Policies & rules > Threat policies > Email authentication settings > DKIM. Select the custom domain and view its required CNAME records.
In your DNS provider's management console, add the selector1._domainkey and selector2._domainkey CNAME records using the exact host names and targets shown by Microsoft. Check whether your provider automatically appends the domain name to each host.
After allowing time for DNS propagation, use a public DNS lookup tool or run Resolve-DnsName -Type CNAME selector1._domainkey.customdomain.com and the equivalent command for selector2. Confirm that each result matches the target Microsoft provided.
Return to the domain's DKIM settings in the Microsoft Defender portal and enable signing. Alternatively, retry the Exchange Online PowerShell command after both CNAME records resolve correctly.

Check the DKIM configuration in Exchange Online PowerShell
Use PowerShell to check whether a configuration already exists and enable it after the DNS records are in place.
Work with Office documents while managing your email setup
WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations in a familiar interface. Its Office format compatibility helps make migration straightforward. WPS Office does not configure or repair Exchange Online DKIM.

Frequently Asked Questions
Do I need to create a DKIM TXT record for Microsoft 365?
For a custom Microsoft 365 domain, publish the two DKIM CNAME records supplied in the domain's DKIM settings. Microsoft manages the public keys behind those targets.
How can I tell whether my DKIM CNAME records are visible?
Use a public DNS lookup tool or run Resolve-DnsName -Type CNAME for selector1._domainkey and selector2._domainkey under your custom domain. Compare the returned targets with the values shown in Microsoft 365.
What if a DKIM configuration already exists?
Run Get-DkimSigningConfig -Identity customdomain.com in Exchange Online PowerShell. If the configuration exists and DNS is correct, use Set-DkimSigningConfig -Identity customdomain.com -Enabled $true to enable it.
Why can't I see the option to enable DKIM?
Check the domain's DKIM settings in the Microsoft Defender portal and confirm that your account has permission to manage DKIM. Also verify that the domain is configured in Microsoft 365 and that both required CNAME records resolve publicly.




