traceroute
Networking
Usage
traceroute -n <host>Lists the routers a packet passes on the way to a destination; a `* * *` line in the middle does not mean the path is broken, only that that router declines to answer.
Common flags
| Flag | Meaning |
|---|---|
| -n | Skip reverse DNS, which makes it much faster. |
| -m 20 | Stop after twenty hops instead of the default thirty. |
| -q 1 | One probe per hop instead of three. |
| -w 1 | Wait one second per probe. |
| -I | Use ICMP echo instead of UDP; needs root. |
| -T -p 443 | Use TCP to a real port, which firewalls usually let through (Linux). |
Examples
traceroute -n 8.8.8.8The path packets take, without name lookups.
sudo traceroute -T -p 443 example.comTrace over TCP 443 when UDP probes are blocked (Linux).
When a connection fails, these narrow down how far it got — name not resolving, no route, or a blocked port.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does traceroute do?
Lists the routers a packet passes on the way to a destination; a `* * *` line in the middle does not mean the path is broken, only that that router declines to answer.
Q. How do I type it?
traceroute -n <host> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
6 are listed here; the full set is in man traceroute. This command sits under Networking.
Related commands
man page: man traceroute