User Agents

Web browsers and everyday web tech, explained

Bad Destination Host DNS Hard Error: Causes and Fixes

· 5 min read · How the Web Works

In this article
  1. How to Pin Down Which Kind of DNS Failure You Have
  2. Is This Error Ever Normal?
  3. What If the Address Is Mistyped?
  4. What If the Recipient Domain Has No MX Records?
  5. What If Your Own DNS Resolver Is the Problem?
  6. How to Stop This Bounce From Coming Back
  7. A Quick Checks List Before You Resend
  8. What the Bounce Code Next to the Message Tells You

"Bad destination host DNS hard error" is an email bounce message: the mail server that was sending your message could not look up the recipient's domain in DNS, so it gave up and returned the message. It usually points to a typo in the address, a missing or expired MX record on the receiving domain, or a DNS problem on the sending side.

Time 15 min · Steps 5 · Level Easy

How to Pin Down Which Kind of DNS Failure You Have

  1. Re-read the full bounce message. Look for the recipient address, a three-digit code such as 5.0.0 or 5.4.4, and the line containing "bad destination host DNS hard error". The address and code tell you which side failed.
  2. Check the spelling of the domain. Everything after the @ sign must match the recipient's real domain exactly; a single wrong letter produces this exact error.
  3. Look up the domain's MX records. Run nslookup -type=mx example.com in a terminal or command prompt. No MX records returned means the receiving domain cannot accept mail.
  4. Test from a different network. Send to the same address from another connection, such as mobile data instead of home broadband. If it goes through, the problem is your network's DNS resolver.
  5. Resend once, later. If the domain recently moved mail providers, its DNS records may still be spreading. Waiting a few hours and resending often clears it.

Is This Error Ever Normal?

A soft DNS failure, where the sending server retries for hours before giving up, is often temporary and fixes itself. A "hard" error is not normal: the sending server did a definitive lookup, got a firm "no answer" or "no such host", and bounced the message immediately. The mail did not reach the recipient, and resending the identical message to the identical address will fail the same way until the underlying cause is fixed. Treat this error as a broken address or a broken DNS record, not as a delay.

What If the Address Is Mistyped?

This is the most common cause and the easiest to confirm. Compare the domain after the @ sign, letter by letter, with the address the recipient actually gave you. Common slips include .con instead of .com, a doubled letter, or an outdated domain after a company renamed its email. Confirm it by asking the recipient through another channel, or by checking that the domain's website loads in a browser. The fix is simply to correct the address and resend. If the domain's website also fails to load, the domain itself may have expired, and no spelling correction will help.

What If the Recipient Domain Has No MX Records?

Mail can only be delivered to a domain that publishes MX records, the DNS entries that say which servers accept its mail. Confirm by running nslookup -type=mx example.com (replace example.com with the real domain). If the answer comes back empty or lists no mail servers, the recipient's domain is not accepting email at all. This happens when a domain has expired, when a business shut down its mail service, or when an administrator forgot to restore MX records after a migration. There is nothing you can fix on your side; contact the recipient another way and tell them their domain's mail records are missing. If you administer the domain yourself, add the MX records your mail provider specifies, then allow up to 48 hours for them to spread across DNS before retesting.

What If Your Own DNS Resolver Is the Problem?

Sometimes the address is fine and the records exist, but the sending server's resolver cannot reach them. Confirm it by sending the same message from a different network or a different mail account: if the second attempt delivers, your side is at fault. On a home or office network, restart the router to flush its DNS cache, then try again. On Windows you can clear the local cache by opening a command prompt and running ipconfig /flushdns; on macOS the equivalent is sudo dscacheutil -flushcache followed by sudo killall -HUP mDNSResponder. Switching your device's DNS to a public resolver such as Google DNS or Cloudflare DNS in your network settings can also route around a faulty resolver. If you use a mail provider rather than your own server, this cause is rare, because the provider's resolvers do the looking up, not your computer.

How to Stop This Bounce From Coming Back

Prevention is mostly about keeping addresses and records healthy. Verify a new correspondent's address the first time you send to it, ideally by confirming the spelling in writing. If you run your own domain, set a calendar reminder ahead of its renewal date so it never lapses, keep MX records matching your mail provider's current settings, and lower the DNS record's time-to-live value a day or two before a planned mail migration so changes spread quickly. After any DNS change, test with an nslookup -type=mx check before announcing the new address. On the sending side, keep your router's firmware current and note which resolver your network uses, so a repeat failure is quick to diagnose.

A Quick Checks List Before You Resend

  • Domain after the @ sign spelled exactly as given, with no trailing spaces or punctuation.
  • The domain's website loads in a browser.
  • nslookup -type=mx example.com returns at least one mail server.
  • The same message sends successfully from another network or account.
  • At least a few hours have passed since any recent DNS change on the recipient's domain.
  • The bounce code noted, so you can report it to the recipient's administrator if the problem persists.

What the Bounce Code Next to the Message Tells You

The error usually appears with an enhanced status code. 5.4.0 or 5.4.4 points to a directory or DNS lookup failure on the receiving side, which fits a missing MX record or a dead domain. 5.1.2 means the destination address is bad in a way DNS could not resolve, which fits a typo. 4.x.x codes are temporary and mean the server will retry on its own, so waiting is a real fix there. Match the code in your bounce to one of these before choosing a fix, and if the code is 5.1.2, start with the spelling check because it resolves most cases fastest.

Official source: Microsoft Support