Diagnose Connection Problems with ping, tracert, pathping, and Test-NetConnection
Difficulty: Beginner | Time Required: 15 minutesNetwork problems can feel mysterious: a website will not load, a game disconnects, Remote Desktop fails, or a work server seems unreachable. The good news is that Windows includes several built-in tools that can quickly narrow down where the problem is happening.
In this tutorial, you will learn how to use four common Windows networking tools:
pingto test basic reachability and latencytracertto see the route your traffic takespathpingto combine route tracing with packet loss checksTest-NetConnectionto test ping, routes, and TCP ports from PowerShell
Test-NetConnection runs in Windows PowerShell.Prerequisites
Before you begin:- Use a Windows 10 or Windows 11 PC connected to your network.
- Know the target you want to test, such as:
- Your router IP address, often
192.168.1.1or192.168.0.1 - A public hostname such as
[www.microsoft.com](http://www.microsoft.com) - A server name or IP address on your local network
- Your router IP address, often
- Open either Command Prompt, Windows PowerShell, or Windows Terminal.
Tip: You do not usually need administrator rights for these basic tests. If a command fails due to policy or firewall restrictions, try again from an elevated terminal or check with your network administrator.
Step 1: Open a command window
- Right-click Start.
- Select Terminal, Windows PowerShell, or Command Prompt.
- If Windows Terminal opens, choose either Command Prompt or Windows PowerShell from the tab menu.
ping, tracert, and pathping, Command Prompt is fine. For Test-NetConnection, use Windows PowerShell.Step 2: Test basic connectivity with ping
ping sends ICMP echo requests to a destination and waits for replies. It is a quick way to check whether a device is reachable and how long the round trip takes.- In Command Prompt, type:
ping [www.microsoft.com](http://www.microsoft.com) - Review the results.
Code:
Reply from 13.107.246.45: bytes=32 time=24ms TTL=115
Reply from 13.107.246.45: bytes=32 time=23ms TTL=115
- time: Round-trip latency in milliseconds. Lower is usually better.
- TTL: Time to Live. This is mostly useful for advanced troubleshooting.
- Packets sent/received/lost: Shows whether packets were dropped.
- If you want more than the default four replies, use:
ping /n 10 [www.microsoft.com](http://www.microsoft.com) - To continuously ping until you stop it, use:
ping /t [www.microsoft.com](http://www.microsoft.com) - Press Ctrl+C to stop a continuous ping.
Note: Some servers and firewalls block ICMP traffic. A failed ping does not always mean the website or service is down.
Step 3: Compare DNS name and IP address results
If you can ping an IP address but not a hostname, the problem may be name resolution.- Ping a hostname:
ping [www.microsoft.com](http://www.microsoft.com) - Notice whether Windows resolves it to an IP address.
- If the hostname fails, try a known IP address on your network, such as your router:
ping 192.168.1.1
Tip: For local network issues, first ping your router. If your router does not respond, focus on Wi-Fi, Ethernet, adapter, or gateway settings before troubleshooting the internet.
Step 4: Trace the route with tracert
tracert shows the path traffic takes from your PC to a destination. Each line is a “hop,” usually a router or network device along the way.- In Command Prompt, type:
tracert [www.microsoft.com](http://www.microsoft.com) - Wait for the trace to complete.
- Review the hop list.
3 12 ms 11 ms 13 ms 203.0.113.1The three time columns show three round-trip measurements for that hop.
- If the command is slow because it is trying to resolve names, use:
tracert /d [www.microsoft.com](http://www.microsoft.com)
/d option skips name lookups and often returns results faster.Warning: A row of* * * Request timed outdoes not always mean failure. Some routers ignore trace requests while still forwarding normal traffic. Focus on where the trace stops completely or where latency sharply increases and stays high afterward.
Step 5: Check packet loss with pathping
pathping combines features of ping and tracert. It first finds the route, then sends multiple probes to each hop and calculates packet loss.- In Command Prompt, type:
pathping [www.microsoft.com](http://www.microsoft.com) - Be patient.
pathpingcan take several minutes because it collects statistics over time. - Review the final report.
- RTT: Round-trip time
- Lost/Sent = Pct: Packet loss percentage
- This Node/Link: Helps identify whether loss is at a router or between routers
- To skip name resolution and speed up the first part of the test, use:
pathping /n [www.microsoft.com](http://www.microsoft.com)
Note: Occasional packet loss shown at an intermediate router may not matter if later hops and the destination show no loss. Routers sometimes deprioritize diagnostic traffic sent directly to them.
Step 6: Use Test-NetConnection in PowerShell
Test-NetConnection is especially useful because it can test both basic connectivity and TCP ports. This helps answer questions like, “Can I reach the server on port 443?” or “Is Remote Desktop reachable?”- Open Windows PowerShell.
- Test basic connectivity:
Test-NetConnection [www.microsoft.com](http://www.microsoft.com) - Look for:
PingSucceeded : True - Get more detail:
Test-NetConnection [www.microsoft.com](http://www.microsoft.com) -InformationLevel Detailed
Step 7: Test a specific TCP port
A server may respond to ping but still block the service you need. For example, HTTPS uses TCP port 443.- In PowerShell, run:
Test-NetConnection [www.microsoft.com](http://www.microsoft.com) -Port 443 - Check the result:
TcpTestSucceeded : True
TcpTestSucceeded is False, possible causes include:- The service is not running on the destination
- A firewall is blocking the connection
- The port number is wrong
- A VPN or proxy is changing the route
- The destination only allows specific networks
Code:
Test-NetConnection servername -Port 80
Test-NetConnection servername -Port 443
Test-NetConnection servername -Port 3389
Test-NetConnection servername -Port 445
Step 8: Run a PowerShell route trace
Test-NetConnection can also perform a trace route.- In PowerShell, run:
Test-NetConnection [www.microsoft.com](http://www.microsoft.com) -TraceRoute - If needed, limit the number of hops:
Test-NetConnection [www.microsoft.com](http://www.microsoft.com) -TraceRoute -Hops 15
tracert formatting.Tips and troubleshooting notes
- Use
pingfirst because it is fast and simple. - Use
tracertwhen you need to see where traffic travels. - Use
pathpingwhen you suspect packet loss. - Use
Test-NetConnectionwhen you need to test a specific TCP port. - Test both a hostname and an IP address to separate DNS issues from connectivity issues.
- Compare results from Wi-Fi and Ethernet if possible.
- If only one website fails, the issue may be remote, DNS-related, or browser-specific.
- If every external destination fails but your router responds, check your modem, ISP, VPN, or DNS settings.
- If your router does not respond, troubleshoot your local adapter, cable, Wi-Fi connection, or default gateway.
Conclusion
Windows includes powerful networking tools that can help beginners diagnose connection problems without installing anything extra. By starting withping, checking the path with tracert, measuring loss with pathping, and testing ports with Test-NetConnection, you can quickly narrow down whether the issue is local, DNS-related, route-related, firewall-related, or service-specific.Key Takeaways:
pingquickly checks reachability, latency, and packet loss.tracertshows each hop between your PC and the destination.pathpinghelps identify packet loss along the route.Test-NetConnectionis ideal for testing TCP ports and PowerShell-based diagnostics.- Testing both names and IP addresses helps separate DNS problems from network problems.
This tutorial was generated to help WindowsForum.com users get the most out of their Windows experience.
Reference Metadata
Code:
references:
- title: "ping command"
publisher: "Microsoft Learn"
url: "
- title: "tracert command"
publisher: "Microsoft Learn"
url: "
- title: "pathping command"
publisher: "Microsoft Learn"
url: "
- title: "Test-NetConnection PowerShell cmdlet"
publisher: "Microsoft Learn"
url: "