How to Ping a Website in Linux to Check Your Internet Connection

When you are working in the Linux terminal and suddenly realize your software updates are failing to download, the very first troubleshooting step you must take is verifying whether your server actually has a working internet connection. Rather than trying to open a clunky text-based web browser, network administrators use a tiny, lightning-fast command-line tool to send a small packet of data to a reliable website (like Google) to see if it responds.

Using the Ping Command

The ping utility is pre-installed on virtually every single Linux distribution ever created.

  1. Open your terminal application (or connect to your server via SSH).
  2. Type the following command:
    ping google.com
  3. Press Enter.

The terminal will immediately begin sending 64-byte packets of data to Google’s servers. If your internet is working perfectly, you will see a continuous, scrolling list of responses that look like this:
64 bytes from maa03s35-in-f14.1e100.net: icmp_seq=1 ttl=115 time=14.2 ms

This confirms that your server reached the internet and Google responded in 14.2 milliseconds.

How to Stop the Ping Command

Unlike Windows, which automatically stops pinging after four attempts, the Linux ping command will run infinitely until it crashes your terminal or you manually force it to stop.

To safely stop the endless scrolling list of responses, simply hold down the Ctrl key and press C (Ctrl + C). The terminal will instantly halt the process and print a helpful statistical summary showing exactly how many packets were sent, how many were received, and your total packet loss percentage.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

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

Receive our best articles and tips delivered straight to your inbox.