How to use the ping command

By Angus Published 23 January 2025 Updated 24 February 2026 4 min read

Network connectivity problems prevent visitors from reaching your site and make it difficult to access your server. The ping command tests whether a connection exists between your computer and a destination server by measuring how long packets take to travel there and back.

You will use ping to check if a server responds, measure connection speed and identify where network problems occur. This helps you diagnose website errors and determine whether issues originate from your network, your hosting provider or somewhere in between.

Before you begin

  • You need access to a command prompt or terminal on your computer.
  • Have your server hostname or IP address ready if testing your hosting server.

How ping works

Ping sends Internet Control Message Protocol packets to a destination and waits for replies. Each reply includes a response time measured in milliseconds. Lower numbers indicate faster connections with less latency. The command continues sending packets until you stop it or it reaches a preset limit.

You can ping IP addresses, domain names or hostnames. The destination server must be configured to respond to ping requests, though some servers block these for security reasons.

Run a basic ping test on Windows

Windows includes the ping command in its command prompt. You will open a command window, run the ping command and review the results to check connectivity.

  1. Open the command prompt.
    Press Windows + R on your keyboard, type cmd and press Enter. A black command prompt window appears.
  2. Enter the ping command.
    Type ping followed by a space and your destination. This can be a domain name like google.com, an IP address like 192.168.1.1 or your server hostname. Press Enter to start the test.
  3. Review the output.
    Windows sends four packets by default and displays the response time for each one. The summary at the bottom shows total packets sent, received and lost, plus minimum, maximum and average response times.

Here is example output from a successful ping test to google.com:

C:\Users\user>ping google.com

Pinging google.com [216.58.212.238] with 32 bytes of data:
Reply from 216.58.212.238: bytes=32 time=16ms TTL=115
Reply from 216.58.212.238: bytes=32 time=15ms TTL=115
Reply from 216.58.212.238: bytes=32 time=13ms TTL=115
Reply from 216.58.212.238: bytes=32 time=16ms TTL=115

Ping statistics for 216.58.212.238:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 13ms, Maximum = 16ms, Average = 15ms

This output shows all four packets received replies with response times between 13ms and 16ms. Zero packet loss confirms a stable connection.

Use additional parameters

Ping accepts parameters that modify its behaviour. You add these flags between the ping command and the destination address. Parameters let you control how many packets to send, adjust timing intervals or force specific IP versions.

Common parameters include:

  • -c <count> sends a specific number of packets: ping -c 5 google.com
  • -i <interval> sets seconds between packets: ping -i 2 google.com
  • -s <size> changes packet size in bytes: ping -s 100 google.com
  • -W <timeout> sets response timeout in seconds: ping -W 1 google.com
  • -4 forces IPv4: ping -4 google.com
  • -6 forces IPv6: ping -6 google.com

Some parameters require administrator privileges. On Linux and macOS, prefix the command with sudo if you receive permission errors.

Interpret ping results

Successful connections show replies with consistent response times and zero packet loss. Response times under 100ms indicate good performance for most applications. Times between 100ms and 300ms remain acceptable for web browsing but may affect real-time applications.

Connection problems appear as timeout messages, high packet loss percentages or inconsistent response times. Packet loss above 5% suggests network instability. Timeouts mean packets never reached the destination or replies never returned. Wildly varying response times point to network congestion.

If ping reveals issues reaching your server, check your access logs to see whether the server itself is responding to requests. You can also use the traceroute command to identify where along the network path problems occur.

Wrapping up

You can now test network connectivity using the ping command. You opened a command prompt, ran ping tests against servers and interpreted the results to identify connection problems. This helps you diagnose whether issues originate from your network, your server or intermediate routing.

Run ping tests regularly when troubleshooting connectivity issues. Compare results from different locations to isolate problems. Our web hosting and VPS hosting plans include network monitoring to help identify and resolve connectivity issues quickly.

If you run into any trouble, get in touch and our team will be happy to help.

Ready to get started?

Launch your website with our reliable cPanel hosting with unlimited bandwidth and expert support.

Get cPanel Hosting

Need a domain?

Find and register the perfect domain name for your website.

Search Domains