Master the ping command across all operating systems with real examples, advanced options, and troubleshooting techniques
Try our web-based ping tool first to see results, then learn the command-line version
Test Ping Online FirstThe ping command is one of the most fundamental network troubleshooting tools available on every operating system. It sends small packets to a target and measures how long it takes to get a response, helping you diagnose connectivity issues, measure latency, and verify network paths.
Option | Description | Example |
---|---|---|
-t |
Continuous ping (until stopped with Ctrl+C) | ping -t google.com |
-n count |
Number of ping packets to send | ping -n 10 google.com |
-l size |
Packet size in bytes (default 32) | ping -l 1000 google.com |
-w timeout |
Timeout in milliseconds | ping -w 5000 google.com |
-4 |
Force IPv4 | ping -4 google.com |
-6 |
Force IPv6 | ping -6 google.com |
-c
to specify count or Ctrl+C to stop.
Option | Description | Example |
---|---|---|
-c count |
Number of ping packets to send | ping -c 5 google.com |
-i interval |
Interval between packets (seconds) | ping -i 2 google.com |
-s size |
Packet size in bytes | ping -s 1000 google.com |
-W timeout |
Timeout in seconds | ping -W 5 google.com |
-f |
Flood ping (requires root) | sudo ping -f google.com |
-q |
Quiet mode (only summary) | ping -q -c 10 google.com |
-n |
No DNS resolution (numeric only) | ping -n 8.8.8.8 |
Mac ping is based on BSD Unix and is very similar to Linux, with a few differences in options and behavior.
Option | Description | Mac Specific Notes |
---|---|---|
-c count |
Number of packets | Same as Linux |
-i interval |
Wait interval | Minimum 1 second for non-root |
-s packetsize |
Data bytes to send | Default 56 bytes |
-t timeout |
Timeout in seconds | Different from Linux -W |
-o |
Exit after first reply | Mac-specific option |
-D |
Print timestamps | Mac-specific format |
Feature | Windows | Linux | Mac |
---|---|---|---|
Default Behavior | 4 packets then stop | Continuous until Ctrl+C | Continuous until Ctrl+C |
Count Option | -n count |
-c count |
-c count |
Packet Size | -l size |
-s size |
-s size |
Timeout | -w milliseconds |
-W seconds |
-t seconds |
Continuous | -t |
Default behavior | Default behavior |
IPv6 | -6 |
ping6 or -6 |
ping6 |
Flood Ping | Not available | -f (root only) |
-f (root only) |
These commands work consistently across all platforms:
Error Message | Likely Cause | What to Check |
---|---|---|
"Request timed out" | Firewall blocking or destination down | Firewall settings, target server status |
"Destination host unreachable" | Routing problem | Network configuration, routing tables |
"Could not find host" | DNS resolution failure | DNS settings, hostname spelling |
"Network is unreachable" | No route to destination | Default gateway, network connectivity |
"TTL expired in transit" | Too many hops or routing loop | Routing configuration, use traceroute |
ping 127.0.0.1
(tests TCP/IP stack)ping [gateway IP]
(tests local network)ping 8.8.8.8
(tests internet connectivity)ping google.com
(tests DNS resolution)ping [your target]
Use our online ping tool to compare results with your command-line testing
Test Ping OnlineNew to ping? Start with our beginner-friendly explanation of what ping actually measures.
BeginnerAdvanced ping testing techniques and result interpretation for network optimization.
Advanced