If you work in IT — or even just manage your own home network — you’ve probably run a ping command at some point. But its close cousin, traceroute (or tracert on Windows), is just as useful and often overlooked.
In this guide we’ll break down exactly what each tool does, when to use them, and how to interpret the results — even if you’re new to networking.
What is Ping?
Ping is a command-line tool that sends a small packet of data (called an ICMP echo request) to a target host and measures how long it takes to get a reply back. That round-trip time is measured in milliseconds (ms).
# Windows
ping google.com
# Linux / macOS
ping -c 4 google.com
A typical ping result looks like this:
Reply from 142.250.179.46: bytes=32 time=14ms TTL=115
Reply from 142.250.179.46: bytes=32 time=13ms TTL=115
Reply from 142.250.179.46: bytes=32 time=14ms TTL=115
Reply from 142.250.179.46: bytes=32 time=15ms TTL=115
What to look for:
- Time (ms) — The round-trip latency. Under 20ms is excellent for local connections; under 100ms is fine for most internet traffic.
- Packet loss — If some replies don’t come back, you have a connectivity problem somewhere.
- TTL — Time to Live. Each router hop reduces this by 1. A consistently low TTL can indicate a routing issue.
What is Traceroute?
Traceroute (called tracert on Windows and traceroute on Linux/macOS) maps the path your data takes to reach its destination — showing every router “hop” along the way, with the latency at each point.
# Windows
tracert google.com
# Linux / macOS
traceroute google.com
Ping vs Traceroute: Key Differences
| Feature | Ping | Traceroute |
|---|---|---|
| What it tells you | Is the host reachable? How fast? | Which path does traffic take? |
| Output | Round-trip time + packet loss | Every hop with latency |
| Best for | Quick connectivity check | Diagnosing where slowdown occurs |
| Windows command | ping | tracert |
| Linux/macOS | ping | traceroute |
When to Use Ping
Use ping when you want a quick yes/no answer about connectivity, or to measure basic latency. It’s your first diagnostic step — if ping works fine but the application doesn’t, the problem is above the network layer.
- “Is this server up?”
- “Is my internet connection working?”
- “Is there packet loss to this host?”
- “What’s the latency to my cloud server?”
When to Use Traceroute
Use traceroute when ping tells you there’s a problem but you need to know where exactly it’s happening. Look for hops where latency suddenly jumps significantly — that router is your bottleneck.
Stars (* * *) in a traceroute mean that router didn’t respond — this is often normal, as many routers drop ICMP probes for security reasons. Don’t panic unless it’s the final destination showing stars.
A Practical Troubleshooting Workflow
- Ping your router (
ping 192.168.1.1) — if this fails, it’s a local network issue - Ping a public IP (
ping 8.8.8.8) — if this works but a domain doesn’t, it’s a DNS issue - Ping a domain (
ping google.com) — confirms DNS resolution is working - Run traceroute if latency is high or packets are dropping
Bonus: MTR — The Best of Both Worlds
MTR (Matt’s Traceroute) combines ping and traceroute into a real-time view, continuously sending packets and showing live latency and packet loss at every hop simultaneously — great for spotting intermittent packet loss.
sudo apt install mtr
mtr google.com
Summary
Use ping first for a fast connectivity check, then reach for traceroute (or MTR) when you need to find where in the chain things are going wrong. Both are free, built into every OS, and take less than a minute to run.