Build tracert, pathping, traceroute and mtr commands to trace the path to any host.
A traceroute shows every router (hop) a packet passes through on its way to a destination, along with the round-trip time to each one. It is the go-to tool for finding where on a path latency spikes or packets are lost. This builder generates the correct command for whichever tool you use: tracert and pathping on Windows, or traceroute and mtr on macOS and Linux.
-I for ICMP or -T for TCP to get through firewalls that block UDP.apt install mtr or brew install mtr.| Goal | tracert | traceroute |
|---|---|---|
| Skip DNS lookups (faster) | -d | -n |
| Set max hops | -h 20 | -m 20 |
| Per-hop timeout | -w 2000 (ms) | -w 2 (sec) |
tracert -d 8.8.8.8
pathping -n -q 50 example.com
traceroute -I -m 20 example.com
mtr --report -m 20 example.comThe first traces to Google DNS without resolving hostnames. The second runs pathping with 50 queries per hop for loss statistics. The third forces ICMP on Unix to slip past UDP-blocking firewalls. The fourth runs mtr once and prints a summary report.
Each line is one hop, numbered from your router outward, with up to three round-trip samples. A jump in time that stays high on every later hop usually means real latency was added at that point. A single * * * line is often just a router that does not reply to ICMP (cosmetic, not a fault); loss that persists to the destination is the real problem. The final hop should be your target host.
pathping or mtr for flaky connections; a single tracert pass can miss intermittent loss.tracert maps the path a packet takes to a destination, listing each router (hop) along the way and the round-trip time to it. It works by sending packets with increasing time-to-live values so each router in turn reports back, which helps pinpoint where latency or packet loss occurs.
tracert prints each hop once for a quick view of the route. pathping traces the route and then pings every hop for about 25 seconds to measure per-hop packet loss, so it is better for diagnosing intermittent or flaky connections.
A star or asterisk means a router did not reply within the timeout. Many routers de-prioritize or block ICMP responses to themselves, so a single starred hop is usually cosmetic. Only loss that continues to the final destination indicates a real problem.
Add -d on Windows tracert or -n on Unix traceroute to skip reverse-DNS lookups, which often cause most of the delay. You can also lower the maximum hop count with -h or -m if you only need the early part of the path.