Fixing Exchange Server Message Queue Error “451 4.4.0 DNS query failed”

Reading Time: 4 minutes

Share:

In a recent Exchange 2010 to Exchange 2016 migration, I was doing all the standard testing for mailflow after placing a test mailbox on the Exchange 2016 server. In this environment, the private and public DNS and NAT on the firewall were still pointing to the Exchange 2010 server as it is a good idea to make sure everything is working prior to making your DNS changes. I tested the following for mail flow:

  1. Exchange 2010 -> Exchange 2016
  2. Exchange 2016 -> Exchange 2010
  3. Exchange 2010 -> External
  4. External -> Exchange 2010
  5. Exchange 2016 -> External
  6. External -> Exchange 2016

I was striking out on #1 and #6. No. 6 made sense, because for mail to come in from external it had to hit the Exchange 2010 server first, and then route to the Exchange 2016 server. If that wasn’t working then the mailflow from external to the Exchange 2016 server would not work.

Eventually the mail sent from the Exchange 2010 server to a mailbox on the Exchange 2016 server would get returned with a non delivery report (NDR) to the mailbox on Exchange 2010. Looking at the Exchange 2010 toolbox’s Queue Viewer I found this as the error:

exchange server message queue error 451 4.4.0 DNS query failed

DNS issues. I checked the local adapter DNS settings and there was a public IP address listed at the third address. As it was listed as the third entry I wouldn’t think that would have been the issue, however I removed it anways as public IP addresses should never be put on domain joined computers. They should always rely on the DNS servers (usually the Active Directory Domain Controllers) for DNS. Afterwards, from an elevated command prompt I did an “ipconfig /flushdns” and for good measure an “ipconfig /registerdns.” I restarted the Microsoft Exchange Transport service and retried the messages in the queue. Still no go.

However, Exchange doesn’t have to use the Network Adapter settings for its DNS. Inside of Exchange Management Console on the Exchange 2010 server, if you navigate to Server Configuration, Hub Transport, right click your server and go to properties; there are two DNS relevant tabs in there (External DNS Lookups and Internal DNS Lookups). The Exchange 2010 server was set to this:

exchange server message queue error 451 4.4.0 DNS query failed

exchange server message queue error 451 4.4.0 DNS query failed

So, while the network adapter card settings were correct, Exchange was configured to ignore the DNS settings for the network card and use the settings specified here. After seeing this it was obvious that this Exchange 2010 would never be able to lookup the internal FQDN of the Exchange 2016 server. I changed these two settings to use the network card DNS settings for All Available IPv4.

exchange server message queue error 451 4.4.0 DNS query failed

exchange server message queue error 451 4.4.0 DNS query failed

I applied the settings and restarted the Microsoft Exchange Transport service again. I expected messages to clear the queue, and yet, they did not!

Something’s fishy. I went to the Exchange Management Shell to see what might be going on. From there, I ran the command:

Get-TransportServer | fl *dns*

exchange server message queue error 451 4.4.0 DNS query failed

While I had changed the properties of the transport server to not use the external DNS servers, they still were set to use them! Time to try again through PowerShell.

Set-TransportServer -Identity <servername> -InternalDNSServers $null

Set-TransportServer -Identity <servername> -ExternalDNSServers $null

Check your work with the same command you used before:

Get-TransportServer | fl name, *dns*

exchange server message queue error 451 4.4.0 DNS query failed

Much better. Restart the Microsoft Exchange Transport service one more time. This time around I watched the mail start flowing out of the queue.

Other useful commands I found in troubleshooting this in the Exchange Management Shell were:

Get-queue

This would show all the Next Hop Domain identities and counts of mail in the queue and their status. Find the one where mail is building up and run this:

Get-queue -Identity <servername>\<identity> | FL

This should give more information about the mail stuck in the queue and reasons for it.

Hope this one saves you some troubleshooting time.

Have an IT issue you need helping resolving? Contact Sikich and let’s come up with a solution together.

This publication contains general information only and Sikich is not, by means of this publication, rendering accounting, business, financial, investment, legal, tax, or any other professional advice or services. This publication is not a substitute for such professional advice or services, nor should you use it as a basis for any decision, action or omission that may affect you or your business. Before making any decision, taking any action or omitting an action that may affect you or your business, you should consult a qualified professional advisor. In addition, this publication may contain certain content generated by an artificial intelligence (AI) language model. You acknowledge that Sikich shall not be responsible for any loss sustained by you or any person who relies on this publication.

SIGN-UP FOR INSIGHTS

Join 14,000+ business executives and decision makers

Upcoming Events

Upcoming Events

Latest Insights

About The Author