ping - Network Connectivity Check

Maintained on

The ping command is a basic network diagnostic command that sends ICMP Echo Request packets and checks whether Echo Reply packets come back.

It is often the first step for telling apart “Can I connect?”, “How long does a response take?”, and “Is host name resolution working?”.

Basic syntax of the ping command

ping <destination IP address or hostname>
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] <destination>

Basic usage

ping www.google.com
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>ping www.google.com
Pinging www.google.com [142.250.206.228] with 32 bytes of data:
Reply from 142.250.206.228: bytes=32 time=16ms TTL=119
Reply from 142.250.206.228: bytes=32 time=15ms TTL=119
Reply from 142.250.206.228: bytes=32 time=16ms TTL=119
Reply from 142.250.206.228: bytes=32 time=15ms TTL=119
Ping statistics for 142.250.206.228:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 16ms, Average = 15ms
C:\users\user>

This result shows that name resolution succeeded and that ICMP replies were returned by the destination.

Commonly used options

OptionDescription
/n <count>Number of requests to send. The default is 4
/tKeep sending until you stop it
/w <ms>Time to wait for each reply, in milliseconds
/aTry to resolve the host name from the IP address
/4Use IPv4
/6Use IPv6

Send only 10 requests

ping /n 10 example.com

Keep sending until stopped

ping /t 192.168.1.1

Press Ctrl + C to stop. Press Ctrl + Break to display the statistics so far while it keeps sending.

Shorten the timeout

ping /w 1000 192.168.1.1

If no reply arrives within one second, the request is treated as timed out.

How to read the results of ping

When replies come back

  • The destination is reachable
  • ICMP is not blocked by the destination or along the route
  • You can see a rough response time

When Request timed out. is displayed

A timeout does not necessarily mean the destination is down.

It can also occur for reasons such as:

  • The destination or a firewall along the route blocks ICMP
  • Packets are being dropped along the route
  • The destination is too busy to respond
  • The specified timeout value is too short

When Destination host unreachable. is displayed

There may be a problem with your own network settings (IP address or default gateway) or with the route to the destination. This message is an error returned by your own computer or by an intermediate router, not a reply from the destination.

When it fails with a host name but succeeds with an IP address

In this case, the cause is likely DNS or name resolution rather than the network itself.

ping is not a complete health check

A successful ping does not guarantee that web services or database connections are healthy. It only checks whether the destination is reachable at the ICMP level.

Practical uses

Check whether you can reach the default gateway

ping 192.168.1.1

This is the basic way to check whether the problem is on the local network side.

Check host name resolution

ping /a 8.8.8.8
ping example.com

The former checks reverse lookup, and the latter checks forward lookup.

Order of troubleshooting

Check in this order: your own computer (ping 127.0.0.1), the default gateway, an internal server, an external IP address (such as 8.8.8.8), and an external host name. The first place where it fails is a hint to where the cause is.

Practice Questions

Practice Problem

Which of the following can the ping command normally NOT verify?

回答がサーバーに送信されることはありません
Practice Problem

Which is the most appropriate explanation when Request timed out. is displayed?

回答がサーバーに送信されることはありません
#Command Prompt #Batch File #ping #Network #Command