How to test network connectivity

Overview

ping sends test messages and reports replies, round-trip time, and packet loss. It can test a local device, router, hostname, or internet host.

A timeout does not prove a device is down: firewalls commonly block ping while web or other services continue to work.

  • Test from near to far: loopback, your gateway, then a hostname.
  • Press Ctrl+C to stop a continuous ping and show statistics.
  • Successful name lookup plus failed replies narrows—but does not finish—diagnosis.

Commands to try

Type each command at the prompt, then press Enter. Replace sample names and paths with ones that exist on your computer.

Commands are generally not case-sensitive, but preserving the spelling shown here makes scripts easier to read.

ping 127.0.0.1
ping -n 4 example.com
ping -4 example.com
ping -6 example.com
ping -t 192.168.1.1

Useful options and details

Options change how a command behaves. Add spaces exactly as shown, and use the command's built-in help when an option is unfamiliar.

A path containing spaces must be enclosed in double quotes, such as "C:\My Files".

  • -n count chooses the number of requests.
  • -t continues until stopped.
  • -4 and -6 force an IP version; -w milliseconds changes timeout.

Tips and common mistakes

Check the current folder and read the command output before assuming an operation succeeded.

Practice with disposable files first. Commands that delete, overwrite, or stop a process may not offer an Undo button.

  • Do not run continuous or high-volume tests against systems you do not manage.
  • Latency varies over Wi-Fi and the internet; one slow reply is not conclusive.
  • A mistyped hostname can look like a DNS failure.

Safe practice

Create a temporary practice folder under your user profile so the examples cannot affect Windows system files.

After each command, inspect the result with dir or another read-only command before continuing.

  • Ping loopback and your default gateway.
  • Ping example.com four times.
  • Compare a hostname test with its resolved IP address.