traceroute Command Reference: Flags, Usage & CI Examples
traceroute maps the network path and per-hop latency to a host.
traceroute shows the sequence of routers between the runner and a destination, with latency per hop. It is a diagnostic for where connectivity breaks down, not a routine check.
Common flags and usage
- -n: numeric output, skip reverse DNS (faster)
- -m <hops>: maximum number of hops
- -w <secs>: per-hop wait timeout
- -T: use TCP SYN probes (better through firewalls)
- -p <port>: destination port for TCP probes
Example
shell
traceroute -n -m 20 -w 2 api.example.comIn CI
Reach for traceroute when a job intermittently cannot reach a host and you need to see where the path stalls. Use -n to skip slow reverse-DNS and -T for TCP probes, since intermediate hops often drop the default UDP/ICMP packets.
Key takeaways
- traceroute reveals the per-hop path and latency to a host.
- It is a diagnostic for flaky connectivity, not a routine gate.
- -n speeds it up; -T traces better through firewalls.
Related guides
ping Command Reference: Flags, Usage & CI ExamplesReference for ping: -c, -W, -i, the ICMP-blocked caveat, and a CI example that checks basic host reachability…
nc (netcat) Command Reference: Flags, Usage & CI ExamplesReference for nc/netcat: -z, -v, -w, -l, the port-probe pattern, and a CI example that waits for a TCP port t…
dig Command Reference: Flags, Usage & CI ExamplesReference for dig: +short, record types, @server, +trace, and a CI example that resolves a hostname to verify…