Exchange Queue Error: 451 4.4.0 dns query failed. the error was dns query failed with error ErrorRetry

Scenario:  You receive complaints that users are experiencing the following symptoms with their Exchange 2013 mailbox:

  • Outlook:  Messages are getting stuck in the OutBox when sending
  • OWA: Messages are getting stuck in the Drafts Folder when sending

During investigation, you run this command: get-queue -server ExMbx1 | FL Identity, Status, MessageCount, LastError and find all of the queues on that transport server have a high MessageCount and this LastError:  451 4.4.0 dns query failed. the error was dns query failed with error ErrorRetry

You have verified your DNS settings on the network adapter are correct and you were successful at using NSLOOKUP to resolve the MX record of one of the domains that you are having trouble with (instructions below on how to do this).

NSLOOKUP instructions:
1. From command line, type nslookup
2. set q=mx    (or  set type=mx)

Cause:  Exchange transport service allows you to set and use external and internal dns servers different from network card dns settings. Internal DNS server setting was pointing to dns servers that were decommissioned

Solution:  Remove the custom DNS entries in Exchange. This makes Exchange use the network adapters DNS. Follow the steps below to resolve via EAC or PowerShell

Via EAC:
1. Once in EAC/ECP, navigate to Servers and open the server properties.
2. Click on DNS Lookups.
3. Make sure the Internal and External DNS lookups are set correctly.  The internal and External DNS settings need to match DNS setting on the network card IP configuration. Type the current DNS settings or leave it blank. Blank forces Exchange transport service to use network card DNS setting

Via Shell:
1. Use get-transportserver ExMbx1 | FL *DNS* to verify your settings.
2. You want to use the set-transportserver command to set it back to all network adapters or change the custom IP Range.

For Example:  You may wish to change the Internal DNS to use all network adapters and not custom by running:
set-transportserver ExMbx1 -InternalDNSProtocolOption Any

OR type the following to set it to Null

set-transportserver ExMbx1 -InternalDNSServers $null