ping - Network Connectivity Check

Maintained on
Table of Contents

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?”.

Quick Reference: Copy-Paste ping Commands

GoalCommand
Check connectivity (4 requests)ping example.com
Set the number of requests (10)ping /n 10 example.com
Keep pinging until stopped (Ctrl+C)ping /t 192.168.1.1
Wait 1 second for each reply (default is 4 seconds)ping /w 1000 192.168.1.1
Force IPv4ping /4 example.com
Look up the host name of an IP addressping /a 192.168.1.10
Check your PC’s own network stackping 127.0.0.1

Paste your ping result to check it

If you are not sure how to read the result, paste what Command Prompt shows as is. The tool judges the state from the replies and loss rate, and shows possible causes and commands to try next.

Check your ping result

Paste the ping output from Command Prompt as is to see what it means and what to try next.

Try a sample:

The check runs on this page. What you paste is not sent anywhere.

Paste a ping result and the verdict appears here.

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. The default is 4000 (4 seconds)
/aTry to resolve the host name from the IP address
/4Use IPv4
/6Use IPv6
/l <size>Specify the data size in bytes. The default is 32, the maximum is 65500
/i <TTL>Set the TTL (the maximum number of routers the packet can pass through)

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

Start by using the message to narrow down where it fails.

MessageMeaningCheck first
Reply from ...: bytes=32 time=15ms TTL=119The destination replied (working)Response time and loss rate
Request timed out.No reply within the wait timeWhether the destination accepts ping
Destination host unreachable.No way to deliver to the destination was foundYour IP address and default gateway
Destination net unreachable.A router has no route to the destination networkRouter settings and VPN connection
Ping request could not find host ...The host name could not be converted to an IP addressSpelling of the host name and DNS
General failure.Your PC could not send the packetNetwork connection and security software
TTL expired in transit.The hop limit was reached at a router on the wayA routing loop (check with tracert)

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. Windows counts these lines as “Received” in its statistics, so even 0% loss there does not mean the destination was reached.

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.

When Ping request could not find host ... is displayed

Name resolution (DNS), which converts the host name to an IP address, failed. Nothing was sent to the destination yet, so first check the spelling of the host name and use nslookup to see whether DNS returns an IP address. For an internal host name, also check that you are connected to the VPN.

When General failure. is displayed

PING: transmit failed. General failure. means your PC could not send the packet. Check that Wi-Fi or the cable is connected, that the network adapter is not disabled, and that security software is not blocking traffic. If sending over IPv6 fails, adding /4 to send over IPv4 may work.

When TTL expired in transit. is displayed

The packet reached its hop limit (TTL) before arriving at the destination. This is often caused by a router misconfiguration that makes packets loop between the same routers (a routing loop). Use tracert to check whether the same routers appear repeatedly.

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.

Check reachability in a batch file

When judging a ping result in a batch file, do not rely on the exit code alone. It can be 0 even when a router replies with “Destination host unreachable”. Using find to look for a line containing TTL= in the output detects only genuine replies from the target over IPv4 (IPv6 replies may not show TTL).

ping-check.bat
@echo off
ping /n 1 192.168.1.1 | find "TTL=" >nul
if %errorlevel%==0 (
  echo Got a reply.
) else (
  echo No reply.
)

Practice Questions

Practice Problem

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

Choose one answer.

  1. Whether the destination on the network is reachable
  2. The approximate time taken to respond
  3. Detailed hardware configuration of the destination

Practice Problem

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

Choose one answer.

  1. The destination host is definitely down
  2. ICMP may be blocked
  3. Only the DNS settings are definitely broken
Try more practice questions 171 questions by topic. Answer in your browser and check instantly. Start practicing →
#Command Prompt #Batch File #ping #Network #Command