sodcalculator

10 Tech How-To

MacBook Traceroute: How to Run It

Guide 10-34574 · Updated · Step by step

To run a traceroute on a MacBook, open the Terminal app (in Applications/Utilities or via Spotlight) and type traceroute followed by a space and the domain name or IP address, then press Return. For example, traceroute google.com will show the path your network traffic takes to reach Google’s servers, listing each router hop with its response time.

What Traceroute Does

Traceroute is a network diagnostic tool that shows the route packets take from your Mac to a destination on the internet. It works by sending packets with increasing “time-to-live” (TTL) values. Each router that handles a packet decrements the TTL; when it reaches zero, the router sends back an ICMP “time exceeded” message. By starting with TTL=1 and incrementing, traceroute identifies each router in sequence. The output displays the hop number, the router’s IP address (or hostname if reverse DNS works), and the round-trip time in milliseconds for three probes.

How to Open Terminal and Run Traceroute

  1. Press Command + Space to open Spotlight, type “Terminal”, and press Return.
  2. In the Terminal window, type traceroute and then the destination. For example: traceroute example.com or traceroute 8.8.8.8.
  3. Press Return and wait. The command runs hop-by-hop, typically taking 10–30 seconds total.
  4. To stop early, press Control + C.

You can also use the graphical Network Utility app on older macOS versions (it was removed in Catalina), but Terminal is the standard method and works on all current versions.

Understanding the Output

Each line of output represents one router hop. The first number is the hop count (1 is your local router, usually 192.168.1.1). After that, you’ll see the IP address and hostname if available. The three numbers after the hostname are the round-trip times in milliseconds for each of the three probes. If a probe times out, you’ll see an asterisk (*) instead of a time. A line with all three asterisks means the router didn’t respond, which can happen due to firewalls or ICMP rate-limiting—it doesn’t necessarily mean a problem.

Common Options and Flags

The macOS traceroute command has several useful options:

  • -q – number of probes per hop (default is 3). Example: traceroute -q 1 google.com sends one probe per hop, making it faster.
  • -m – maximum number of hops (default is 64). Example: traceroute -m 15 google.com stops after 15 hops.
  • -w – wait time in seconds for a response (default is 5). Example: traceroute -w 2 google.com waits only 2 seconds per probe.
  • -I – use ICMP Echo Request instead of UDP datagrams. Some networks block UDP, so this can help get responses.
  • -P – use a specific destination port (default is 33434). This is rarely needed but can be used to test firewall rules.

Why Use Traceroute?

Traceroute helps identify where network latency or packet loss is occurring. If you’re experiencing slow browsing or a connection that drops, traceroute can show whether the problem is on your local network (hop 1), your ISP (hops 2–5), or a remote server (later hops). For example, if all hops after hop 3 show high latency, the bottleneck is likely between your ISP and the next network. It’s also useful for verifying that traffic is taking an expected path, such as checking if a VPN is routing correctly.

Limitations and Misconceptions

A common misconception is that traceroute shows the exact physical path of your data. In reality, it shows the logical path through routers, which can change from packet to packet due to load balancing. Also, some routers don’t respond to traceroute probes (they may block ICMP or UDP), resulting in asterisks that can be misinterpreted as failures. Additionally, the round-trip time shown includes the time for the packet to go to the router and back, not just one-way latency. For one-way latency you’d need a different tool like ping with timestamps or specialized software.

Alternatives to Traceroute

  • ping – tests reachability and measures latency to a single host, but doesn’t show the path.
  • pathping – a Windows tool that combines ping and traceroute; not available on macOS by default.
  • mtr – a more advanced tool that continuously runs traceroute and ping, showing packet loss and latency statistics in real time. Install it with Homebrew (brew install mtr).
  • Network Utility – a GUI tool on older macOS versions (pre-Catalina) that had a traceroute tab.

Frequently Asked Questions

Why does my traceroute show asterisks?

Asterisks mean the router didn’t respond within the timeout period. This is often due to firewalls that drop ICMP or UDP packets, or because the router is too busy to respond. It’s not necessarily a sign of a problem—if later hops still respond, the route is working.

Can I run traceroute on a specific port?

Yes, use the -P flag followed by the port number. For example, traceroute -P 80 example.com sends UDP packets to port 80. However, many routers don’t respond differently based on port, so this is rarely useful.

What is the difference between traceroute and ping?

Ping sends a single packet to a destination and measures the round-trip time. Traceroute sends multiple packets with increasing TTL values to map the entire path. Ping tells you if a host is reachable and how fast; traceroute tells you the route and where delays occur.

How do I stop traceroute from running?

Press Control + C in the Terminal window. This sends an interrupt signal that stops the command gracefully.

Why does traceroute take so long?

By default, traceroute sends 3 probes per hop and waits up to 5 seconds for each response. If there are 15 hops and some time out, it can take over a minute. You can speed it up with -q 1 and -w 1.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →