Question
How do I use the traceroute command?
Answer
Traceroute is a utility that shows the path packets take between your server and a remote server. You can use a traceroute if your server cannot reach a remote site, and the output shows you where the network packets are stopping.
Run traceroute with the host you're troubleshooting. For example:
[root@server ~]traceroute domain.tld
traceroute to domain.tld (192.0.2.2), 64 hops max, 52 byte packets
1 192.0.2.2 (192.0.2.2) 2.661 ms 1.558 ms 2.602 ms
2 hostname.domain.tld (203.0.113.2) 5.234 ms 3.985 ms 4.937 ms
By default, traceroute uses ICMP packets. Sometimes, these packets are filtered by network appliances. If you suspect the ICMP traffic is being filtered, you can use the -T flag to enable the TCP protocol and use the --port argument to a known working port on that host to see if your results change:
traceroute -T --port=80 domain.tld