keepcalculator

06 Numbers and Powers

Run Traceroute Mac: Terminal Steps & Fixes

Card No. 06·68875 · Updated · Standard formula, shown below

Running a traceroute on a Mac shows the exact path your internet traffic takes to reach a server, hop by hop, and it is done with the built-in traceroute command in Terminal. You open Terminal, type traceroute followed by a domain or IP address, and press Return; the output lists each router the data passes through, with latency times for each. This is the fastest way to diagnose where a slow connection or a website loading failure is actually happening.

What Traceroute Actually Does

Traceroute is a network diagnostic tool that maps the route from your Mac to a destination host. It works by sending a series of packets with increasing “time to live” (TTL) values. Each router that handles a packet decrements the TTL by 1; when the TTL reaches zero, the router discards the packet and sends back an ICMP “time exceeded” message. By starting with TTL=1 and incrementing it, traceroute collects the IP address of each router along the path — hop 1 is your home router, hop 2 is your ISP’s first router, and so on, until the packet reaches the destination.

On macOS, the command sends three probe packets per hop by default and displays the round-trip time for each. This gives you a latency measurement for every intermediate router, not just the final destination.

How to Run Traceroute on a Mac

  1. Open Terminal — go to Applications > Utilities > Terminal, or press Cmd+Space and type “Terminal”.
  2. Type traceroute followed by a space and the destination. Use a domain name like traceroute google.com or an IP address like traceroute 8.8.8.8.
  3. Press Return. The trace begins immediately and can take 30 seconds to a few minutes depending on the number of hops and network congestion.
  4. Wait for the command to finish — it ends when the destination responds or when the maximum hop count (default 30) is reached.

You can stop a running trace at any time by pressing Ctrl+C.

Understanding the Output Columns

The Terminal output is a table with columns that can look cryptic at first. Here is what each part means:

  • Hop number — the first column, starting at 1. This is the TTL value at which that router responded.
  • Router hostname/IP — the second column shows the reverse DNS name (if available) and the IP address of the router.
  • Three time values — these are the round-trip times in milliseconds for each of the three probe packets sent to that hop. If a probe times out, you’ll see an asterisk (*).

For example, a line like 3 core1.isp.net (203.0.113.1) 12.3 ms 11.8 ms 12.1 ms means hop 3 is a router named core1.isp.net at IP 203.0.113.1, and it responded in about 12 ms for all three probes.

Common Problems and What They Mean

  • Asterisks (*) for a hop — the probe timed out. This is common and not always a problem; many routers are configured to ignore traceroute packets. If only one or two probes time out but the next hops respond, it’s usually just packet loss or rate limiting at that router.
  • Multiple asterisks in a row — could indicate a firewall blocking ICMP, or a genuinely unreachable router. If later hops still respond, the path is fine; if the trace stops entirely, the problem is at that point.
  • High latency at one hop — a spike in milliseconds at a single hop often points to a congested or overloaded router. If the latency stays high for all subsequent hops, that router is the bottleneck.
  • Trace stops before reaching the destination — the destination may be blocking ICMP, or there is a network failure at the last visible hop. Try tracing a different destination to see if the issue is specific to one server.

Useful Traceroute Options for macOS

The default traceroute is fine for most cases, but you can adjust its behavior with flags. Type man traceroute in Terminal to see all options. The most useful are:

  • -q number — sets how many probes are sent per hop (default is 3). Use -q 1 for a quicker trace.
  • -m number — sets the maximum number of hops (default is 30). Use -m 15 to limit the trace to your ISP’s network.
  • -w seconds — sets the timeout for each probe in seconds (default is 5). Lower it to speed up a trace when many hops time out.
  • -I — uses ICMP Echo Request instead of the default UDP packets. Some destinations respond better to ICMP.

Example: traceroute -q 1 -m 20 example.com sends one probe per hop and stops after 20 hops.

Traceroute vs. Ping vs. MTR

Ping and traceroute are often confused, but they answer different questions. Ping tests connectivity to a single host and measures round-trip time — it tells you whether the destination is reachable and how fast it responds. Traceroute shows the path and where delays or failures occur along that path. If ping fails, traceroute can tell you how far the packets get before being dropped.

A more advanced tool is MTR (My TraceRoute), which combines ping and traceroute: it continuously probes each hop and shows packet loss percentages over time. macOS does not include MTR by default, but you can install it with Homebrew (brew install mtr). MTR is better for identifying intermittent packet loss because it runs continuously rather than sending just three probes per hop.

When to Use Traceroute and When Not To

Use traceroute when you need to:

  • Identify which network segment is slow or failing — your home network, your ISP, or a remote server.
  • Check if a website is slow because of routing issues rather than the website itself.
  • Verify that traffic is taking an expected path (e.g., not being routed through a distant country).

Do not use traceroute to:

  • Measure your internet speed — use a speed test for that.
  • Diagnose Wi-Fi signal issues — those are local and won’t appear in the trace until hop 1.
  • Test a server’s overall health — ping or a port check is more appropriate.

One common misconception: a high latency at a single hop does not always mean that hop is the problem. Some routers prioritize forwarding traffic over responding to traceroute probes, so their response time may be artificially high. Look at the trend across multiple hops rather than a single value.

Frequently Asked Questions

Why do I see “traceroute: command not found”?

This is rare on macOS because traceroute is preinstalled, but it can happen if your PATH environment variable is misconfigured or if you’re using a minimal shell environment. Try running /usr/sbin/traceroute with the full path. If that works, your PATH is missing /usr/sbin. You can add it in your shell profile file.

Can I run traceroute on a specific port?

Yes, but not with the standard traceroute command. macOS traceroute uses UDP with increasing destination ports by default. To test a specific port, use nc (netcat) or telnet to check if the port is open, but that won’t show the route. For a port-specific route, you’d need a tool like tcptraceroute which you can install via Homebrew.

Why does traceroute show my home router as hop 1?

Because your Mac sends packets to your router first — it’s the first device that decrements the TTL to zero. If you don’t see your router, it may be configured to not respond to ICMP time-exceeded messages, which is uncommon but possible.

Is traceroute safe to run?

Yes. Traceroute sends only a few small packets to each router and is a standard diagnostic tool used by network administrators. It does not access or modify anything on the remote systems. However, running it against a server you don’t own is fine; it’s the same as visiting the website.

Why do I get different results when I run traceroute twice?

Internet routing is dynamic. Routers exchange information and adjust paths based on congestion, outages, or policy changes. It’s normal for the path to change between runs, especially for long-distance routes. If you see major changes frequently, it may indicate an unstable network.

Can I trace a route from my Mac to a phone or another device on my LAN?

Yes, but it will only show one hop — your router — because devices on the same local network are directly connected. To see the path to a device on a different subnet, you’d need to trace from that device’s perspective. For local network diagnostics, ping is more useful.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →