Microsoft DOS ping command

Quick links

About ping
Availability
Syntax
Examples
Related questions

About ping

Helps in determining TCP/IP Networks IP address as well as determine issues with the network and assists in resolving them. See the ping definition for a full description.

Availability

The ping.exe command is an external command that is available in the below Microsoft operating systems.

Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7

Syntax

Windows Vista, 7, and 8 syntax
Windows XP and lower syntax

Windows Vista, 7, and 8 syntax

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] [-R] [-S srcaddr] [-4] [-6 target_name

Options:

-t Pings the specified host until stopped.
To see statistics and continue - Type Control-Break;
To stop - press Ctrl + C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet (IPv4-only).
-i TTL Time To Live.
-v TOS Type Of Service (IPv4-only. This setting has been deprecated and has no effect on the type of service field in the IP Header).
-r count Record route for count hops (IPv4-only).
-s count Timestamp for count hops (IPv4-only).
-j host-list Loose source route along host-list (IPv4-only).
-k host-list Strict source route along host-list (IPv4-only).
-w timeout Timeout in milliseconds to wait for each reply.
-R Use routing header to test reverse route also (IPv6-only).
Per RFC 5095 the use of this routing header has been deprecated. Some systems may drop echo requests if  this header is used.
-S srcaddr Source address to use.
-4 Force using IPv4.
-6 Force using IPv6.

Windows XP and lower syntax

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

Options:

-t Pings the specified host until stopped.
To see statistics and continue - Type Control-Break;
To stop - press Ctrl + C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count   Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.

Examples

ping localhost

Pings the localhost, which helps determine if the computer can send information out and receive the information back from itself.

Note: The above command does not send information over network, but can indicate if the card can respond

ping computerhope.com

Windows command line ping results

Ping supports the ability to ping a Internet address. In the above example, we pinged "computerhope.com" and as can be seen, received four responses back. If we couldn't reach the server or the server was blocking our request we would have lost all four packets.

ping 69.72.169.241

Allows you to ping another computer where <69.72.169.241> can be the IP address of the computer you want to ping. If you do not get a reply or get lost packets you have a problem with your network, which can be a cable issues, network card issues, drivers, router, switch, or other network problem.

Related questions

Is there a continuous ping options?

ping <address> -t

Use the -t option to ping any address until you cancel it by pressing Ctrl + C.

When I ping the IP address doesn't look right.

In newer versions of the ping command and computers running on IPv6 you may get an IP address that looks something like [fe80::51c1:5214:a18e:8dec%12] instead of [192.168.1.7] to get the IPv4 IP address use the below command.

ping <hostname> -4

The hostname can be any computer and the -4 forces the address to be shown as an IPv4 address.

Additional information