How to Troubleshoot DNS Resolution with Resolve-DnsName and DCDiag
Applies to: Windows Server 2019, 2022 and 2025.
DNS failures should be isolated by client configuration, authoritative data, recursion path and transport instead of fixed by indiscriminate cache flushing.
DNS and DHCP changes can interrupt authentication and remote access. Preserve console access, export current settings and test from representative clients. Managed Windows VPS services are available at managed Windows VPS hosting.
Prerequisites
- Record the failing name and expected answer.
- Identify the client DNS server list.
- Know which server is authoritative.
- Preserve error codes and timestamps.
Procedure
Step 1: Inspect client configuration
Check interfaces and resolvers.
Get-NetIPConfiguration
Get-DnsClientServerAddressStep 2: Query normally
Capture answer, server and error.
Resolve-DnsName host.corp.exampleStep 3: Query a specific server
Compare authoritative and recursive paths.
Resolve-DnsName host.corp.example -Server 192.0.2.20Step 4: Test record types and transport
Check SOA, SRV and TCP when relevant.
Resolve-DnsName -Type SOA corp.example
Resolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.corp.exampleStep 5: Run AD DNS diagnostics
Use on domain controllers.
dcdiag /test:dns /e /vVerification
Compare results from at least two expected DNS servers and review DNS event logs.
Get-WinEvent -LogName 'DNS Server' -MaxEvents 50
Resolve-DnsName netcloud24.co.uk -Server 192.0.2.20Rollback
Diagnostic commands are read-only. Reverse only the specific DNS client, zone, record or forwarder change identified as the cause.
Operational notes
A successful ping does not prove DNS health, and an ICMP failure does not prove the DNS server is unavailable.
Official references
For a hosted environment with setup and onboarding, explore our managed Windows VPS plans.
How to Install the DNS Server Role with PowerShell
How to Install the DNS Server Role with PowerShellApplies to: Windows Server 2019, 2022 and 2025.Windows DNS Server can host authoritative…
How to Create an Active Directory-Integrated DNS Forward Lookup Zone
How to Create an Active Directory-Integrated DNS Forward Lookup ZoneApplies to: Windows Server 2019, 2022 and 2025.An AD-integrated zone…
How to Create a Reverse DNS Lookup Zone and PTR Records
How to Create a Reverse DNS Lookup Zone and PTR RecordsApplies to: Windows Server 2019, 2022 and 2025.Reverse zones map IP addresses to…
How to Add and Update DNS A and PTR Records with PowerShell
An A record resolves a host name to an IPv4 address; a PTR record resolves an address back to a name. They are separate DNS objects, so…
How to Configure DNS Forwarders on Windows Server
How to Configure DNS Forwarders on Windows ServerApplies to: Windows Server 2019, 2022 and 2025.Forwarders send unresolved recursive…