Four outcomes, four different next steps
Office 365 DNS Verification Failed: Step-by-Step Fix for TXT and MX Records
Configuring a custom domain in Microsoft 365 (formerly Office 365) is required to route corporate email to Exchange Online, authenticate outbound messages via SPF and DKIM, and enable Microsoft Teams. However, administrators frequently encounter the error: 'We didn't find the DNS records you added' when clicking verify in the Microsoft 365 Admin Center.
Four outcomes, four different next steps
Phase 1: Domain Ownership TXT Verification Record
Before Microsoft 365 allows any service configuration, you must prove administrative control over the domain. Microsoft provides a unique verification token formatted as MS=msXXXXXXXX.
1. Configure Host / Name Field
Set the host field to
@or leave it empty, indicating the root zone apex. If your DNS provider does not accept@, enter your bare domain name (example.com).2. Paste the Exact Token
Paste the complete verification string into the TXT value field, including the
MS=prefix. Do not add quotes manually unless required by your provider.3. Set Minimal TTL
Set the record TTL to 300 seconds (5 minutes) so that any corrections propagate quickly.
Phase 2: Correcting Inbound MX Records for Exchange Online
Once ownership is established, Microsoft requires configuring an MX (Mail Exchanger) record to route inbound email into Exchange Online Protection.
| DNS Record Field | Required Specification | Common Administrative Error |
|---|---|---|
| Record Type | MX | Selecting TXT or CNAME by mistake |
| Host / Name | @ (or leave blank) | Entering 'mail' creates mail.example.com instead of root |
| Points to / Target | <domain-key>.mail.protection.outlook.com | Typing dots instead of hyphens in the domain prefix |
| Priority | 0 (or lowest available number) | Setting priority equal to an existing legacy mail host |
Phase 3: Autodiscover and Client Configuration CNAME
To allow Outlook on Windows, macOS, iOS, and Android to discover server endpoints automatically without manual IMAP/SMTP server configuration, Microsoft requires the autodiscover CNAME record:
Host / Name: autodiscover
Type: CNAME
Points to / Value: autodiscover.outlook.com
TTL: 3600 secondsEnsure your DNS management panel does not automatically append your domain to the Host field, which creates a broken record at autodiscover.example.com.example.com.
Phase 4: Merging SPF Records (Avoid Multiple v=spf1 Strings)
Microsoft 365 requires adding include:spf.protection.outlook.com to your domain's SPF record. If your domain already publishes an SPF record for another service (e.g., SendGrid, Salesforce, or Zendesk), do not create a second SPF record.
Under RFC 7208 Section 3.2, publishing multiple SPF records triggers an immediate PermError, causing email to fail authentication globally. Combine all authorized senders into a single record:
v=spf1 include:spf.protection.outlook.com include:sendgrid.net -allPhase 5: Configuring Dual DKIM CNAME Records
To enable DKIM signing in Microsoft 365, configure two CNAME records pointing to Microsoft's domain key infrastructure. This dual-selector architecture enables automated cryptographic key rotation:
Host: selector1._domainkey
Target: selector1-example-com._domainkey.example.onmicrosoft.com
Host: selector2._domainkey
Target: selector2-example-com._domainkey.example.onmicrosoft.comAfter publishing both CNAME records, navigate to the Microsoft Defender Security Portal > Email & Collaboration > Policies & Rules > Threat Policies > Email Authentication Settings > DKIM, select your domain, and toggle Sign messages for this domain with DKIM signatures to Enabled.
Phase 6: Teams SRV and Mobile Device Management (Intune) Records
While core mail delivery functions with MX and SPF, the Microsoft 365 Admin Center flags domain setup as incomplete unless optional unified communications and device management records are published:
| Service Name | Record Type | Host / Name | Points to / Target | Priority & Port |
|---|---|---|---|---|
| Teams / Skype Federation | SRV | _sipfederationtls._tcp | sipfed.online.lync.com | Priority: 100, Weight: 1, Port: 5061 |
| Teams SIP Client | SRV | _sip._tls | sipdir.online.lync.com | Priority: 100, Weight: 1, Port: 443 |
| Skype Discover | CNAME | lyncdiscover | webdir.online.lync.com | Standard TTL (3600) |
| Intune Device Enrollment | CNAME | enterpriseenrollment | enterpriseenrollment.manage.microsoft.com | Standard TTL (3600) |
| Intune Registration | CNAME | enterpriseregistration | enterpriseregistration.windows.net | Standard TTL (3600) |
Direct CLI Verification of All Microsoft 365 Records
Before clicking 'Check again' or 'Verify' in the admin center, run direct command-line queries to verify that every required record is answering publicly:
# 1. Verify Domain Ownership TXT:
$ dig TXT example.com +short | grep "MS=ms"
# 2. Verify Exchange Online MX Record:
$ dig MX example.com +short
# 3. Verify Autodiscover CNAME:
$ dig CNAME autodiscover.example.com +short
# 4. Verify SPF TXT:
$ dig TXT example.com +short | grep "spf.protection.outlook.com"
# 5. Verify DKIM Selectors:
$ dig CNAME selector1._domainkey.example.com +shortHybrid Deployments, Remote Routing Domains, and DNS Cutover Strategies
For enterprise organizations migrating from on-premises Microsoft Exchange Server to Exchange Online, changing the primary MX record before mailbox synchronization finishes will drop inbound messages. Microsoft Hybrid deployments solve this by introducing a secondary remote routing domain (tenant.mail.onmicrosoft.com).
In a hybrid architecture, your primary public MX record continues pointing to your on-premises edge mail transport servers or secure email gateway (SEG). The on-premises transport server forwards migrated mailboxes across an outbound TLS connector to <tenant>.mail.onmicrosoft.com. Only after the final cutover batch completes do you update your public MX record to <tenant-key>.mail.protection.outlook.com with priority 0.
# Query DNS records directly using native Windows PowerShell cmdlets:
Resolve-DnsName -Name example.com -Type TXT -Server 1.1.1.1 | Where-Object { $_.Strings -like "MS=ms*" }
Resolve-DnsName -Name autodiscover.example.com -Type CNAME -Server 8.8.8.8
# Connect to Exchange Online PowerShell to check accepted domain authentication:
# Connect-ExchangeOnline
Get-AcceptedDomain -Identity example.com | Format-List DomainName, DomainType, OutboundOnly
Get-DkimSigningConfig -Identity example.com | Format-List Domain, Enabled, StatusKey takeaway
Office 365 DNS verification fails when records have host field typos, when previous MX records are not removed, or when multiple conflicting SPF records exist. Verify record visibility in public DNS before clicking Verify.
Check your result and continue troubleshooting
Use the txt lookup tool to inspect the public DNS data relevant to this guide. Record the hostname, query type, resolver and time so you can compare results after a change. This is a DNS check, not a guarantee of worldwide propagation or successful application delivery.
For the underlying behavior and current configuration guidance, consult the official reference. Provider dashboards can change; use the values shown for your own domain rather than copying an example into production.
Need to check a domain's public DNS addresses? Use the Domain IP Lookup tool.
Free tools for this topic
Frequently asked questions
Related reading
How an email finds your mail server
Sender
you@gmail.com
MX lookup
who takes mail?
Mail server
priority 10 first
Inbox
delivered
Lowest priority number wins; higher numbers are backups
Email DNS Records Explained: MX, SPF, DKIM and DMARC
A practical guide to the DNS records email depends on, how routing and authentication work together, and what to verify after a mail migration.
How an email finds your mail server
Sender
you@gmail.com
MX lookup
who takes mail?
Mail server
priority 10 first
Inbox
delivered
Lowest priority number wins; higher numbers are backups
What Is an MX Record? How MX Records Route Email
What is an MX record? It decides where your domain's email lands: how priority numbers work, what null MX means, and the mistakes that silently lose messages.
The records you will meet in nearly every zone
SPF, DKIM and DMARC Explained: Email DNS TXT Records
Three TXT records stand between your email and the spam folder. What each one does, how to read the syntax, and the safe order to deploy them.