The Ping Command

The Ping Command, Is a Command Prompt command used to test the potential of the source laptop to reach a special destination laptop.

The ping command is normally used as an easy manner to verify that a computer can speak over the community with any other laptop or community device.

The operates via sending Internet Control Message Protocol (ICMP) Echo Request messages to the vacation spot laptop and looking forward to a response.

How many of the responses of the one are back, and the way long it takes for them to return, are the two important pieces of records that the ping command gives.

For instance, you would possibly find that there are not any responses while pinging a community printer,

only to discover that the printer is offline and its cable needs replaced. Or maybe you need to ping a router to verify that your pc can connect with it, to remove it as a probable purpose for a networking difficulty.

Note: The phrase “ping” is likewise used on-line to refer to a quick message, usually over textual content message or electronic mail.

For example, you can “ping your boss,” or send her a message, when you’ve achieved with a selected assignment,

however, it has nothing to do with the ping command

Ping Command Availability

The ping command is to be had from in the Command Prompt in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP working structures.

The ping command is likewise available in older versions of Windows like Windows ninety-eight and 95.

Note: The availability of certain ping command switches and other ping command syntax would possibly vary from operating machine to operating system.

Ping Command Syntax

ping [-t] [-a] [-ncount] [-lsize] [-f] [-iTTL] [-vTOS] [-rcount] [-scount] [-wtimeout] [-R] [-Ssrcaddr] [-p] [-4] [-6target [/?]

Tip: See How to Read Command Syntax if you’re now not positive how to interpret the ping command syntax because it’s defined above or in the table below.

Ping Command Options
Item Explanation
-t Using this option will ping the target until you force it to stop by using Ctrl-C.
-a This ping command option will resolve, if possible, the <>hostname of an IP address target.
-ncount This option sets the number of ICMP Echo Requests to send, from 1 to 4294967295. The ping command will send 4 by default if -n isn’t used.
-l size Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527. The ping command will send a 32-byte echo request if you don’t use the -l option.
-f Use this ping command option to prevent ICMP Echo Requests from being fragmented by routers between you and the target. The -f option is most often used to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTL This option sets the Time to Live (TTL) value, the maximum of which is 255.
-v TOS This option allows you to set a Type of Service (TOS) value. Beginning in Windows 7, this option no longer functions but still exists for compatibility reasons.
-rcount Use this ping command option to specify the number of hops between your computer and the target computer or device that you’d like to be recorded and displayed. The maximum value for count is 9, so use the tracert command instead if you’re interested in viewing all the hops between two devices.
-scount Use this option to report the time, in Internet Timestamp format, that each echo request is received and echo reply is sent. The maximum value for count is 4, meaning that only the first four hops can be time stamped.
-wtimeout Specifying a timeout value when executing the ping command adjusts the amount of time, in milliseconds, that ping waits for each reply. If you don’t use the -w option, the default timeout value of 4000 is used, which is 4 seconds.
-R This option tells the ping command to trace the round trip path.
-Ssrcaddr Use this option to specify the source address.
-p Use this switch to ping a Hyper-V Network Virtualization provider address.
-4 This forces the ping command to use IPv4 only but is only necessary if target is a hostname and not an IP address.
-6 This forces the ping command to use IPv6 only but as with the -4option, is only necessary when pinging a hostname.
target This is the destination you wish to ping, either an IP address or a hostname.
/? Use the help switch with the ping command to show detailed help about the command’s several options.
Ping Command Options
Item Explanation
-t Using this option will ping the target until you force it to stop by using Ctrl-C.
-a This ping command option will resolve, if possible, the hostname of an IP address target.
-ncount This option sets the number of ICMP Echo Requests to send, from 1 to 4294967295. The ping command will send 4 by default if -n isn’t used.
-l size Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527. The ping command will send a 32-byte echo request if you don’t use the -l option.
-f Use this ping command option to prevent ICMP Echo Requests from being fragmented by routers between you and the target. The -f option is most often used to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTL This option sets the Time to Live (TTL) value, the maximum of which is 255.
-v TOS This option allows you to set a Type of Service (TOS) value. Beginning in Windows 7, this option no longer functions but still exists for compatibility reasons.
-rcount Use this ping command option to specify the number of hops between your computer and the target computer or device that you’d like to be recorded and displayed. The maximum value for count is 9, so use the tracert command instead if you’re interested in viewing all the hops between two devices.
-scount Use this option to report the time, in Internet Timestamp format, that each echo request is received and echo reply is sent. The maximum value for count is 4, meaning that only the first four hops can be time stamped.
-wtimeout Specifying a timeout value when executing the ping command adjusts the amount of time, in milliseconds, that ping waits for each reply. If you don’t use the -w option, the default timeout value of 4000 is used, which is 4 seconds.
-R This option tells the ping command to trace the round trip path.
-Ssrcaddr Use this option to specify the source address.
-p Use this switch to ping a Hyper-V Network Virtualization provider address.
-4 This forces the ping command to use IPv4 only but is only necessary if target is a hostname and not an IP address.
-6 This forces the ping command to use IPv6 only but as with the -4option, is only necessary when pinging a hostname.
target This is the destination you wish to ping, either an IP address or a hostname.
/? Use the help switch with the ping command to show detailed help about the command’s several options.

Other less normally used switches for the ping command exist inclusive of [-j host-list], [-k host-list], and [-c compartment]. Execute ping /? From the Command Prompt for extra information on these options.

Tip: You can shop the ping command output to a report the use of a redirection operator. See How to Redirect Command Output to a File for instructions or see our Command Prompt Tricks list for more suggestions.

Ping Command Examples

ping -n 5 -l 1500 www.google.com

In this situation, used to ping the hostname www.Google.Com. Then alternative tells the ping command to ship 5 ICMP Echo Requests instead of the default of four, and the -l alternative sets the packet size for every request to 1500 bytes in place of the default of 32 bytes.

The end result displayed inside the Command Prompt window will appear something like this:

The 0% loss suggested underneath Ping data for seventy four.125.224.Eighty-two tells me that each ICMP Echo Request message sent to www.Google.Com become returned. This way that, as some distance as this network connection is going, it can speak with Google’s website simply great.

ping 127.0.0.1

In the above example, we are pinging 127.0.0.1, also known as the IPv4 localhost IP deal with or IPv4 loopback IP cope with, without alternatives.

Using the ping command to ping 127.0.Zero.1 is an exceptional way to test that Windows’ network capabilities are running nicely however it says not anything about your very own community hardware or your connection to any other pc or tool. The IPv6 model of this check might be ping::1.

ping -a 192.168.1.22

In this example, we are asking the ping command to locate the hostname assigned to the 192.168.1.22 IP deal with, but to otherwise ping it as regular.

As you may see, the ping command resolved the IP address we entered, 192.168.1.22, because the hostname J3RTY22, and then performed the remainder of the ping with default settings.

ping 192.168.2.1

Similar to the ping command examples above, this one is used to see if your computer can attain your router. The best difference right here is that in place of the usage of a ping command switch or pinging the localhost, we’re checking the relationship among the pc and the router (192.168.2.1 in this situation).

If you’re having trouble logging in to your router or having access to the internet in any respect, see in case your router is obtainable with this ping command, of the route, replacing 192.168.2.1 with your router’s IP address.

ping -t -6 SERVER

In this situation, we force the ping command to apply IPv6 with the -6 option and maintain to ping SERVER indefinitely with the -t option.

We interrupted the ping manually with Ctrl+C after seven replies. Also, as you can see, the -6 option produced IPv6 addresses.

Tip: The variety after the % in the replies generated in this ping command example is the IPv6 Zone ID, which most customarily indicates the network interface used. You can generate a table of Zone IDs matched with your community interface names through executing the netsh interface ipv6 show interface. The IPv6 Zone ID is the range within the Idx column.