How to run a traceroute on Windows, macOS or Linux

traceroute is a diagnostic tool that traces the path data takes from your computer to a destination, such as a web server, across the internet. It helps identify where delays or connectivity issues occur, which is particularly useful when troubleshooting slow or unresponsive websites.

While it’s easy to assume that a website’s slowness is due to the server itself, the issue could also lie somewhere along the network path between your computer and the server. A traceroute helps pinpoint the exact location of the problem.

Run a traceroute on Windows

1. Start by opening a command prompt window by pressing the Windows + R and enter cmd after press enter an the command prompt window will appear.

2. Now, type the following command in replacing the IP shown with what you want to traceroute (hostname, IP, domain).

tracert 192.168.1.1

3. Finally, as an example we this is the output from that command to google.com showing a successful test.

C:\Users\user>tracert google.co.uk

Tracing route to google.co.uk [142.250.187.195]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2    13 ms    10 ms     9 ms  192.168.1.1
  3    18 ms    27 ms    15 ms  192.168.1.1
  4    18 ms    17 ms    17 ms  74.125.146.216
  5    19 ms    17 ms    24 ms  209.85.248.229
  6    19 ms    25 ms    27 ms  142.251.54.33
  7    19 ms    20 ms    15 ms  lhr25s33-in-f3.1e100.net [142.250.187.195]

Trace complete.

Running a Traceroute on Mac

  1. Open the terminal application, you can find this in applications > utilities.
  2. Inside the terminal window enter traceroute followed by the destination name.
  3. Finally, you should see the traceroute output after pressing enter.

Running a Traceroute on Linux

1. To start open a terminal window, this should be in the applications folder depending on your chosen distribution.

2. [OPTIONAL] You can choose to install MTR (My Traceroute) at this stage which is a more powerful network tool or continue using traceroute (if installed). To install MTR you will need to install it with your package manager for example for yum this would be yum install mtr -y.

3. Now, enter either command below with your destination address specified and press enter.

mtr google.co.uk
    traceroute google.co.uk

    4. Finally, you will be able to view the out put of those commands.

    Understanding Traceroute Results

    When you access a website, the data from your computer hops between points on its journey. This journey begins at your home router, moves through your Internet Service Provider (ISP), and traverses the internet until it reaches the destination server.

    In the traceroute results, each line corresponds to a hop and provides the following details:

    1. Hop Number: The sequential (0, 1, 2, 3, etc) position of the hop in the route.
    2. Round-Trip Times (RTT): The time (in milliseconds) it takes for packets to travel to the router and back. Three times are displayed because traceroute sends three packets for consistency.
    3. Domain Name and IP Address: The router’s domain name (if resolvable) and its IP address.

    Now, let’s break down the example from earlier to understand what’s happening.

    C:\Users\user>tracert google.co.uk
    
    Tracing route to google.co.uk [142.250.187.195]
    over a maximum of 30 hops:
    
      1    <1 ms    <1 ms    <1 ms  192.168.1.1
      2    13 ms    10 ms     9 ms  192.168.87.123
      3    18 ms    27 ms    15 ms  192.168.56.78
      4    18 ms    17 ms    17 ms  74.125.146.216
      5    19 ms    17 ms    24 ms  209.85.248.229
      6    19 ms    25 ms    27 ms  142.251.54.33
      7    19 ms    20 ms    15 ms  lhr25s33-in-f3.1e100.net [142.250.187.195]
    
    Trace complete.

    The first line is showing the latency between you and your home network which is below 1ms (ultra low latency), this is then followed by the first outbound connection (usually your ISPs router) which is slower. It is normal to see increased latency between hops so don’t worry.

    What you should keep an eye out for is timeouts for example:

    Tracing route to google.co.uk [142.250.187.195]
    over a maximum of 30 hops:
    
      1    <1 ms    <1 ms    <1 ms  192.168.1.1
      2     *        *        *     Request timed out.

    This indicates that the traceroute request timed out at that specific hop. However, this is not necessarily a cause for concern, as it can occur for several reasons, especially if the traceroute continues successfully beyond this point. If the traceroute gets stuck at this hop and does not proceed further, it could suggest a potential issue, such as a network block or a local firewall restriction.