Troubleshoot Windows DNS Client Resolution
Before you begin
- Applies to:Windows client DNS troubleshooting.
- Where to start:Open PowerShell on the affected Windows device and inspect its active adapter and resolver before changing anything.
- What you need:Have an internal hostname and approved DNS server. Confirm whether DHCP or Group Policy supplies settings before making changes.
Guide tools
When a Windows application cannot reach a hostname, determine whether the client has the expected network configuration, whether its DNS server is reachable, and what answer the server returned. This sequence separates client configuration, transport, record, and cache problems before making changes.
Use an internal hostname and approved DNS server from your environment. Avoid changing DNS server addresses on a domain-joined device until you confirm the intended configuration source, such as DHCP or Group Policy.
Check the Address, Gateway, Suffix, and DNS Servers
ConfigurationReview the active adapter’s IPv4/IPv6 configuration and DNS suffix search list. On a domain client, verify that it is using the organization’s intended DNS resolvers rather than a public resolver that cannot answer internal zones.
Get-NetIPConfigurationGet-DnsClientServerAddress -AddressFamily IPv4Get-DnsClientGlobalSetting | Select-Object SuffixSearchList❯ Illustrative Output (Results Vary)
InterfaceAlias : EthernetIPv4Address : 10.20.30.25IPv4DefaultGateway : 10.20.30.1ServerAddresses : {10.20.30.10, 10.20.30.11}
Figure 1: Review the adapter’s DNS server assignment in Windows Settings.
Query the Intended Resolver Directly
Resolution TestQuery the name directly against the configured resolver. A timeout can indicate routing or firewall trouble; an authoritative negative answer points toward the zone or record instead. Test-NetConnection -Port 53 checks TCP port 53 only; DNS queries commonly use UDP, which the direct Resolve-DnsName test exercises.
What you should see · The intended DNS server returns the expected record for the full hostname.
If you see something else · If the query times out, check connectivity to the configured resolver before inspecting the cache. If the direct answer is correct but applications still fail, continue to Step 3.
$DnsServer = '10.20.30.10'Resolve-DnsName app01.corp.contoso.com -Server $DnsServerResolve-DnsName example.com -Server $DnsServer# Optional TCP-only check; this does not test UDP DNS.Test-NetConnection $DnsServer -Port 53❯ Illustrative Output (Results Vary)
Name Type TTL Section IPAddress---- ---- --- ------- ---------app01... A 300 Answer 10.20.40.15TcpTestSucceeded : True
Figure 2: Confirm the DNS answer and resolver reachability from PowerShell.
Inspect Cached Answers Before Flushing Them
Cache CheckInspect the client cache for the failed name and compare it with the direct resolver response. After the authoritative record is corrected, clear the local cache only if it contains a stale or negative answer, then repeat the query. Clear-DnsClientCache clears the client’s DNS cache, not just this hostname.
$CachedEntries = Get-DnsClientCache | Where-Object Entry -like '*app01*'$CachedEntries | Format-Table Entry, Type, Data, TimeToLive -AutoSize
if ($CachedEntries) { # Run after the authoritative record is corrected and the cached answer is stale. Clear-DnsClientCache Resolve-DnsName app01.corp.contoso.com} else { Write-Host 'No matching client cache entry was found.'}❯ Illustrative Output (Results Vary)
The query returns the current record after the local cache is cleared.Check the Full Name and Application Port
End-to-EndConfirm the application’s configured hostname and whether it uses a suffix. Once resolution is correct, test the actual service port separately; DNS success does not confirm that the server process or network path is accepting connections.
Test-NetConnection app01.corp.contoso.com -Port 443❯ Illustrative Output (Results Vary)
RemoteAddress : 10.20.40.15RemotePort : 443TcpTestSucceeded : TrueSee Microsoft’s DNS client troubleshooting guide for additional checks.
Your feedback keeps these production procedures accurate and battle-tested.