Set up inbound SMTP DANE with DNSSEC for a Microsoft 365 domain with Enable-DnssecForVerifiedDomain and Enable-SmtpDaneInbound, move the MX to mx.microsoft safely, read Get-DnssecStatusForVerifiedDomain errors and fix 4.7.324 dnssec-invalid.
Home › Guides › DNSSEC and DANE in Exchange Online
Last updated 17 November 2026
Enable-DnssecForVerifiedDomain to get a new MX host under mx.microsoft (the DnssecMxValue), move your MX record to it, then run Enable-SmtpDaneInbound so Exchange Online publishes TLSA records for that host.onmicrosoft.com domain (error DomainNotSupported).DnssecMxValue. If a gateway on the outbound path resubmits mail to Exchange Online, it must look up and use the new mx.microsoft host name.testing, change the id in the _mta-sts TXT record and wait for the old max_age to pass before you start. See the MTA-STS and TLS-RPT setup guide.Enable-DnssecForVerifiedDomain -DomainName contoso.comIt can take a few minutes. On success,
Result is Success and DnssecMxValue holds the new MX host, for example contoso-com.o-v1.mx.microsoft.mx line with the new host name and change the policy id.mail.protection.outlook.com) to priority 30 and the new mx.microsoft MX to priority 0.mail.protection.outlook.com, mail.eo.outlook.com or mail.protection.outlook.de) and raise the TTL of the mx.microsoft record to 3,600 seconds. Optionally run the Remote Connectivity Analyzer DNSSEC test, choosing "DNSSEC Validation", not "DANE Validation [including DNSSEC]".Enable-SmtpDaneInbound -DomainName contoso.com
Exchange Online then publishes the TLSA records, which Microsoft says can take 15 to 30 minutes. It hosts several TLSA records, and some are expected to fail validation; as long as one passes, DANE is set up correctly. If you use MTA-STS, set the policy back to enforce and change the id once mail flows. Check the state with Get-SmtpDaneInboundStatus -DomainName contoso.com.
$r = Get-DnssecStatusForVerifiedDomain -DomainName contoso.com $r.DnssecFeatureStatus; $r.DnsValidation; $r.ExpectedMxRecord.Record; $r.MxValidation; $r.MtaStsValidation
The cmdlet checks that the DNSSEC-secured MX record is present, its priority, and that the MTA-STS policy (if any) lists the mx.microsoft host. -SkipDnsValidation, -SkipMxValidation and -SkipMtaStsValidation skip those checks. Microsoft's pages aren't consistent on the priority number: the setup steps end at 0, while the cmdlet reference example shows 10. Follow what the cmdlet reports for your domain. Messages you may see:
| Message | What Microsoft says to do |
|---|---|
| ED003: Domain found. No authentic MX records found. | No MX resolving to a DNSSEC-secured A record was found. Check the MX configuration and retry (DNS propagation can take up to 48 hours with some providers). |
| EX002: Value of MX record didn't match the expected one. | Make sure one MX record matches the value returned by Enable- or Get-DnssecStatusForVerifiedDomain. |
| EX003: Priority of MX record did not match the expected one. | Set the mx.microsoft MX to priority 0. |
| EX004: There is a different MX record with same preference as the expected one. | Finish the priority switch so the expected MX is highest, validate, then delete the legacy MX. |
| EX005: There is a different MX record with lower preference than the expected one. | Delete the legacy MX record. |
| EX007 / EX012 / EX013 | The expected MX record wasn't found. Add the exact value the cmdlet returns. |
| ES001: Expected MX record missing in policy while mode is enforced. | Set the MTA-STS policy to testing and add the mx.microsoft host as an mx line. |
| ES002: No expected MX record found to compare policy with. | Complete the inbound SMTP DANE with DNSSEC setup first. |
| EG001 / EG002 | The domain isn't added to Exchange Online or isn't verified. Finish domain setup in the Microsoft 365 admin center. |
| DomainNotFound / PartitionNotFound | The domain isn't an accepted domain (add it in the EAC), or DNSSEC isn't enabled yet when you run Enable-SmtpDaneInbound. |
Disable-SmtpDaneInbound -DomainName contoso.com.<MX token>.mail.protection.outlook.com at priority 20 (for contosotest.com the token is contosotest-com), confirm it with the Remote Connectivity Analyzer, run Disable-DnssecForVerifiedDomain -DomainName contoso.com, delete the mx.microsoft MX and leave the mail.protection.outlook.com MX as the only one, at priority 0.When Exchange Online sends to a domain that uses DANE, failures show up in message trace details, in NDRs and in the Remote Connectivity Analyzer:
| Code | Text |
|---|---|
| 4/5.7.321 | starttls-not-supported: Destination mail server must support TLS to receive mail. |
| 4/5.7.322 | certificate-expired: Destination mail server's certificate is expired. |
| 4/5.7.323 | tlsa-invalid: The domain failed DANE validation. |
| 4/5.7.324 | dnssec-invalid: Destination domain returned invalid DNSSEC records. |
Microsoft notes a known limitation: when a domain signals DNSSEC support but fails the checks, Exchange Online currently returns the generic 4/5.4.312 DNS query failed rather than 5.7.324. Run the Remote Connectivity Analyzer DANE test against the domain to see whether it is a DNSSEC problem.
If senders on Exchange Online get 4.7.324 for mail to you, Microsoft lists these causes for a zone that used to pass:
Receiving domains can also get reports from senders by publishing a TLS-RPT record; build one with the TLS-RPT Record Generator.
Need SPF, DMARC and MX checks across a whole client list? Run the Bulk SPF / DMARC / MX Auditor on Apify ($2 per 1,000 domains).
Check your zone with the DNSSEC Checker, confirm the MX switch with the MX Record Lookup, test your MTA-STS policy with the MTA-STS Checker, keep the cmdlets in the PowerShell Cheat Sheet, confirm the tenant with the M365 Tenant Lookup and read NDRs in the Email Header Analyzer. Related guides: Fix DNSSEC SERVFAIL (broken chain of trust), MTA-STS and TLS-RPT setup and Exchange Online 4.4.7 message expired.
No. Microsoft says outbound SMTP DANE with DNSSEC is on by default for all Exchange Online customers and is used whenever the destination domain advertises DANE support. There is no tenant-level opt-out.
The exact DnssecMxValue that Enable-DnssecForVerifiedDomain returns (Get-DnssecStatusForVerifiedDomain shows it again), for example contoso-com.o-v1.mx.microsoft. It replaces the record ending in mail.protection.outlook.com.
No. It provisions the new mx.microsoft host for inbound mail. Your own zone is signed (or not) by your DNS host, and Microsoft lists enabling DNSSEC for your domain as a prerequisite for the full security benefit.
No. Microsoft says the tenant's onmicrosoft.com domain and self-service sign-up domains are not currently supported; the cmdlets return DomainNotSupported for onmicrosoft.com.
4/5.7.324 dnssec-invalid means the destination domain indicated it is DNSSEC-authentic but Exchange Online could not verify it. Microsoft notes that today such failures often show up as the generic 4/5.4.312 DNS query failed, so test the domain with the Remote Connectivity Analyzer DANE test to tell them apart.
Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.