How to Ping an IP Address in Ubuntu

The Network Latency Vector

When an Ubuntu server suddenly loses the ability to fetch software updates, you must immediately diagnose the network failure. You cannot rely on web browsers in a headless environment. You must utilize the Internet Control Message Protocol (ICMP) to fire a microscopic data packet (an “echo request”) directly at a remote server (like Google’s DNS). If the remote server receives the packet, it is legally required by the protocol to fire a packet back (an “echo reply”). By timing this exchange, you instantly verify both connectivity and network latency.

How to Ping an IP Address

The Linux architecture utilizes the fundamental `ping` command-line utility to execute these diagnostic strikes.

1. Open your terminal application or connect to the server via SSH.
2. The Infinite Strike (Default Behavior):
* Unlike Windows (which stops after four pings), the Ubuntu `ping` command will run indefinitely until you manually terminate it.
* Type the command followed by the target IP address or domain name. For example, to ping Google’s primary DNS server:
ping 8.8.8.8
* Press Enter.
* The terminal will begin spitting out lines of telemetry, updating every second (e.g., `64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=14.2 ms`). The `time=` variable indicates your latency in milliseconds.
* Crucial Termination Command: To stop the infinite loop, you must press Ctrl + C. The utility will halt and print a mathematical summary of packet loss.
3. The Directed Strike (Recommended for Scripts):
* If you only want to send exactly four packets and then automatically stop (mimicking Windows behavior), you must append the `-c` (count) flag.
* Type:
ping -c 4 8.8.8.8
* Press Enter. The utility will execute four precise strikes, print the statistical summary, and return you to a clean terminal prompt.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.