Ping command for Windows 10 command prompt

Share on facebook
Share on google
Share on twitter
Share on linkedin

ping

4 Ways to Ping an IP Address - wikiHow

Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) echo Request messages. The computer displays the receipt of corresponding echo Reply messages, along with round-trip times. Use ping as the primary TCP/IP command to troubleshoot connectivity, reachability, and name resolution. Used without parameters, this command displays Help content.

You can also use this command to test both the computer name and the IP address of the computer. If pinging the IP address succeeds, but pinging the computer name fails, you might have a name resolution problem. In this case, make sure that you can resolve the computer name you specify through the local Hosts file, by using Domain Name System (DNS) queries, or through NetBIOS name resolution techniques.

 Note

You must install the Internet Protocol (TCP/IP) as a component in the properties of a network adapter in Network Connections to make this command available.

Syntax

ping [/t] [/a] [/n <count>] [/l <size>] [/f] [/I <TTL>] [/v <TOS>] [/r <count>] [/s <count>] [{/j <hostlist> | /k <hostlist>}] [/w <timeout>] [/R] [/S <Srcaddr>] [/4] [/6] <targetname>

Parameters

PARAMETERS
Parameter Description
/t Specifies ping continues sending echo Request messages to the destination until interrupted. To interrupt and display statistics, press CTRL+ENTER. To interrupt and quit this command, press CTRL+C.
/a Perform reverse name resolution on the destination IP address. If successful, ping displays the corresponding hostname.
/n <count> Specifies the number of echo Request messages you send. The default number equals 4.
/l <size> Specifies the length, in bytes, of the Data field in the echo Request messages. The default length equals 32. The maximum size equals 65,527.
/f Send echo Request messages with the Do not Fragment flag in the IP header set to 1 (available on IPv4 only). It is not possible for routers in the path to the destination to fragment the echo Request message. You can use this parameter for troubleshooting path Maximum Transmission Unit (PMTU) problems.
/I <TTL> Specifies the value of the Time To Live (TTL) field in the IP header for echo Request messages sent. The default equals the default TTL value for the host. The maximum TTL equals 255.
/v <TOS> Specifies the value of the Type Of Service (TOS) field in the IP header for echo Request messages sent (available on IPv4 only). The default equals 0. The system specifies TOS as a decimal value from 0 through 255.
/r <count> Use the Record Route option in the IP header to record the path taken by the echo Request message and corresponding echo Reply message (available on IPv4 only). Each hop in the path uses an entry in the Record Route option. If possible, specify a count equal to or greater than the number of hops between the source and destination. The minimum count equals 1 and a maximum equals 9.
/s <count> Use the Internet timestamp option in the IP header to record the time of arrival for the echo Request message and corresponding echo Reply message for each hop. The minimum  count must equal 1 and a maximum equals  4. The command requires this for link-local destination addresses.
/j <hostlist> Specifies the echo Request messages use the Loose Source Route option in the IP header with the set of intermediate destinations specified in hostlist (available on IPv4 only). With loose source routing, successive intermediate destinations separated by one or multiple routers. The maximum number of addresses or names in the host list equals 9. The command displays the host list as a series of IP addresses (in dotted decimal notation) separated by spaces.
/k <hostlist> Specifies the echo Request messages use the Strict Source Route option in the IP header with the set of intermediate destinations specified in hostlist (available on IPv4 only). With strict source routing, you must reach the next intermediate destination  (it must be a neighbor on an interface of the router). The command sets the maximum number of addresses or names in the host list at 9. The host list displays as a series of IP addresses (in dotted decimal notation) separated by spaces.
/w <timeout> Specifies the amount of time, in milliseconds, to wait for the echo Reply message corresponding to a given echo Request message. If the distant computer does not receive the echo Reply message within the time-out, the system displays “Request timed out” error message. The command sets the default time-out to 4000 (4 seconds).
/R Specifies tracing of the round-trip path  (available on IPv6 only).
/S <Srcaddr> Specifies the source address to use (available on IPv6 only).
/4 Specifies IPv4 used to ping. You do not require this parameter to identify the target host with an IPv4 address. You  only require this parameter  to identify the target host by name.
/6 Specifies IPv6 used to ping. You do not require this parameter to identify the target host with an IPv6 address. You only require this parameter to identify the target host by name.
<targetname> Specifies the host name or IP address of the destination.
/? Displays help at the command prompt.

Example of the ping command output

C:\>ping example.microsoft.com
    pinging example.microsoft.com [192.168.239.132] with 32 bytes of data:
    Reply from 192.168.239.132: bytes=32 time=101ms TTL=124
    Reply from 192.168.239.132: bytes=32 time=100ms TTL=124
    Reply from 192.168.239.132: bytes=32 time=120ms TTL=124
    Reply from 192.168.239.132: bytes=32 time=120ms TTL=124

Examples

To ping the destination 10.0.99.221 and resolve 10.0.99.221 to its host name, type:

ping /a 10.0.99.221

To ping the destination 10.0.99.221 with 10 echo Request messages, each of which has a Data field of 1000 bytes, type:

ping /n 10 /l 1000 10.0.99.221

To ping the destination 10.0.99.221 and record the route for 4 hops, type:

ping /r 4 10.0.99.221

To ping the destination 10.0.99.221 and specify the loose source route of 10.12.0.1-10.29.3.1-10.1.44.1, type:

ping /j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221