COMMAND

pingTest reachability with ICMP echo

ping sends ICMP echo requests to a host and reports whether replies come back and how long they take. It is the quickest test of basic reachability and latency. ping -t runs continuously, ping -n sets the count, and a timeout means the host is unreachable, filtering ICMP, or down.

BlackhawkHub Editorial · Updated

Purpose

ping answers "can this machine reach that host, and how fast?". It sends ICMP echo request packets and times the echo replies. It does not test any particular service (that is what Test-NetConnection is for), only whether packets get there and back.

Syntax

text
ping [-t] [-n count] [-l size] [-4] [-6] [-a] [-w timeout] target

Useful options

OptionEffect
-tPing until stopped (Ctrl+C); Ctrl+Break for interim stats
-n countSend this many requests (default 4)
-l sizePayload size in bytes (test MTU and fragmentation)
-4 / -6Force IPv4 or IPv6
-aResolve the address to a hostname
-w timeoutWait this many milliseconds for each reply

Reading the output

cmd
ping example.com
text
Pinging example.com [93.184.215.14] with 32 bytes of data:
Reply from 93.184.215.14: bytes=32 time=11ms TTL=56
Reply from 93.184.215.14: bytes=32 time=12ms TTL=56

Ping statistics for 93.184.215.14:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 11ms, Maximum = 12ms, Average = 11ms
  • Reply from … — the host answered; time is the round trip, TTL hints at hop count.
  • Request timed out — no reply within the timeout: host down, unreachable, or dropping ICMP.
  • Destination host unreachable — a router (often your own PC or gateway) has no route; usually a local configuration problem.
  • Could not find hostDNS resolution failed before any packet was sent.

A reachability ladder

  1. ping 127.0.0.1 — the loopback; failure means the TCP/IP stack is broken.
  2. ping your own IP — the adapter.
  3. ping the default gateway — the local link to the router.
  4. ping 1.1.1.1 — the internet by address (no DNS needed).
  5. ping example.com — the internet by name (DNS working).

The first step that fails localises the problem.

Common mistakes

  • Treating a ping timeout as proof a service is down. ICMP is frequently filtered; test the actual port instead.
  • Pinging a name when DNS is the problem. Ping an address first to separate routing from resolution.
  • Using ping to measure application latency. It measures network round trip, not server processing time.

PowerShell equivalent

Test-Connection example.com -Count 4 returns objects you can filter; Test-Connection -TargetName host -TcpPort 443 (PowerShell 7) tests a TCP port, closer to Test-NetConnection.

Frequently asked questions

Why does "Request timed out" not always mean the host is down?

Many hosts and firewalls drop ICMP echo by design, so a timeout can mean "reachable but not answering pings". A successful TCP test to a known port (Test-NetConnection) confirms reachability where ping cannot.

How do I ping continuously?

ping -t host pings until you press Ctrl+C; Ctrl+Break shows statistics without stopping. Useful for watching a flaky link over time.

What does the TTL value mean in a ping reply?

Time To Live, decremented by each router. A reply TTL of 117 from a start of 128 suggests about 11 hops. It hints at the number of routers and, roughly, the remote operating system's default TTL.

Sources