How to Use ping and tracert to Test a Network Connection in Windows
You want to check whether your PC can actually reach a router, server or website — and if not, find out where the connection is breaking down.
Why: ping is the primary command for testing IP connectivity: it sends small ICMP echo requests and shows the replies and round-trip times. tracert goes further and lists every router (hop) between you and the destination, so you can see exactly where packets stop. Used in order, they tell you whether the problem is your PC, your router, or somewhere out on the internet.
Step 1: Open a command prompt and test with ping
Press Win + R, type cmd, and press Enter. Ping a well-known site:
ping www.microsoft.com
A healthy result looks like this — four replies with times in milliseconds:
Reply from 23.x.x.x: bytes=32 time=24ms TTL=118
Reply from 23.x.x.x: bytes=32 time=22ms TTL=118
- Replies mean your PC reached the destination and got an answer.
- Request timed out means no reply came back. On its own this isn’t always a fault — some hosts and firewalls block ping on purpose — but combined with the tests below it tells you where to look.
- If pinging an IP address works but pinging a name doesn’t, you have a name-resolution (DNS) problem, not a connection problem.
Useful options:
ping -t 192.168.1.1 (ping continuously; press Ctrl+C to stop)
ping -n 10 192.168.1.1 (send 10 requests instead of 4)
ping -a 192.168.1.20 (also resolve that IP back to a name)
Step 2: Work outward — local IP, then gateway, then internet
Test in this order so you isolate the break point. First find your gateway:
ipconfig
Note the Default Gateway (your router, usually like 192.168.1.1). Then ping each layer:
ping 127.0.0.1 (loopback — confirms the TCP/IP stack works)
ping <your-own-IP> (confirms your adapter is configured)
ping <default-gateway>(confirms you can reach the router)
ping 8.8.8.8 (confirms you can reach the internet)
The first ping that fails points at the problem: gateway fails = a local network/router issue; gateway works but 8.8.8.8 fails = the problem is upstream at your ISP.
Step 3: Trace the path with tracert
When a remote site is slow or unreachable but your gateway is fine, trace the route:
tracert www.microsoft.com
Each numbered line is one hop (router) on the way out, with three round-trip times:
1 1 ms 1 ms <1 ms 192.168.1.1
2 11 ms 13 ms 6 ms 10.x.x.x
...
17 58 ms 51 ms 52 ms 23.x.x.x
Trace complete.
- A row of asterisks (
*) means that hop didn’t reply within the timeout. A single starred hop in the middle is often just a router that ignores trace packets — not a fault. - If the trace consistently stops at one hop and never reaches the destination, that hop (or the link right after it) is where to focus.
Speed it up by skipping name lookups:
tracert -d www.microsoft.com
FAQ
Do I need to run these as administrator? No — ping and tracert work from a normal command prompt.
ping says “Request timed out” but the site loads in my browser. That’s normal — many servers and firewalls block ICMP ping while still serving web traffic. Use tracert or just the browser to confirm the site is actually reachable.
What’s the difference between tracert and pathping? tracert shows the path once; pathping runs longer and reports latency and packet loss at each hop, which is better for chasing intermittent slowdowns.
Sources: Microsoft Learn — ping · Microsoft Learn — tracert · Microsoft Learn — Guidance for troubleshooting TCP/IP communication