DNSSEC and SMTP DANE in Exchange Online (Microsoft 365)

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

Quick answer

Before you start

Step 1: Enable DNSSEC for the domain in Exchange Online

  1. Lower the TTL of the current MX record to the lowest value your DNS host allows (not below 30 seconds) and wait for the old TTL to pass. For example, wait one hour if the TTL was 3,600 seconds.
  2. Connect to Exchange Online PowerShell and run:
    Enable-DnssecForVerifiedDomain -DomainName contoso.com
    It 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.
  3. At your DNS host, add a new MX record pointing to that exact value, with the lowest TTL allowed (not below 30 seconds) and priority 20. Using MTA-STS? With the policy still in testing, replace the legacy mx line with the new host name and change the policy id.
  4. Test the new MX with the Inbound SMTP Email test in Microsoft's Remote Connectivity Analyzer and check that the mail exchanger ending in mx.microsoft passed. Retry if DNS caching gets in the way.
  5. Set the legacy MX (ending in mail.protection.outlook.com) to priority 30 and the new mx.microsoft MX to priority 0.
  6. Delete the legacy MX record (ending in 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]".

Step 2: Enable SMTP DANE

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.

Check the setup with Get-DnssecStatusForVerifiedDomain

$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:

MessageWhat 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 / EX013The 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 / EG002The domain isn't added to Exchange Online or isn't verified. Finish domain setup in the Microsoft 365 admin center.
DomainNotFound / PartitionNotFoundThe domain isn't an accepted domain (add it in the EAC), or DNSSEC isn't enabled yet when you run Enable-SmtpDaneInbound.

Roll back if mail flow breaks

Outbound DANE and DNSSEC error codes

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:

CodeText
4/5.7.321starttls-not-supported: Destination mail server must support TLS to receive mail.
4/5.7.322certificate-expired: Destination mail server's certificate is expired.
4/5.7.323tlsa-invalid: The domain failed DANE validation.
4/5.7.324dnssec-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.

Fixing 4.7.324 dnssec-invalid on your domain

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.

Audit hundreds of domains at once

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).

Related tools and guides

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.

FAQ

Do I need to do anything for outbound DANE in Exchange Online?

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.

What MX value do I use after enabling DNSSEC?

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.

Does Enable-DnssecForVerifiedDomain sign my own DNS zone?

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.

Can I use inbound DANE with the onmicrosoft.com domain?

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.

What is the difference between 4/5.7.324 and 4/5.4.312?

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.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.