Skip to content

Commit f97ba97

Browse files
Merge pull request #3471 from MicrosoftDocs/main
[AutoPublish] main to live - 04/14 15:32 PDT | 04/15 04:02 IST
2 parents f00e46f + 681c119 commit f97ba97

File tree

1 file changed

+38
-37
lines changed

1 file changed

+38
-37
lines changed

defender-office-365/email-authentication-dkim-configure.md

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ f1.keywords:
55
ms.author: chrisda
66
author: chrisda
77
manager: deniseb
8-
ms.date: 04/08/2024
8+
ms.date: 04/14/2025
99
audience: ITPro
1010
ms.topic: conceptual
1111

@@ -32,7 +32,7 @@ appliesto:
3232

3333
DomainKeys Identified Mail (DKIM) is a method of [email authentication](email-authentication-about.md) that helps validate mail sent from your Microsoft 365 organization to prevent spoofed senders that are used in business email compromise (BEC), ransomware, and other phishing attacks.
3434

35-
The primary purpose of DKIM is to verify that a message hasn't been altered in transit. Specifically:
35+
The primary purpose of DKIM is to verify that a message wasn't altered in transit. Specifically:
3636

3737
1. One or more private keys are generated for a domain and are used by the source email system to digitally sign important parts of outbound messages. These message parts include:
3838
- From, To, Subject, MIME-Version, Content-Type, Date, and other message header fields (depending on the source email system).
@@ -59,11 +59,11 @@ Before we get started, here's what you need to know about DKIM in Microsoft 365
5959

6060
For more information about \*.onmicrosoft.com domains, see [Why do I have an "onmicrosoft.com" domain?](/microsoft-365/admin/setup/domains-faq#why-do-i-have-an--onmicrosoft-com--domain).
6161

62-
- **If you use one or more custom domains for email (for example, contoso.com)**: Even though all outbound mail from Microsoft 365 is automatically signed by the MOERA domain, you still have more work to do for maximum email protection:
62+
- **If you use one or more custom domains for email (for example, contoso.com)**: Even though the MOERA domain signs all outbound mail from Microsoft 365, you still have more work to do for maximum email protection:
6363
- **Configure DKIM signing using custom domains or subdomains**: A message needs to be DKIM signed by the domain in the From address. We also recommend configuring DMARC, and DKIM passes DMARC validation only if the domain that DKIM signed the message and the domain in the From address align.
6464

6565
- **Subdomain considerations**:
66-
- For email services that aren't under your direct control (for example, bulk email services), we recommend using a subdomain (for example, marketing.contoso.com) instead of your main email domain (for example, contoso.com). You don't want issues with mail sent from those email services to affect the reputation of mail sent by employees in your main email domain. For more information about adding subdomains, see [Can I add custom subdomains or multiple domains to Microsoft 365?](/microsoft-365/admin/setup/domains-faq#can-i-add-custom-subdomains-or-multiple-domains-to-microsoft-365).
66+
- For email services that aren't under your direct control (for example, bulk email services), we recommend using a subdomain (for example, marketing.contoso.com) instead of your main email domain (for example, contoso.com). You don't want issues with mail sent from those email services to affect the reputation of mail sent by users in your main email domain. For more information about adding subdomains, see [Can I add custom subdomains or multiple domains to Microsoft 365?](/microsoft-365/admin/setup/domains-faq#can-i-add-custom-subdomains-or-multiple-domains-to-microsoft-365).
6767
- Each subdomain that you use to send email from Microsoft 365 requires its own DKIM configuration.
6868

6969
> [!TIP]
@@ -78,61 +78,63 @@ The rest of this article describes the DKIM CNAME records that you need to creat
7878
> [!TIP]
7979
> Configuring DKIM signing using a custom domain is a mixture of procedures in Microsoft 365 and procedures at the domain registrar of the custom domain.
8080
>
81-
> We provide instructions to create CNAME records for different Microsoft 365 services at many domain registrars. You can use these instructions as a starting point to create the create the DKIM CNAME records. For more information, see [Add DNS records to connect your domain](/Microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider).
81+
> We provide instructions to create CNAME records for different Microsoft 365 services at many domain registrars. You can use these instructions as a starting point to create the DKIM CNAME records. For more information, see [Add DNS records to connect your domain](/Microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider).
8282
>
8383
> If you're unfamiliar with DNS configuration, contact your domain registrar and ask for help.
8484
8585
## Syntax for DKIM CNAME records
8686

87-
> [!TIP]
88-
> You use the Defender portal or Exchange Online PowerShell to view the required CNAME values for DKIM signing of outbound messages using a custom domain. The values presented here are for illustration only. To get the values that are required for your custom domains or subdomains, use the procedures later in this article.
89-
9087
DKIM is exhaustively described in [RFC 6376](https://datatracker.ietf.org/doc/html/rfc6376).
9188

89+
In Microsoft 365, two public-private key pairs are generated when DKIM signing using a custom domain or subdomain is enabled. The private keys that are used to sign the message are inaccessible. The CNAME records point to the corresponding public keys that are used to verify the DKIM signature. These records are known as _selectors_.
90+
91+
- Only one selector is active and used when DKIM signing using a custom domain is enabled.
92+
- The other selector is inactive. It's activated and used only after any future [DKIM key rotation](#rotate-dkim-keys), and then only after the original selector is deactivated.
93+
94+
The selector that's used to verify the DKIM signature (which infers the private key that was used to sign the message) is stored in the **s=** value in the **DKIM-Signature** header field (for example, `s=selector1-contoso-com`).
95+
96+
> [!IMPORTANT]
97+
> Use the Defender portal or Exchange Online PowerShell to view the required CNAME values for DKIM signing of outbound messages using a custom domain. The values presented here are for illustration only. To get the required values for your custom domains or subdomains, use the procedures later in this article.
98+
9299
The basic syntax of the DKIM CNAME records for custom domains that send mail from Microsoft 365 is:
93100

94101
```text
95102
Hostname: selector1._domainkey
96-
Points to address or value: selector1-<CustomDomain>._domainkey.<InitialDomainPrefix>.n-v1.dkim.mail.microsoft
103+
Points to address or value: selector1-<CustomDomainWithDashes>._domainkey.<InitialDomainPrefix>.<DynamicPartitionCharacter>-v1.dkim.mail.microsoft
97104
98105
Hostname: selector2._domainkey
99-
Points to address or value: selector2-<CustomDomain>._domainkey.<InitialDomainPrefix>.n-v2.dkim.mail.microsoft
106+
Points to address or value: selector2-<CustomDomainWithDashes>._domainkey.<InitialDomainPrefix>.<DynamicPartitionCharacter>-v1.dkim.mail.microsoft
100107
```
101108

102-
- In Microsoft 365, two public-private key pairs are generated when DKIM signing using a custom domain or subdomain is enabled. The private keys that are used to sign the message are inaccessible. The CNAME records point to the corresponding public keys that are used to verify the DKIM signature. These records are known as _selectors_.
103-
- Only one selector is active and used when DKIM signing using a custom domain is enabled.
104-
- The second selector is inactive. It's activated and used only after any future [DKIM key rotation](#rotate-dkim-keys), and then only after the original selector is deactivated.
105-
106-
The selector that's used to verify the DKIM signature (which infers the private key that was used to sign the message) is stored in the **s=** value in the **DKIM-Signature** header field (for example, `s=selector1-contoso-com`).
107-
108109
- **Hostname**: The values are the same for all Microsoft 365 organizations: `selector1._domainkey` and `selector2._domainkey`.
109-
110-
- **\<CustomDomain\>**: The custom domain or subdomain with periods replaced by dashes. For example, `contoso.com` becomes `contoso-com`, or `marketing.contoso.com` becomes `marketing-contoso-com`.
111-
110+
- **\<CustomDomainWithDashes\>**: The custom domain or subdomain with periods replaced by dashes. For example, `contoso.com` becomes `contoso-com`, or `marketing.contoso.com` becomes `marketing-contoso-com`.
112111
- **\<InitialDomainPrefix\>**: The custom part of the \*.onmicrosoft.com you used to enroll in Microsoft 365. For example, if you used `contoso.onmicrosoft.com`, the value is `contoso`.
112+
- **\<DynamicPartitionCharacter\>**: A dynamically generated character that's used for both selectors.
113+
- **v1**: The current CNAME format version that's used for both selectors.
114+
- **dkim.mail.microsoft**: The parent DNS zone that's the same for both selectors.
113115

114116
For example, your organization has the following domains in Microsoft 365:
115117

116118
- **Initial domain**: cohovineyardandwinery.onmicrosoft.com
117119
- **Custom domains**: cohovineyard.com and cohowinery.com
118120

119-
You need to create two CNAME records in each custom domain, for a total of four CNAME records:
121+
You need to create two CNAME records in DNS in each custom domain, for a total of four CNAME records:
120122

121123
- **CNAME records in the cohovineyard.com domain**:
122124

123125
**Hostname**: `selector1._domainkey`<br>
124126
**Points to address or value**: `selector1-cohovineyard-com._domainkey.cohovineyardandwinery.n-v1.dkim.mail.microsoft`
125127

126128
**Hostname**: `selector2._domainkey`<br>
127-
**Points to address or value**: `selector2-cohovineyard-com._domainkey.cohovineyardandwinery.n-v2.dkim.mail.microsoft`
129+
**Points to address or value**: `selector2-cohovineyard-com._domainkey.cohovineyardandwinery.n-v1.dkim.mail.microsoft`
128130

129131
- **CNAME records in the cohowinery.com domain**:
130132

131133
**Hostname**: `selector1._domainkey`<br>
132-
**Points to address or value**: `selector1-cohowinery-com._domainkey.cohovineyardandwinery.n-v1.dkim.mail.microsoft`
134+
**Points to address or value**: `selector1-cohowinery-com._domainkey.cohovineyardandwinery.r-v1.dkim.mail.microsoft`
133135

134136
**Hostname**: `selector2._domainkey`<br>
135-
**Points to address or value**: `selector2-cohowinery-com._domainkey.cohovineyardandwinery.n-v2.dkim.mail.microsoft`
137+
**Points to address or value**: `selector2-cohowinery-com._domainkey.cohovineyardandwinery.r-v1.dkim.mail.microsoft`
136138

137139
## Configure DKIM signing of outbound messages in Microsoft 365
138140

@@ -141,7 +143,7 @@ You need to create two CNAME records in each custom domain, for a total of four
141143
> [!TIP]
142144
> Enabling DKIM signing of outbound messages using a custom domain effectively switches DKIM signing from using the initial \*.onmicrosoft.com domain to using the custom domain.
143145
>
144-
> You can use a custom domain or subdomain to DKIM sign outbound mail only after the domain has been successfully added to Microsoft 365. For instructions, see [Add a domain](/microsoft-365/admin/setup/add-domain#add-a-domain).
146+
> You can use a custom domain or subdomain to DKIM sign outbound mail only after the domain is successfully added to Microsoft 365. For instructions, see [Add a domain](/microsoft-365/admin/setup/add-domain#add-a-domain).
145147
>
146148
> The main factor that determines when a custom domain starts DKIM signing outbound mail is the CNAME record detection in DNS.
147149
@@ -175,27 +177,27 @@ Proceed if the domain satisfies these requirements.
175177
|Microsoft.Exchange.ManagementTasks.ValidationException|CNAME record does not
176178
exist for this config. Please publish the following two CNAME records first. Domain Name
177179
: contoso.com Host Name : selector1._domainkey Points to address or value: selector1-
178-
contoso-com._domainkey.contoso.onmicrosoft.com Host Name : selector2._domainkey
179-
Points to address or value: selector2-contoso-com._domainkey.contoso.onmicrosoft.com .
180+
contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft.com Host Name : selector2._domainkey
181+
Points to address or value: selector2-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft .
180182
If you have already published the CNAME records, sync will take a few minutes to as
181183
many as 4 days based on your specific DNS. Return and retry this step later.
182184
```
183185

184186
Therefore, the CNAME records that you need to create in DNS for the contoso.com domain are:
185187

186188
**Hostname**: `selector1._domainkey`<br>
187-
**Points to address or value**: `selector1-contoso-com._domainkey.contoso.onmicrosoft.com`
189+
**Points to address or value**: `selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft`
188190

189191
**Hostname**: `selector2._domainkey`<br>
190-
**Points to address or value**: `selector2-contoso-com._domainkey.contoso.onmicrosoft.com`
192+
**Points to address or value**: `selector2-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft`
191193

192194
Copy the information from the error dialog (select the text and press CTRL+C), and then select **OK**.
193195

194196
Leave the domain details flyout open.
195197

196198
6. In another browser tab or window, go to the domain registrar for the domain, and then create the two CNAME records using the information from the previous step.
197199

198-
We provide instructions to create CNAME records for different Microsoft 365 services at many domain registrars. You can use these instructions as a starting point to create the DKIM CNAME records. For more information, see [Add DNS records to connect your domain](/Microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider).
200+
We provide instructions to create CNAME records for different Microsoft 365 services at many domain registrars. You can use these instructions as a starting point to create the DKIM CNAME records. For more information, see [Add DNS records to connect your domain](/Microsoft-365/admin/get-help-with-domains/create-dns-records-at-any-dns-hosting-provider).
199201

200202
It takes a few minutes (or possibly longer) for Microsoft 365 to detect the new CNAME records that you created.
201203

@@ -266,7 +268,7 @@ If you'd rather use PowerShell to enable DKIM signing of outbound messages using
266268
> [!TIP]
267269
> Before you can configure DKIM signing using the custom domain, you need to add the domain to Microsoft 365. For instructions, see [Add a domain](/microsoft-365/admin/setup/add-domain#add-a-domain). To confirm that the custom domain is available for DKIM configuration, run the following command: `Get-AcceptedDomain`.
268270
>
269-
> As described earlier in this article, your \*.onmicrosoft.com domain is already signing outbound email by default. Typically, unless you've manually configured DKIM signing for the \*.onmicrosoft.com domain in the Defender portal or in PowerShell, the \*.onmicrosoft.com doesn't appear in the output of **Get-DkimSigningConfig**.
271+
> As described earlier in this article, your \*.onmicrosoft.com domain is already signing outbound email by default. Typically, unless you manually configured DKIM signing for the \*.onmicrosoft.com domain in the Defender portal or in PowerShell, the \*.onmicrosoft.com doesn't appear in the output of **Get-DkimSigningConfig**.
270272
271273
1. Run the following command to verify the availability and DKIM status of all domains in the organization:
272274

@@ -302,7 +304,6 @@ If you'd rather use PowerShell to enable DKIM signing of outbound messages using
302304
- 1024 (default)
303305
- 2048
304306
305-
306307
For example:
307308
308309
```powershell
@@ -328,10 +329,10 @@ If you'd rather use PowerShell to enable DKIM signing of outbound messages using
328329
For example:
329330
330331
**Hostname**: `selector1._domainkey`<br>
331-
**Points to address or value**: `selector1-contoso-com._domainkey.contoso.onmicrosoft.com`
332+
**Points to address or value**: `selector1-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft`
332333
333334
**Hostname**: `selector2._domainkey`<br>
334-
**Points to address or value**: `selector2-contoso-com._domainkey.contoso.onmicrosoft.com`
335+
**Points to address or value**: `selector2-contoso-com._domainkey.contoso.n-v1.dkim.mail.microsoft`
335336
336337
4. Do one of the following steps:
337338
@@ -434,7 +435,7 @@ To confirm the corresponding public key that's used to verify the DKIM signature
434435

435436
6. After four days (96 hours), the new DKIM key begins to sign outbound messages for the custom domain. Until then, the current DKIM key is used.
436437

437-
You can tell when the new DKIM key is being used when the **Status** value changes from **Rotating keys for this domain and signing DKIM signatures** to **Signing DKIM signatures for this domain**.
438+
The new DKIM key is being used to sign message when the **Status** value changes from **Rotating keys for this domain and signing DKIM signatures** to **Signing DKIM signatures for this domain**.
438439

439440
To confirm the corresponding public key that's used to verify the DKIM signature (which infers the private key that was used to sign the message), check the **s=** value in the **DKIM-Signature** header field (the selector; for example, `s=selector1-contoso-com`).
440441

@@ -574,7 +575,7 @@ Use any of the following methods to verify DKIM signing of outbound email from M
574575
> The DKIM signature is omitted under either of the following conditions:
575576
>
576577
> - The sender and recipient email addresses are in the same domain.
577-
> - The sender and recipient email addresses are in different domains that are controlled by the same organization.
578+
> - The sender and recipient email addresses are in different domains controlled by the same organization.
578579
>
579580
> In both cases, the **DKIM-Signature** header field doesn't exist in the message header, and the **Authentication-Results** header field looks like the following example:
580581
>
@@ -618,7 +619,7 @@ In this example, the following steps are required:
618619
4. If the destination email system checks DKIM on inbound messages, the messages pass DKIM because they're DKIM signed.
619620
5. If the destination email system checks DMARC on inbound messages, the domain in the DKIM signature (the **d=** value in the **DKIM-Signature** header field) matches the domain in the From address that's shown in email clients, so the messages can also pass DMARC:
620621

621-
**From**: [email protected]<br>
622+
**From**: `[email protected]`<br>
622623
**d=**: marketing.contoso.com
623624

624625
## Next steps
@@ -631,4 +632,4 @@ As described in [How SPF, DKIM, and DMARC work together to authenticate email me
631632
For mail coming _into_ Microsoft 365, you might also need to configure trusted ARC sealers if you use services that modify messages in transit before delivery to your organization. For more information, see [Configure trusted ARC sealers](email-authentication-arc-configure.md).
632633

633634
> [!TIP]
634-
> Exchange 2016 and Exchange 2019 are known to modify messages that flow through them, which can impact DKIM.
635+
> Exchange 2016 and Exchange 2019 are known to modify messages that flow through them, which can affect DKIM.

0 commit comments

Comments
 (0)