Pcornel
Windows

Network Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=3095

Back to the Topic

Answer

Network troubleshooting on Windows checks IP configuration, gateway and DNS, then connectivity and ports with PowerShell and the classic tools, and finally the traffic itself with a packet capture.

Remember

Test-NetConnection tests a TCP port and shows the source interface and address used. Resolve-DnsName asks DNS directly; ping by name goes through the full resolver, including the hosts file and cache. The Windows firewall profile (Domain, Private, Public) decides which rules apply.

First checks

  • ipconfig /all — address, mask, gateway, DNS servers, DHCP.
  • Test-NetConnection <host> -Port <port> -InformationLevel Detailed — TCP port test with route and source.
  • Resolve-DnsName <name> — DNS answer and which server gave it.
  • tracert -d <dst> — the path without name lookups.
  • Get-NetTCPConnection -State Listen -LocalPort <port> — is a service listening?
  • Get-NetConnectionProfile — network category, which selects the firewall profile.

Commands

pathping
Trace a route and measure loss per hop.
Test-NetConnection
Test TCP connectivity, DNS and route to a host from PowerShell.
netstat
Display network connections and listening ports.
arp
Display or change the ARP cache on Windows.
Resolve-DnsName
Query DNS from PowerShell, with record type and server options.
pktmon
Capture packets on Windows with the built-in packet monitor.
Get-NetTCPConnection [-LocalPort <port>]
Display TCP endpoints/state.
Test-NetConnection {{host}} -Port {{port}} -InformationLevel Detailed
Tests name resolution/route/TCP connectivity and returns structured details.
route print
Display the Windows routing table.
ping
Send ICMP echo requests from Windows.
tracert
Trace the path to a destination from Windows.
nslookup
Query DNS servers from Windows.
Get-NetTCPConnection
Inspect Windows TCP connection state and endpoints.
Get-NetTCPConnection | Sort-Object State,RemoteAddress
Inspect TCP endpoints and local socket state.
tracert -d

Verify in this order

address from DHCP or static → gateway reachable → DNS resolves → route to the destination → TCP port opens → (inbound: service listening and firewall rule for the active profile)

Where it usually breaks

First mismatch in host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3095

Confirmation

Confirm action

Continue?