What is the Linux command for display the route taken to a website?

  • 1
    Why do you need this info? Are you the person responsible for the network infrastructure? – dbasnett Nov 24 '11 at 13:28
  • For detecting flaky network problems with my ISP, and yes, I maintain all the machines on my network. – kfmfe04 Nov 24 '11 at 13:31
  • So all you really need to test is that you reach the ISP's gateway successfully. – dbasnett Nov 24 '11 at 13:36
  • Which would be correct, if your assumption that my flaky third-world ISP is competent in routing around network problems is accurate. In any case, traceroute helps let me know what is going on. – kfmfe04 Nov 24 '11 at 13:42
  • Sometimes knowing makes us feel better. My US ISP is not very large and in the beginning there were a lot of problems, I have a 3 hop WIFI connection to their main site. I found out that reporting that I couldn't ___________ (browse, receive emails, etc.) was really all they wanted to know. Maybe your ISP is different and wants your insights into how their network appears to work. – dbasnett Nov 24 '11 at 13:56

traceroute. See here for all the options.

EDIT: Essentially, when your computer wants to visit a web page, there is generally no direct path that you can take, and it must go through a series of hops. When you run the traceroute command, it simply prints the hops. Usually, this process takes fractions of a second, but sometimes, if there is a failure point, it may never complete.

In those cases, traceroute is used to figure out the point of failure. One will see the hops made, and can in many cases conclude that it is the fault of the last hop. Unfortunately, if there were a way around this failed node, it most probably would have been found by the routing algorithm itself, so generally you just have to wait for someone to fix the server.

| improve this answer | |
  • Care to elaborate on what it does? – Ivo Flipse Nov 24 '11 at 15:49
  • @IvoFlipse done, sorry about that. – soandos Nov 24 '11 at 16:49
  • 1
    Much better now +1 – Ivo Flipse Nov 24 '11 at 16:57
  • BTW tcp doesn't find routes its done on the layer below it. – squareborg Nov 24 '11 at 16:58
traceroute www.google.com

Note that large sites like Google use a content distribution network (CDN) so may dynamically route requests to different server pools depending on load. So it isn't definite that a traceroute will follow the same path, but likely if done near to the time the page was loaded.

| improve this answer | |
  • If the traceroute is using multiple tries at each TTL value it isn't even certain that those will take the same route. Also, it isn't uncommon for ICMP to be given a lower priority, so the results are close to meaningless. – dbasnett Nov 24 '11 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.