• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Ping \windows\system32\ping.exe

Test the “reachability” of another computer on the network or across the Internet.

To Open

Command Prompt ping


ping target [-t] [-a] [-n count] [-l size] [-f] [-w timeout]
   [-r count] [-s count] [-j host_list | -k host_list]
   [-i ttl] [-v tos]


The primary function of Ping is to see if another computer is “alive” and reachable. Ping works on local networks and across Internet connections. For example, type the following at a command prompt:

ping oreilly.com

and you’ll get a report that looks something like this:

Pinging oreilly.com [] with 32 bytes of data:
Reply from bytes=32 time=78ms TTL=238
Reply from bytes=32 time=31ms TTL=238
Reply from bytes=32 time=15ms TTL=238
Reply from bytes=32 time=78ms TTL=238
Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 15ms, Maximum =  78ms, Average =  50ms

Here, Ping sent out four pings (the default), reported the time it took for them to return (in milliseconds), and then displayed various statistics about the session. Ping is especially useful if you’re having trouble contacting a server and you want to see if the server is alive (running and accepting connections). If the server does not reply (meaning that it is down or the connection has been severed), you’ll see Request timed out. Ping accepts the following options:


The machine to ping; it can be the name of a computer on your network, an IP address (e.g.,, or an Internet address (e.g., http://oreilly.com).


Normally, Ping sends out four pings and then quits. Include the -t option to ping continually until Ping is interrupted by pressing Ctrl-C. Press Ctrl-Break to display statistics without interrupting.


Resolve addresses to hostnames.

-n count

The number of pings to send; the default is four.

-l size

The size of the packets to send, in bytes; the default is 32 bytes.


Turn on the “Don’t Fragment” flag in packet.

-w timeout

The amount of time to wait, in milliseconds, before Ping gives up and displays Request timed out; the default is 500 milliseconds (1/2 second).

-r count

Display the route taken to reach the server (see “Tracert”, later in this chapter). The count is the maximum number of hops to record, and can range from 1 to 9.

-s count

Display a time stamp for count hops.

-j host_list

Impose a “loose” route (see the -r option) along which to ping.

-k host-list

Impose a “strict” route (see the -r option) along which to ping.

-i ttl

Specify the Time To Live (TTL); valid range is from 0 to 255.

-v tos

Specify the Type of Service (TOS); valid range is from 0 to 255.


The name “ping” comes from submarine lingo, when sonar was used to detect nearby objects, such as ships and other submarines. Pulses of sound were sent through the water; those that returned indicated the existence of an object off which the pulses were reflected. ping.exe works very similarly, except it sends packets instead of sonic pulses.

See Also

“Tracert”, “NSLookup”

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint