Windows provides the tracert command in order to check the route to the specified destination in the network. The traceroute command is generally used to list intermediate hosts on the internet. The traceroute command tries to list every intermediate host by sending them ICMP packets. In some cases, the tracert command is also called a tracer.
tracert Command Syntax
The tracert command syntax is like below.
tracert OPTION TARGET
- OPTION is used to specify single or multiple options. This is optional.
- TARGET is a domain name or IP address to trace route. This is required.
tracert Command Help and Options
The tracert command help and options can be listed by just running the tracert command without option and target.
Help and related options are like below.
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name Options: -d Do not resolve addresses to hostnames. -h maximum_hops Maximum number of hops to search for target. -j host-list Loose source route along host-list (IPv4-only). -w timeout Wait timeout milliseconds for each reply. -R Trace round-trip path (IPv6-only). -S srcaddr Source address to use (IPv6-only). -4 Force using IPv4. -6 Force using IPv6.
The tracert command can be used simply by just providing the target. All the intermediate hosts listed to the specified destination with their hostnames. But ins some cases the hostnames can not be resolved and only IP addresses listed. Even some intermediate hosts do not respond to the ICMP packets and they are listed as unknown with the * sign and with the “Request timed out”. But we knew that this intermediate host exists.
1 <1 ms <1 ms <1 ms 192.168.10.2 2 * * * Request timed out. 3 * * * Request timed out. 4 * * * Request timed out. 5 * * * Request timed out. 6 * * * Request timed out. 7 * * * Request timed out. 8 * * * Request timed out. 9 * * * Request timed out. 10 * * * Request timed out. 11 * * * Request timed out. 12 * * * Request timed out. 13 * * * Request timed out. 14 * * * Request timed out. 15 * * * Request timed out. 16 * * * Request timed out. 17 * * * Request timed out. 18 56 ms 54 ms 54 ms sof02s27-in-f14.1e100.net [220.127.116.11]
Trace Path with IP address
By default all intermediate hops or hosts are printed with their hostnames. But we can list these hosts with their IP addresses by using the -d option.
tracert -d google.com
Use Only IPv4
The tracert command supports both IPv4 and IPV6. Event the IPv4 is a more popular protocol and used by default with the tracert command in some cases IPv6 can be used by default. We can force to use IPv4 protocol by specifying the -4 option like below.
tracert -4 google.com
Use Only IPv6
Event the IPv4 is defualt protocol used with the tracert command we can force the IPv6 with the -6 option like below.
tracert -6 google.com
Specify Source Interface or IP Address For Tracert
In most cases, a system has a single IP address but servers and other systems may have multiple interfaces. By default, the tracert command uses the default gateway to find the path to the specified destination. Alternatively, we can specify the source interface or source address for the tracert command by using the -S option.
tracert -S 192.168.1.10 google.com
Specify Maximum Hosts (Intermediate Hosts)
The tracert command hops every intermediate host it found. By default, the tracert command hops maximum of 30 hosts and after 30 hosts it stops. We can explicitly specify the intermediate host count or maximum hosts with the -h option like below.
tracert -d 50 google.com