How to Fix Email Delivery Error 5.1.2 Bad Destination Host in Exchange
Question details
The sender requires configuration checks to resolve a 5.1.2 email delivery failure related to a bad destination host or DNS hard error.

- Product
- Microsoft 365 / Exchange Server
- Device & OS
- not provided
- Scenario
- Sending an outbound email to a specific domain or recipient address.
- Observed behavior
- The email fails to deliver and returns a bounce-back message with error code 5.1.2, indicating a bad destination host or DNS resolution failure.
Before troubleshooting, ensure you have Microsoft 365 administrator privileges, as you will need access to the Exchange Admin Center and your domain's DNS provider settings.
Verify Domain and DNS/MX Records
Ensure that the destination domain is correctly configured and that its MX records are properly published in the DNS.
A 5.1.2 error commonly occurs when the recipient's domain does not exist, is misspelled, or lacks a valid Mail Exchanger (MX) record. Verifying these records is the first step in resolving the hard DNS error.
Review the recipient's email address in your sent folder to ensure there are no spelling errors in the domain name after the @ symbol.
Use a public DNS lookup tool (such as MxToolbox) or log in to your DNS hosting provider's management portal.
Perform an MX record lookup for the destination domain to confirm that valid mail servers are returned and are currently reachable.
If the MX records are missing or invalid, contact the recipient through an alternative method to inform their IT department of the DNS configuration issue.

Run a Message Trace in Exchange Admin Center
Use the message trace tool in Microsoft 365 to gather detailed delivery routing information and analyze the affected email header.
Confirm Exchange Environment Routing Configurations
Ensure your Send Connectors are properly configured to resolve external DNS servers based on your specific deployment type.
Looking for a reliable and lightweight Office suite?
While troubleshooting Exchange routing and server issues can be complex, choosing the right productivity suite doesn't have to be. WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office, ensuring you can continue drafting documents, analyzing data, and preparing presentations without interruption.

Frequently Asked Questions
What does error code 5.1.2 mean in Exchange?
Error 5.1.2 indicates a 'Bad Destination Host' or 'DNS Hard Error'. This usually means your mail server cannot resolve the recipient's domain name in the DNS, often due to a typo in the email address, an invalid domain name, or missing MX records on the recipient's side.
Can I fix the 5.1.2 error if I am not an IT administrator?
If the error is caused by a simple typo in the recipient's email address, you can correct it and resend the email yourself. However, if the domain is typed correctly, the issue is likely related to DNS or server configurations, which requires intervention from a Microsoft 365 or IT administrator.
How long does it take for DNS changes to resolve the 5.1.2 error?
If the recipient's IT team updates their DNS or MX records to fix the issue, it can take anywhere from a few minutes to 48 hours for the changes to propagate globally across the internet before you can successfully send an email.




