📒 

A traceroute is a network diagnostic tool used to track the path that packets take from your computer to a specific destination, such as a website or server. It helps identify network latency and routing problems by displaying each hop along the path, including the time it takes for each hop to respond. Here’s how to run a traceroute on Windows, Mac, and Linux.

1. How to Run a Traceroute on Windows

Using Command Prompt

  1. Open Command Prompt:
    • Press Win + R, type cmd, and press Enter.
    • Alternatively, you can search for Command Prompt in the Start menu.
  2. Run the Traceroute:
    • Type the following command and press Enter:
      tracert example.com
    • Replace example.com with the domain name or IP address of the destination you want to trace.
  3. Review the Output:
    • The results will show a list of hops (routers) between your computer and the destination, along with the time it takes to reach each hop.

    Example:

    Tracing route to example.com [93.184.216.34]
    over a maximum of 30 hops:1 <1 ms <1 ms <1 ms 192.168.0.1
    2 10 ms 11 ms 10 ms 10.0.0.1
    3 15 ms 16 ms 15 ms isp.gateway.net [203.0.113.1]

Options for tracert on Windows:

  • -d: This option prevents tracert from resolving IP addresses to hostnames, making the results display faster.
    tracert -d example.com

2. How to Run a Traceroute on Mac

Using Terminal

  1. Open Terminal:
    • Press Command + Space to open Spotlight and type Terminal, then press Enter.
    • Alternatively, you can find Terminal in Applications > Utilities > Terminal.
  2. Run the Traceroute:
    • Type the following command and press Enter:
      traceroute example.com
    • Replace example.com with the domain name or IP address of the destination you want to trace.
  3. Review the Output:
    • The results will show each hop between your Mac and the destination, similar to the Windows output but with some differences in formatting.

    Example:

    traceroute to example.com (93.184.216.34), 64 hops max, 52 byte packets
    1 192.168.0.1 (192.168.0.1) 1.206 ms 0.930 ms 0.799 ms
    2 10.0.0.1 (10.0.0.1) 10.123 ms 10.456 ms 10.678 ms
    3 isp.gateway.net (203.0.113.1) 15.789 ms 15.012 ms 15.234 ms

Options for traceroute on Mac:

  • -n: This option prevents traceroute from resolving hostnames and displays only IP addresses.
    traceroute -n example.com

3. How to Run a Traceroute on Linux

Using Terminal

  1. Open Terminal:
    • Open the terminal by pressing Ctrl + Alt + T or finding it in your applications menu.
  2. Run the Traceroute:
    • Type the following command and press Enter:
      traceroute example.com
    • Replace example.com with the domain name or IP address you want to trace.
  3. Review the Output:
    • The results will display each hop along the path to the destination, similar to the Mac output.

    Example:

    traceroute to example.com (93.184.216.34), 30 hops max, 60 byte packets
    1 192.168.0.1 (192.168.0.1) 0.728 ms 0.457 ms 0.373 ms
    2 10.0.0.1 (10.0.0.1) 9.862 ms 9.946 ms 10.123 ms
    3 isp.gateway.net (203.0.113.1) 14.987 ms 14.123 ms 15.456 ms

Install traceroute on Linux

On some Linux distributions, traceroute may not be installed by default. If the command is not recognized, install it using the following commands:

  • Debian/Ubuntu:
    sudo apt-get install traceroute
  • CentOS/RHEL:
    sudo yum install traceroute
  • Fedora:
    sudo dnf install traceroute

Options for traceroute on Linux:

  • -n: Prevents traceroute from resolving hostnames.
    traceroute -n example.com

Understanding Traceroute Output

A typical traceroute output includes:

  • Hop Number: Each line represents a hop, starting from 1, which is your network gateway.
  • IP Address/Hostname: The IP address or hostname of the router at each hop.
  • Response Times: Three round-trip times (RTTs) to each hop, measured in milliseconds. Lower times indicate a faster response.

Common Issues and What They Mean:

  • * * * (Asterisks): Indicates a timeout, which means the router at that hop did not respond. This can happen due to packet filtering, firewalls, or network issues.
  • High Latency: If the time to a specific hop is significantly higher than others, it may indicate a network bottleneck at that point.
  • Repeated IPs: If the same IP appears repeatedly in multiple hops, it could indicate a loop in the routing path, which is usually a configuration error.

Summary

Running a traceroute is a valuable way to diagnose network issues and understand how data travels across the internet to reach a destination. By following the steps for your specific operating system—Windows, Mac, or Linux—you can easily perform a traceroute and analyze the results to identify where delays or issues may be occurring.