howTo: Add Your DKIM Record Generated by Microsoft 365 and Google Workspace
So we have learned what a DKIM record is and that it is an email authentication method that uses a digital signature to let the receiving email server know that the message was sent and authorized by your domain. Let us now look deeper into how it can impemented on your own for free.
This guide has been tested and confirmed to work as described. However, please ensure you fully understand the steps before implementation to avoid errors. If you have questions, feel free to contact us at [email protected].
The following steps are available in Google's and Microsoft's official documentation and are provided here for context only. For more details please refer to Google's and Microsoft's official documentation.
This howTo: guide assumes that you have already completed your domain verification.
Option 1: Using Google Workspace
- Log in to the Google Admin Console.
- Navigate to Apps > Google Workspace > Gmail > Authenticate Email.
- Select your domain and click "Generate new record."
- Key length:
- Select 2048-bit if your domain supports enhanced security(confirm with your domain registrar or DNS hosting provider).
- if not supported, then choose 1024-bit
- Prefix selector:
- This is "google" by default
- If this is already used you may change to unique prefix of your choice. Be sure to document this somewhere to keep track of your changes.
- Generate your DKIM key pair by clicking "Generate".
- Key length:
- Adding Your Generated DKIM Public Key to your DNS
- After generating your DKIM Keys you will receive:
- DNS Hostname (TXT record name): Typically in the format
google._domainkey.yourdomain.com
. - TXT Record Value: The public DKIM key string.
- DNS Hostname (TXT record name): Typically in the format
- Access Domain DNS Settings:Log in to your domain registrar's control panel.Navigate to the DNS management section.
- Create a New TXT Record:Type: TXTName/Host: Enter the DNS Hostname provided (e.g.,
google._domainkey
).Value/Text: Paste the TXT Record Value (the public key).TTL: Set to 3600 seconds (1 hour) or use the default value. - Save Changes:Save the new TXT record.DNS propagation can take up to 48 hours.
- After generating your DKIM Keys you will receive:
- Activate DKIM Signing in Google Workspace
- Return to Admin Console:
- After allowing time for DNS propagation, go back to Apps > Google Workspace > Gmail > Authenticate email.
- Select Domain:
- Choose the domain you configured.
- The status should update to Authenticating email with DKIM.
- Return to Admin Console:
- Verify DKIM Configuration
- Send a Test Email:
- Send an email from your domain to a Gmail or Google Workspace account.
- Check Email Headers:
- In the recipient's Gmail account, open the email.
- Click the three vertical dots (More) next to the Reply button and select Show original.
- Look for the Authentication-Results header.
- A successful setup will display
dkim=pass
ordkim=ok
.
- A successful setup will display
- Send a Test Email:
- Monitor and Maintain
- Regular Key Rotation:
- For enhanced security, consider rotating your DKIM keys annually.
- Monitor Email Deliverability:
- Keep an eye on your email deliverability and watch for any authentication issues.
- Regular Key Rotation:
Option 2: Using Microsoft 365
- Access the Microsoft 365 Defender Portal
- Sign In: Log in to the Microsoft 365 Defender portal with your admin credentials.
- Navigate to DKIM Settings:
- In the left-hand navigation pane, expand Email & Collaboration.
- Click on Policies & Rules.
- Select Threat Policies.
- Under Email Authentication Settings, choose the DKIM tab.
2. Generate DKIM Keys
- Select Domain: In the DKIM page, select the domain for which you want to enable DKIM.
- Create DKIM Keys:
- Click on Create DKIM keys.
- Microsoft 365 will generate two CNAME records for your domain.
3. Add CNAME Records to Your DNS
- Access DNS Management: Log in to your domain registrar's control panel to manage DNS records.
- Create CNAME Records:
- Record 1:
- Name:
selector1._domainkey.yourdomain.com
- Value:
selector1-yourdomain-com._domainkey.yourdomain.onmicrosoft.com
- Name:
- Record 2:
- Name:
selector2._domainkey.yourdomain.com
- Value:
selector2-yourdomain-com._domainkey.yourdomain.onmicrosoft.com
- Name:
- Replace
yourdomain.com
with your actual domain name.
- Record 1:
- Save Changes: After adding the CNAME records, save your DNS settings. Note that DNS propagation can take up to 48 hours.
4. Enable DKIM in Microsoft 365
- Return to DKIM Settings: After allowing time for DNS propagation, go back to the DKIM settings in the Microsoft 365 Defender portal.
- Select Domain: Choose the domain you configured.
- Enable DKIM:
- Click on Enable to start signing outgoing messages with DKIM for the selected domain.
5. Verify DKIM Configuration
- Send a Test Email: Send an email from your domain to an external email account (e.g., Gmail).
- Check Email Headers:
- In the recipient's email client, view the email headers.
- Look for the Authentication-Results header.
- A successful setup will display
dkim=pass
ordkim=ok
.
- A successful setup will display
6. Monitor and Maintain
- Regular Key Rotation: For enhanced security, consider rotating your DKIM keys periodically.
- Monitor Email Deliverability: Keep an eye on your email deliverability and watch for any authentication issues.
In another article soon to be published, we will look into generating your DKIM keys using a third party tool if you have or want to have your own email server instead of using Microsoft 365 or Google Workspace.
We Value Your Feedback!
Have you implemented using our guide?
We'd love to hear about your experience! Share your success stories, challenges, or suggestions at
. Let us know if there are specific improvements you'd like to see in our guide!
Have Questions?
If you have any questions or need clarifications, don't hesitate to reach out to us at
. We're here to help you secure your systems.
Thank you for helping us improve and supporting our mission to make cybersecurity accessible for everyone!