ping Command – Complete Reference (Windows)The ping command is used to test network connectivity between your computer and another device (IP or domain).
ping [hostname or IP address] [options]
Example:
ping google.com
| Option | Description |
|---|---|
-t |
Ping the target until stopped manually (Ctrl+C to stop) |
-n <count> |
Number of echo requests to send |
-l <size> |
Send buffer size in bytes |
-f |
Set "Don't Fragment" flag in packet |
-i <TTL> |
Set Time To Live (max hops) for packet |
-v <TOS> |
Set Type of Service (ignored in modern Windows versions) |
-r <count> |
Record route for count hops (up to 9) |
-s <count> |
Timestamp route for count hops |
-j <host-list> |
Loose source route along the host-list |
-k <host-list> |
Strict source route along the host-list |
-w <timeout> |
Timeout in milliseconds to wait for each reply |
-R |
Use routing header to test reverse route (IPv6 only) |
-S <src-addr> |
Use the specified source address (IPv6 only) |
-4 |
Force using IPv4 |
-6 |
Force using IPv6 |
ping -t 8.8.8.8
Keep sending pings until stopped manually.
ping -n 5 google.com
Sends 5 echo requests.
ping -l 1000 8.8.8.8
Send a packet with 1000 bytes of data.
ping -f -l 1400 8.8.8.8
Sends 1400-byte packets that must not be fragmented.
ping -w 2000 example.com
Wait 2000 ms (2 seconds) for each response.
ping -4 google.com
ping -6 google.com
Ping using specific IP protocol version.
Reply from 8.8.8.8: bytes=32 time=20ms TTL=117
| Field | Meaning |
|---|---|
| bytes | Size of the reply packet |
| time | Round-trip latency |
| TTL | Time To Live (hops remaining) |
| Message | Meaning |
|---|---|
| Request timed out | No response within timeout period |
| Destination host unreachable | Routing or connectivity issue |
| General failure | Local stack or configuration error |
The ping command is a vital tool for diagnosing network connectivity, latency, and basic route issues. Mastering its options improves your troubleshooting and performance testing skills.