Using traceroute

If you're trying to diagnose a misbehaving network or you're just plain curious about what machines handle your requests to the internet, you might be interested in a tool called traceroute.

The traceroute tool is built into almost all Linux systems, and if it doesn't ship by default you can usually install it by simply heading to your package manager and finding the traceroute package.

It's really easy to use. Simply run traceroute with the hostname or IP address you want to trace the route to. Try it with

$ traceroute

You should get an output something like this (obviously yours will be different because of your local network and/or ISP setup):

1 ( 0.729 ms 1.369 ms 1.352 ms
2 ( 50.434 ms 52.946 ms 55.861 ms
3 ( 59.389 ms 61.495 ms 64.932 ms
4 * * *
5 ( 83.176 ms 85.754 ms ( 89.267 ms
6 ( 101.859 ms 39.486 ms 39.631 ms
7 ( 170.763 ms 173.981 ms 176.658 ms
8 ( 181.201 ms 184.019 ms 187.185 ms

Each entry in the list is one of the machines your packet bounced through to get to the final destination. As you can see, for me it starts off with a local IP address,, which is the router on my LAN. Then it goes out through my ISP and bounces through a couple more locations before arriving at the destination server at the bottom.

You may notice that line 4 has no information. The way traceroute works is sort of hacky - I think it involves setting the time-to-live for packets to really low values in order to get a response back from the machines in between. It doesn't always work for every one however.

If you do get blank rows, you could always try running traceroute again a couple of times if you're desperate for the information.

There are numerous occasions where the traceroute tool can come in really handy, so it's always a good thing to have in your CLI troubleshooting toolbox when your network starts playing up!

Avatar for peter Peter Upfold -

Peter Upfold is a technology enthusiast from the UK. Peter’s interest in Linux stems back to 2003, when curiosity got the better of him and he began using SUSE 9.0. Now he runs Linux Mint 9 on the desktop, runs a CentOS-based web server from home for his personal website and dabbles in all sorts of technology things across the Windows, Mac and open source worlds.

Home » Articles »

Discussion: Using traceroute

Home » Articles » Using traceroute