Linux traceroute Command: Trace Routers on the Way to a Host

traceroute investigates the routers along the path to a destination by gradually increasing the TTL or hop limit. It is used to check where delays or response interruptions occur.

What is the traceroute command?

The response of each hop is the result sent by that router to the diagnostic packet and does not indicate the definitive path of actual application traffic. The typical Linux implementation of traceroute uses UDP probes by default, -I selects ICMP, and -T selects TCP probes. The available methods depend on the implementation and permissions.

Basic syntax

traceroute [options] destination

The installed implementation and options may vary depending on the distribution. Check the description for your current system with man traceroute.

Examples

Basic path tracing

Check each step of the path and the response times.

traceroute example.com

View in numeric addresses

Focus on the path itself by excluding DNS reverse lookup time.

traceroute -n example.com

Select ICMP probe

When responses are limited in the basic UDP method, compare using other methods.

traceroute -I example.com

When interpreting hop-by-hop responses

traceroute investigates the hops to the destination using probe packets with varying TTLs. The following is an example output in numerical IP format to reduce DNS reverse lookup delays.

traceroute -n example.com

Example of output structure (actual route and times vary each time):

1  192.0.2.1  1.0 ms  0.9 ms  1.1 ms
2  * * *

Each line represents a hop, and the three values are the round-trip times of multiple probes. * indicates that there was no response for that probe, and if subsequent hops continue to appear, only that hop may be limiting responses. Since the path can be asymmetric, do not determine a faulty device based solely on this result.

Main Options and Format

Options/Format Description
-n Display addresses as numbers.
-I Use ICMP Echo probes.
-T Use TCP probes.
-m hop Limit the maximum number of hops.
-q count Specify the number of probes sent per hop.
-w time Adjust the response waiting time.

Precautions when using

Even if a * appears at one hop, if the subsequent hops continue to appear, it may only be that the diagnostic response of that router is restricted. Do not conclude a bottleneck solely from an increase in RTT for one segment; compare it with the responses of the final destination and repeated measurements. Some probing methods may require additional privileges.

Frequently Asked Questions

If a middle hop is shown as *, does that mean the packet was dropped there?

No. That router may not have sent or may have restricted the TTL expiration response. Observe the subsequent hops and destination responses together.

Official Documentation

You can check the exact behavior of the options and the differences in implementation in the official traceroute documentation.

More in This Category
Linux watch Command: Run a Command Repeatedly

Linux watch Command: Run a Command Repeatedly

Learn how to use the Linux watch command to rerun a command at regular intervals and highlight changing output, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux env Command: Display Variables and Run Commands with a Custom Environment

Linux env Command: Display Variables and Run Commands with a Custom Environment

Learn how to use the Linux env command to display environment variables or run a command with temporary variable values, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux ssh Command: Connect to a Remote Host Securely

Linux ssh Command: Connect to a Remote Host Securely

Learn how to connect to a Remote Host Securely with the Linux ssh command, including practical examples, key options, and important precautions.

Linux screen Command: Create and Manage Detachable Terminal Sessions

Linux screen Command: Create and Manage Detachable Terminal Sessions

Learn how to use the Linux screen command to keep terminal sessions running and reconnect to them later, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux tmux Command: Detach and Reattach Terminal Sessions

Linux tmux Command: Detach and Reattach Terminal Sessions

Learn how to detach and Reattach Terminal Sessions with the Linux tmux command, including practical examples, key options, and important precautions.

Linux Tutorial / Standard Input, Output, Redirection, and Pipes

Linux Tutorial / Standard Input, Output, Redirection, and Pipes

Understand standard input, output, and error; practice file redirection and pipes; and learn why overwrite risk and redirection order matter.

Linux tail Command: View the End of a File and Follow Logs

Linux tail Command: View the End of a File and Follow Logs

Learn how to use the Linux tail command to view the last lines of a file and follow log updates in real time, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux stat Command: Display Detailed File Metadata

Linux stat Command: Display Detailed File Metadata

Learn how to use the Linux stat command to inspect file size, permissions, ownership, timestamps, inode, and filesystem metadata, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux host Command: Look Up DNS Names and Addresses

Linux host Command: Look Up DNS Names and Addresses

Learn how to look Up DNS Names and Addresses with the Linux host command, including practical examples, key options, and important precautions.

Linux journalctl Command: Read systemd Logs

Linux journalctl Command: Read systemd Logs

Learn how to read systemd Logs with the Linux journalctl command, including practical examples, key options, and important precautions.