The Types of Ping Commands

Techwalla may earn compensation through affiliate links in this story.
The ping command can be modified with switches to perform a variety of tasks.

The "ping" command is one of many tools in a network technician's toolbox, and it is one of the most useful. Ping is typically used to verify that a link exists between two machines, using either the IP address of the target machine or the hostname of the machine. However, ping can accomplish more than just basic link verification by using command switches that reconfigure the command to behave a bit differently.


Vanilla Ping

In its most stripped down form, the ping command consists of just two words – "ping ," where "" is either the IP address or the hostname of the target device. The official full syntax is as follows:


Video of the Day

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_hostname_or_IP

The various switches and parameters result in different types of ping commands.


Eternal Ping

When you issue a ping command with the "-t" switch, you are issuing a "ping forever" command. Ping will continue until you manually stop it with a "Ctrl-C," or pause it with a "Ctrl-Break" key combination. The pause will stop ping long enough for you to see the statistics and then resume. Alternatively, you can use the "-n " switch to tell ping to issue "count" pings against the target device.


Target Hostname Resolution

Another type of ping command performs name resolution on a specified IP address. The "-a" switch tells ping to do this, and the results include the hostname of the targeted IP address. This type of command can help verify that your IP addressing is correct and determine whether your DNS is working properly.


Timed Pings

When you specify the "-w


Heavy Pings

The default length of the ping data packet is 32 bytes. If you want to test larger packets, you can use the "-l " switch to specify larger packets. This type of ping command can be used to identify devices along the ping path that have maximum transmission unit (MTU) configuration discrepancies. This command can also help you determine the impact on network performance when large packets are present.


references & resources