A new Microsoft 365 tenant. The onboarding wizard hands the customer a list of eight DNS records — MX, SPF, two AutoDiscover-related CNAMEs, an MDM enrollment CNAME, and a couple more. The customer pastes them all into cPanel and hopes for the best. Three months later, the calendar doesn’t sync on iPhones, Outlook on desktop keeps re-prompting for credentials, and the IT team can’t pin down why. Each missing record is a feature that silently fails.
What’s happening
Microsoft 365’s DNS records cover several distinct functions:
- MX:
<tenant>.mail.protection.outlook.com.— the inbound mail entry point. - SPF:
v=spf1 include:spf.protection.outlook.com -all— authenticates outbound mail through Exchange Online. - DKIM: two CNAMEs (
selector1._domainkeyandselector2._domainkey) pointing to Microsoft’s hosted DKIM endpoint. Must be enabled in the admin console first. - DMARC: TXT at
_dmarc.example.com. Microsoft documents this but doesn’t auto-create it. - AutoDiscover CNAME:
autodiscover.example.com → autodiscover.outlook.com.— needed for Outlook desktop to find the mailbox without manual server config. - MDM Enrollment:
enterpriseregistration.example.com → enterpriseregistration.windows.net.andenterpriseenrollment.example.com → enterpriseenrollment.manage.microsoft.com.— for Intune device enrollment. - Microsoft Teams: typically a
sip.example.comSRV pair and alyncdiscover.example.comCNAME for legacy Teams/Skype federation. - Site verification: a TXT at the apex with the Microsoft-issued token, used during initial domain claim.
Without AutoDiscover, Outlook desktop works but needs every user to type the server name in manually. Without MDM enrollment, Intune device join from a domain-joined Windows machine takes manual server discovery. Each missing record produces a workable workaround but adds friction.
How to verify
Walk the full list:
dig +short MX example.com
dig +short TXT example.com | grep spf
dig +short TXT _dmarc.example.com
dig +short CNAME selector1._domainkey.example.com
dig +short CNAME selector2._domainkey.example.com
dig +short CNAME autodiscover.example.com
dig +short CNAME enterpriseregistration.example.com
dig +short CNAME enterpriseenrollment.example.com
dig +short SRV _sip._tls.example.com
For DKIM, confirm both selectors resolve to Microsoft’s *.<tenant>.onmicrosoft.com._domainkey.*.microsoftonline.com. pattern.
Test mail flow:
swaks --to test@example.com --from external@gmail.com --server gmail-mx-host
The receiving side should show spf=pass and dkim=pass once DKIM is enabled.
What to do
- Publish MX in cPanel Zone Editor:
example.com IN MX 0 <tenant>.mail.protection.outlook.com.
The <tenant> is your Microsoft tenant prefix (visible in the admin console).
- Publish SPF:
example.com IN TXT "v=spf1 include:spf.protection.outlook.com -all"
Use -all once you’ve validated; ~all while testing.
- Publish DKIM CNAMEs. First enable DKIM signing in the M365 admin console (Security > Email & collaboration > Threat policies > DKIM > Enable for the domain). The console then displays the two CNAME targets. Publish:
selector1._domainkey.example.com IN CNAME selector1-example-com._domainkey.<tenant>.onmicrosoft.com.
selector2._domainkey.example.com IN CNAME selector2-example-com._domainkey.<tenant>.onmicrosoft.com.
After publishing, click “Enable” in the admin console. Microsoft validates the records before signing.
- Publish DMARC:
_dmarc.example.com IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
- Publish AutoDiscover CNAME:
autodiscover.example.com IN CNAME autodiscover.outlook.com.
- For Intune/MDM (skip if you don’t use these):
enterpriseregistration.example.com IN CNAME enterpriseregistration.windows.net.
enterpriseenrollment.example.com IN CNAME enterpriseenrollment.manage.microsoft.com.
-
For Teams federation with legacy Skype, publish the SRV records the admin console specifies. Modern Teams-only setups don’t need them.
-
Set cPanel mail routing to Remote for the domain (WHM > Email Routing > Remote Mail Exchanger). cPanel must stop accepting locally.
-
Confirm in the M365 admin console that the domain shows “Healthy” under Settings > Domains. The console queries DNS and reports any missing records.
If the customer also has Microsoft Defender for Office 365 with the “Enhanced Filtering for Connectors” feature, additional records may be needed depending on their inbound mail routing setup. Confirm with the admin console.
Stack Harbor configures Microsoft 365 DNS during onboarding and tenant migrations as part of migration solutions.