HostArmada Web Hosting Knowledge Base

Knowledge is power! Use that power and achieve total and unconditional control over the Web Hosting Services!

The traceroute command.

If you are ever facing connectivity issues or you feel like a network is not operating at full capacity, the traceroute utility could help you troubleshoot this concern.

The command outlines the route of a packet which your server sents towards a destination server you believe is causing problems. This command-line interface tool typically does 30 hops. Each hop will include 3 probes that are sent from your server that will attempt to elicit the ICMP TIME_EXCEEDED response from the destination server. Receiving this response means the address was reached, and the traceroute will continue with the successive hop until it completes all of them. If no response is obtained within 5 seconds (this time can be increased), the command will return an asterisk "*" for the packet.

In this article, we will explore a few options of this command and hopefully give you the means of being able to troubleshoot a connectivity issue should you be faced with it. The only mandatory information you would need to provide to the command is the IP/hostname/domain name:

traceroute <IP/Hostname/Domain name> 

As explained in the beginning, this will send three probes with a different time interval between them (usually 1 second), which will attempt to trigger the needed response from each internet node along its path to the destination server. Up 30 hops will be done, however, this can vary based on the nodes necessary to reach the destination. For example, if there are only 5 or 6, it will only bounce 5 or 6 times.

Here is an example of a traceroute to google.com:

[[email protected] ~]# traceroute google.com
traceroute to google.com (172.217.18.174), 30 hops max, 60 byte packets
 1 139.162.128.3 (139.162.128.3) 0.963 ms 0.958 ms 1.017 ms
 2 139.162.129.16 (139.162.129.16) 0.473 ms 139.162.129.14 (139.162.129.14) 0.441 ms 0.464 ms
 3 de-cix.fra.google.com (80.81.193.108) 0.898 ms 0.897 ms 139.162.129.9 (139.162.129.9) 0.423 ms
 4 108.170.252.1 (108.170.252.1) 1.589 ms de-cix.fra.google.com (80.81.193.108) 0.908 ms 108.170.251.129 (108.170.251.129) 0.687 ms
 5 108.170.252.1 (108.170.252.1) 1.568 ms 1.667 ms 74.125.37.197 (74.125.37.197) 0.790 ms
 6 74.125.37.197 (74.125.37.197) 0.844 ms fra15s29-in-f14.1e100.net (172.217.18.174) 0.821 ms 0.771 ms

The first column will show the number of hops. The second column will display the IP address of the hop, followed by the three separated times in milliseconds.

To start the process from a specific hop, instead of the first, please use the "-f " flag.

[[email protected] ~]# traceroute -f 3 google.com
traceroute to google.com (172.217.16.142), 30 hops max, 60 byte packets
 3 139.162.129.9 (139.162.129.9) 0.570 ms de-cix.fra.google.com (80.81.193.108) 0.626 ms 0.621 ms
 4 de-cix.fra.google.com (80.81.193.108) 0.687 ms 108.170.252.1 (108.170.252.1) 1.665 ms 108.170.251.129 (108.170.251.129) 0.560 ms
 5 66.249.95.169 (66.249.95.169) 1.672 ms 108.170.252.1 (108.170.252.1) 1.657 ms 108.170.251.129 (108.170.251.129) 0.642 ms
 6 66.249.94.245 (66.249.94.245) 1.627 ms zrh04s06-in-f142.1e100.net (172.217.16.142) 0.669 ms 0.645 ms

To define the max number of hops traceroute will perform, please use the "-m" option.

[[email protected] ~]# traceroute -m 2 google.com 
traceroute to google.com (172.217.16.142), 2 hops max, 60 byte packets
1 139.162.128.2 (139.162.128.2) 0.523 ms 0.619 ms 0.775 ms
2 139.162.129.12 (139.162.129.12) 0.434 ms 0.408 ms 139.162.129.10 (139.162.129.10) 0.559 ms

If you want to remove the IP address to hostname/domain name resolution, use the "-n" flag.

[[email protected] ~]# traceroute -n google.com
traceroute to google.com (172.217.18.174), 30 hops max, 60 byte packets
 1 139.162.128.3 0.586 ms 0.730 ms 0.967 ms
 2 139.162.129.16 0.524 ms 139.162.129.14 0.520 ms 139.162.129.16 0.514 ms
 3 80.81.193.108 0.643 ms 0.643 ms 139.162.129.9 0.444 ms
 4 108.170.251.129 0.535 ms 108.170.252.1 1.457 ms 108.170.251.129 0.584 ms
 5 74.125.37.197 0.743 ms 108.170.251.129 0.642 ms 0.594 ms
 6 172.217.18.174 0.680 ms 0.704 ms 74.125.37.167 0.801 ms

Lastly, to change the number of probes sent, you can use the "-q " flag:

[[email protected] ~]# traceroute -q 5 google.com
traceroute to google.com (172.217.18.174), 30 hops max, 60 byte packets
 1 139.162.128.3 (139.162.128.3) 0.663 ms 0.717 ms 1.526 ms 1.524 ms 1.519 ms
 2 139.162.129.14 (139.162.129.14) 9.537 ms 139.162.129.16 (139.162.129.16) 0.511 ms 0.505 ms 139.162.129.14 (139.162.129.14) 9.519 ms 9.514 ms
 3 de-cix.fra.google.com (80.81.193.108) 0.672 ms 0.675 ms 139.162.129.9 (139.162.129.9) 0.409 ms 0.424 ms 0.419 ms
 4 de-cix.fra.google.com (80.81.193.108) 0.656 ms 108.170.251.129 (108.170.251.129) 0.588 ms 108.170.252.1 (108.170.252.1) 1.409 ms de-cix.fra.google.com (80.81.193.108) 0.601 ms 0.586 ms
 5 74.125.37.167 (74.125.37.167) 0.869 ms 108.170.252.1 (108.170.252.1) 1.324 ms 74.125.37.197 (74.125.37.197) 0.699 ms 108.170.251.129 (108.170.251.129) 0.585 ms 74.125.37.167 (74.125.37.167) 0.718 ms
 6 74.125.37.197 (74.125.37.197) 0.747 ms fra15s29-in-f14.1e100.net (172.217.18.174) 0.627 ms 0.626 ms 74.125.37.197 (74.125.37.197) 0.713 ms fra15s29-in-f14.1e100.net (172.217.18.174) 0.638 ms

Was this article useful and on point?

Find out more about HostArmada entire range of optimized Web Hosting Services and take action today on improving your website Loading Speed, Security, and overall Stability!