Email Authentication Configuration (SPF, DKIM & DMARC)

Common error

Microsoft 365 may reject outgoing email with an error similar to:

550 5.7.23 The message was rejected because of Sender Policy Framework violation

550 5.7.1 Message rejected: Message lacks SPF/DKIM/DMARC Auth Records

Step 2: Configure the SPF record

If Microsoft 365 is the only service sending email, use:

Field Value
Type TXT
Host / Name @
Value v=spf1 include:spf.protection.outlook.com -all
TTL 1 Hour (3600 seconds)

TEST : 

Run:

nslookup -type=TXT company.com 8.8.8.8

Expected result:

v=spf1 include:spf.protection.outlook.com -all



3. Configure DKIM (DomainKeys Identified Mail)

Navigate to:

https://security.microsoft.com/authentication?viewid=DKIM

Alternatively:

  1. Open Microsoft Defender.

  2. Expand Email & collaboration.

  3. Select Policies & rules.

  4. Open Threat policies.

  5. Find Email authentication settings.

  6. Select the DKIM tab.

Step 2: Select your domain

Choose the domain you want to configure.

Microsoft will display two required CNAME records.

Important: The CNAME targets are generated specifically for your Microsoft 365 tenant and domain. Never copy targets from another domain or tenant.

Step 3: Add the two CNAME records to DNS

Use the exact values provided by Microsoft.

Field Selector 1 Selector 2
Type CNAME CNAME
Host / Name selector1._domainkey selector2._domainkey
Target Microsoft-provided value Microsoft-provided value
TTL 1 Hour 1 Hour

TEST

Navigate to:

https://security.microsoft.com/authentication?viewid=DKIM

Alternatively:

  1. Open Microsoft Defender.

  2. Expand Email & collaboration.

  3. Select Policies & rules.

  4. Open Threat policies.

  5. Find Email authentication settings.

  6. Select the DKIM tab.

Step 2: Select your domain

Choose the domain you want to configure.

Microsoft will display two required CNAME records.

Important: The CNAME targets are generated specifically for your Microsoft 365 tenant and domain. Never copy targets from another domain or tenant.

Step 3: Add the two CNAME records to DNS

Use the exact values provided by Microsoft.

Field Selector 1 Selector 2
Type CNAME CNAME
Host / Name selector1._domainkey selector2._domainkey
Target Microsoft-provided value Microsoft-provided value
TTL 1 Hour 1 Hour

Example:

Host: selector1._domainkey

Target:
selector1-company-com._domainkey.company.onmicrosoft.com
Host: selector2._domainkey

Target:
selector2-company-com._domainkey.company.onmicrosoft.com

These are examples only. Always use the actual values displayed in your Microsoft 365 tenant.

Step 4: Verify both CNAME records

Run:

nslookup -type=CNAME selector1._domainkey.company.com 8.8.8.8
nslookup -type=CNAME selector2._domainkey.company.com 8.8.8.8

Navigate to:

https://security.microsoft.com/authentication?viewid=DKIM

Alternatively:

  1. Open Microsoft Defender.

  2. Expand Email & collaboration.

  3. Select Policies & rules.

  4. Open Threat policies.

  5. Find Email authentication settings.

  6. Select the DKIM tab.

Step 2: Select your domain

Choose the domain you want to configure.

Microsoft will display two required CNAME records.

Important: The CNAME targets are generated specifically for your Microsoft 365 tenant and domain. Never copy targets from another domain or tenant.

Step 3: Add the two CNAME records to DNS

Use the exact values provided by Microsoft.

Field Selector 1 Selector 2
Type CNAME CNAME
Host / Name selector1._domainkey selector2._domainkey
Target Microsoft-provided value Microsoft-provided value
TTL 1 Hour 1 Hour

Example:

Host: selector1._domainkey

Target:
selector1-company-com._domainkey.company.onmicrosoft.com
Host: selector2._domainkey

Target:
selector2-company-com._domainkey.company.onmicrosoft.com

These are examples only. Always use the actual values displayed in your Microsoft 365 tenant.

Step 4: Verify both CNAME records

Run:

nslookup -type=CNAME selector1._domainkey.company.com 8.8.8.8
nslookup -type=CNAME selector2._domainkey.company.com 8.8.8.8

Both commands should return the corresponding Microsoft 365 CNAME targets.

Step 5: Enable DKIM

Return to Microsoft Defender:

https://security.microsoft.com/authentication?viewid=DKIM

  1. Select your domain.

  2. Confirm that Microsoft recognizes both CNAME records.

  3. Enable DKIM signing for the domain.

4. Configure DMARC (Domain-based Message Authentication, Reporting & Conformance)

DMARC tells receiving mail servers how to handle messages that fail authentication and alignment checks.

It also allows domain administrators to receive authentication reports.

Step 1: Check whether DMARC already exists

Run:

nslookup -type=TXT _dmarc.company.com 8.8.8.8

If the record does not exist, create one.

Step 2: Add the DMARC TXT record

For initial monitoring, use:

Field Value
Type TXT
Host / Name _dmarc
Value v=DMARC1; p=none;
TTL 1 Hour
 
  • SPF, DKIM, DMARC, EMAIL Authenthication
  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

How to check how many device I installed office365 desktop such as word, excel, etc.

  Office Portal: Go to the Office Account page: Visit https://portal.office.com/account...

Uninstall Office 365 using SARAcmd tool

To uninstall Office using the Microsoft Support and Recovery Assistant (SaRA) tool, you can...

How to Fix Microsoft Office TPM Error

step 1: login as admin step2: go to CMD as administrator step3: run this command : dism /online...