How do I display the route to a website (eg www.google.com)?

5,977

Solution 1

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.

Solution 2

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.

Share:
5,977

Related videos on Youtube

kfmfe04
Author by

kfmfe04

Updated on September 18, 2022

Comments

  • kfmfe04
    kfmfe04 over 1 year

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

    • dbasnett
      dbasnett over 12 years
      Why do you need this info? Are you the person responsible for the network infrastructure?
    • kfmfe04
      kfmfe04 over 12 years
      For detecting flaky network problems with my ISP, and yes, I maintain all the machines on my network.
    • dbasnett
      dbasnett over 12 years
      So all you really need to test is that you reach the ISP's gateway successfully.
    • kfmfe04
      kfmfe04 over 12 years
      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.
    • dbasnett
      dbasnett over 12 years
      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
    dbasnett over 12 years
    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.
  • Ivo Flipse
    Ivo Flipse over 12 years
    Care to elaborate on what it does?
  • soandos
    soandos over 12 years
    @IvoFlipse done, sorry about that.
  • Ivo Flipse
    Ivo Flipse over 12 years
    Much better now +1
  • squareborg
    squareborg over 12 years
    BTW tcp doesn't find routes its done on the layer below it.