traceroute - macOS


The traceroute command traces the route taken by packets from the local host to a specified destination. It sends packets with progressively increasing Time to Live (TTL) values and prints the addresses of the routers that return ICMP Time Exceeded messages. This helps identify the path taken by network traffic and troubleshoot network connectivity issues.


traceroute [options] destination


| Option | Description |
| -n | Disable name resolution for IP addresses. |
| -s source-ip | Set the source IP address for tracing. |
| -d | Set the Don’t Fragment (DF) bit in the IP header. |
| -t protocol | Specify the protocol to use for tracing (udp, tcp, icmp). |
| -p port | Specify the port to use for tracing (UDP or TCP). |
| -P | Disable ICMP port/protocol unreachable messages. |
| -I interface | Specify the interface to use for sending packets. |
| -m ttl | Set the maximum TTL to use for tracing. |
| -f first-ttl | Set the first TTL to use for tracing. |
| -T | Trace only the first hop. |
| -L | Trace only the last hop. |
| -v | Increase verbosity (multiple times for more verbosity). |
| -h | Display help and usage information. |


  • Trace the route to
  • Trace with DNS resolution disabled:
traceroute -n
  • Trace using port 8080:
traceroute -p 8080
  • Trace the maximum of 30 hops:
traceroute -m 30

Common Issues

  • “Could not resolve host” error: Ensure that DNS resolution is enabled (-n) or that the IP address is specified directly.
  • “Permission denied” error: Ensure that the user has permission to send packets from the specified interface (-I).
  • No response from hops: Consider increasing the maximum TTL (-m) or using another protocol (-t).
  • Incomplete trace: Some routers may not respond to ICMP Time Exceeded messages.
  • Slow trace: Tracing can be slow, especially over long distances or congested networks.


  • Use with ping: Combine traceroute with ping to test network latency and connectivity.
  • Scripts: Create scripts to automate tracing tasks, such as monitoring network connectivity or troubleshooting specific issues.
  • macOS Network Utility: The macOS Network Utility app includes a graphical interface for traceroute.