Category: Commands

Tracert command explained

If you are a Windows user and you want to trace the route from your computer to a specific target, the easiest option is to use the tracert command. With just a simple text command, you will see the hops.

What is the Tracert command?

The Tracert command is a Windows command with CLI that you can access through the Command Prompt, or if you prefer the PowerShell too, and use it to trace the route to a target. You will see statistics about each hop that show the response time (it sents 3 packets), IP addresses of the hops, and their hostnames.

The targets can be hostnames or IP addresses.

Use the tracert command to see how much time it takes to reach a target, through where exactly does the query goes if some of the hops take too much time to respond. Later, you can focus your attention on the spots that responded slowly and see if you can improve anything.

What makes the tracert great is that it is already on your computer, and it is very simple to use. After this article, you will learn how to use it for your needs.

How to use the Tracert command?

If you are using Windows 10, Windows 8, Windows 7, or even Windows Vista, you can use the tracert command through the Command Prompt or the PowerShell. Choose the one you like. You will get the same functionality.

You can use the following tracert syntax to see better how to for your queries:

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

You can use additional options to specify the tracert command. Add them after the “tracert” in the command, separated with a single space. After the option, leave one space and put the target (hostname or IP address).

See the examples below and try the tracert command yourself. In our examples, we are using Google.com, but you can change it to your domain or your site’s IP address and see the results.

Tracert command options and examples

Don’t show the hostnames.

tracert -d google.com

You will see each hop’s IP addresses and time for the response, but no names.

Change the maximum hops for the query.

tracert -h 45 google.com

You can set a number that you like. The default is 30, but if you want to check a very far away target, you can set it at 45, like in the example of tracert above.

Loose source route along host-list (IPv4-only)

tracert -j google.com

This command will show only IPv4 addresses. 

Set the maximum time for waiting for a response.

tracert -w 125 google.com

Roundtrip traceroute 

tracert -R google.com

In some cases, you would like to use the tracert command to check the route back, not only going forward. You want to see if there is any strange host, which was not there, in a normal query. 

Source addresses IPv6-only.

tracert -S google.com

Set only IPv4 addresses.

tracert -4 google.com

That way, you will see only the IPv4 addresses of the hosts through the route.

Set only IPv6 addresses.

tracert -6 google.com

That way, you will see only the IPv6 addresses of the hosts through the route.

Conclusion

The tracert command is a small software that you already have on your computer and can serve you to trace the route of a query to a target. The best part is that it is included in Windows by default, so it will always be there when you need it.

What is Ping command, and how to use it?

What is Ping command?

Ping command is a simple network utility tool. It has a command-line interface. You can write different commands and test various elements of your network – a computer on the network, the router, a particular domain, or IP address.
The ping command uses ICMP – Internet control message protocol. When you are performing a check, you need to set a target, and additionally, you can add options for the number of packets, continuous pinging, timeout limits, IPv4 or IPv6, and more.
You will get a response with additional statistics.
An ICMP request is a small packet of data that your computer will send to the target. The target should bounce it back and send an answer for each ping.
You can find the Ping command on Linux and macOS through the Terminal application, or on Windows, through the Command Prompt.
You should also be able to find it on Android or iOS/iPadOS through a third-party Terminal application. 

Ping command – examples, switches, and more!

How to use Ping command?

Let’s see first how to use ping command on Linux or macOS and check a few examples.
Open the Terminal application.
For some of the cases, you can use Windows too. On it, you will need to open the Command Prompt for performing the commands.
*We will use example IP addresses and yourdomain.com. Please feel free to change the text and use the examples with your own domain or device (IP address).

Basic Ping command. You will see if you can reach the target. That way, you can see if you, or the device you are probing, are connected. The result would be continuous ping on Linux or macOS (Stop with Ctrl-C), or 4 replies and statistics if there were no problems.

ping yourdomain.com

For continuous ping on Windows, you need to use the extra option “-t” and the ping that you want to perform is:

ping -t yourdomain.com

Send more ping requests (custom number of requests). You can make more than 4 requests on Windows or a specific amount of requests on Linux/macOS.

Linux/macOS
ping –c 8 yourdomain.com

Windows
ping –n 8 yourdomain.com

Set an interval between the pings. You can set the time in seconds between the requests.

Linux/macOS
ping -i 20 8.8.4.4

Set a timeout period in seconds to stop the ping command on Linux/macOS.
ping –w 50 yourdomain.com

Get the statistics only on your ping request, not showing the individual pings.
Linux/macOS
ping –q yourdomain.com

Set the packet’s size to a value that you want. The default is 56 bytes on Linux/macOS and 32 bytes on Windows. Let’s put 112.
Linux/macOS
ping -s 112 yourdomain.com 

Ping option for extended functionality Linux/macOS and Windows.

For those of you who are using Linux or macOS, in the Terminal application, write:
ping -h

-aYou will hear a sound when the pings arrive.
-bAllows the ping to broadcast IP address.
-BDon’t allow ping to change the source IP address.
-c (count)The number of ping to send.
-fFlood the network with pings.
-i (interval)Interval between pings.
-I (interface address) Source IP address to interface IP address.
-1 (reload)Number of pings without waiting for replies.
-nShow hostname in result.
-qShort answer.
-T (ttl)TTL.
-vVerbose output.
-VVersion of ping command.
-w (deadline)Time to stop the ping command.
-W (timeout)Waiting time for a resonse. 

For Windows users open the Command Prompt and write:

ping -?

-tContinuos ping.
-aResolve IP address to hostname.
-nNumber of pings.
-lSend the size of the buffer.
-fStop IPv4 flag fragmentation. 
-iTTL.
-vNot working anymore.
-rTrace route IPv4.
-sTimstamp on each hop IPv4
-jLoose source route along host-list IPv4.
-kStrict source route along host-list IPv4.
-wWait for response time.
-RTrace route IPv6
-SSource address.
-cRouter compartment identifier.
-pPing Hyper-V network.
-4IPv4.
-6IPv6.

Navigation