Skip to content

Instantly share code, notes, and snippets.

@seanosullivanuk
Created September 26, 2020 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanosullivanuk/af4adeb77214903adbf3e204604914c4 to your computer and use it in GitHub Desktop.
Save seanosullivanuk/af4adeb77214903adbf3e204604914c4 to your computer and use it in GitHub Desktop.
Enable DKIM on a custom domain, with Microsoft 365 Exchange Online
# First, create a new DKIM Signing config for your custom domain
New-DkimSigningConfig -DomainName novelica.co.uk -Enabled $true
# Next, output the necessary CNAME records you need to create
Get-DkimSigningConfig -Identity novelica.co.uk | Format-List Selector1CNAME, Selector2CNAME
# Once the CNAME records are in your DNS, enable DKIM signing
Set-DkimSigningConfig -Identity novelica.co.uk -Enabled $true
@seanosullivanuk
Copy link
Author

It's fairly easy to work out the CNAME formatting ahead of time if you have a number of these to do. So long as the right CNAME's are in your DNS ahead of time, you only need to run the New-DkimSigningConfig commandlet, as it will check for the CNAME's and enable the config if they're there.

e.g. for contoso.com:

selector1._domainkey with the Content set to selector1-contoso-com._domainkey.contosocom.onmicrosoft.com
selector2._domainkey with the Content set to selector2-contoso-com._domainkey.contosocom.onmicrosoft.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment