Tracert command is one of the most used commands. It serves different purposes and commands prompt tutorial would not complete without tracert command. In this guide, you will learn the usage, options, and tracert command in action. Tracert command is an advanced form of Ping command.
Table of Contents
How does Tracert Command work?
Traceroute is a full form of tracert command. We can get an idea by looking at the name what is the functionality of this command. It traces the route of your internet connection. You send a message to the receiver. The message would not reach to responder directly it has to go through different paths. Traceroute command identifies that path and tells us how much time it took to pass from that path. In a computer language, each path cross from the server. The message, which is ping in computer language, hops from each server.
So you see there are 4 routes in the above picture but the number of routes depends on many factors but you get the idea. Now our, trojan horse, tracert command will identify each route and then also tell us how much time it took to pass from one route to another. You got the gist and now let me give you an example.
Here you can see tracert Command in action. In the following passages, you will learn more about it.
In order to use this command, you have to access command prompt in administration mode
Tracert Command and its Options
Almost in all of command prompt commands, we have options. Options are basically an extension of a particular command. Tracert command also has many extensions and we will discuss them in detail.
First of all, how to use this command in its simplest form. When you have opened cmd in administration mode then write tracert and then IP address or domain of website for which you want to trace the route.
So in our examples, we will be tracing routes to google for purpose of simplicity. Like domain name, you can also trace the route of IP addresses and for this, you have to type the IP address.
The IP address of google is 22.214.171.124. You can find the IP address by another command of command prompt, NsLookup, and please remember this is strictly for educational purposes.
Related: How to get IP address of a website.
You can see we used tracert command with both the IP address and the Domain name of google. In both variations, it has given us three different times and following that an IP address of that particular route. Three different times are there for us to give a better idea of how much time it took us to connect to our required domain or IP address.
|-d||It will not look up for domain name|
|-h||Maximum number of hops to search for target|
|-j||Traceroute along the given hostname|
|-w||Wait for a timeout in millisecond for each reply|
So these were the options of tracert command. Now let’s learn more about each of them.
By default, this command looks for the domain name of every route and takes time to look for each domain name. If looking for a domain name is not your requirement then you can skip this by -d option. As looking for domain name accounts for much of time and till the timeout packet will not move to next hop.
tracert -d www.google.com
Here you can see tracert command is not showing any name of IP addresses. When you will run this command, notice how quickly it completed as compared to this command without -d option.
The next tracert command option is -h which controls the number of hops it has to through to complete a path. If you have noticed in the above screenshots that every tracert command is going through ten hops before reaching to their destination. So -h option will limit the number of hops.
tracert -h 6 www.google.com
So in this screenshot, you can see there are only six routes, and then trace was completed.
One more thing which you can change is the timeout of each hop of the tracert command. For limiting timeout duration, we will use -w option. By default, the timeout duration is 4000 millisecond or 4 seconds. The syntax for -w option is in quotation marks.
tracert -w 1000 www.google.com
So here I set time 1000 milliseconds, you can see all the hops reached in time but if one of hop did not ping in 1000 milliseconds then we would have seen timeout error.
How to interpret the result?
The first line of tracert command results tells us about what domain and IP address has been traced. After that, there is line” over a maximum of 30 hops” which means if it does not reach the destination domain in 30 hops then our command will be failed or in other words, after 30 hops it will stop the function.
Then after the command line, there are 5 columns. The first column shows us number of hops. Like how many hops it took to reach the destination. In our case, it took 11 hops. Second, third and fourth column shows three different times packet took to reach that IP address. For better results average all three times that will give you accurate results. Finally, the last column shows the IP address of that server or hop.
I hope now you have some better idea of tracert command. There are other networking commands you can learn to have a better understanding of your computer network.