How To Ping Multiple Hosts At Once In Linux

Ping Multiple Hosts At Once

We all know about PING (Packet INternet Groper) command, right? Yeah, it is used to verify a host or a IP address can able to communicate over the Network with another Computer or Network devices. Using Ping command, we can send ICMP Echo request to our target host, and test whether the destination host is alive or not. We can ping systems in LAN and WAN. The ping utility was originally written by Mike Muuss in December 1983 for troubleshooting problems in the network.

A typical usage of ping command is given below.

To ping an IP address in a LAN, run:

$ ping

Sample output:

To ping a host / domain / website:

$ ping

Sample output:

As you see in the above outputs, both hosts are alive, and we can able to communicate with them.

The one problem with PING command is we can’t ping multiple hosts at a time. We can only ping one system at a time.  If you ping to multiple hosts, the PING utility will wait for one host’s timeout or reply, and try to communicate with the another. If one host doesn’t go down, the PING utility will keep showing a particular host’s connectivity, and It will not show whether the other hosts are up or down.

Let me show you an example. I am going to ping the following hosts.


To do so, run:

$ ping

Sample output:

As you see in the above output, the PING utility shows only one host’s connectivity (, and it doesn’t show the results of other hosts. No worries! Here is where fping utility comes in handy. Using fping utility, we can ping any number of hosts at once.

fping is similar to PING utility that can used to test the connectivity of computers and network devices in LAN and WAN. Unlike PING command, fping will send a ICMP Echo request to one host, and move to the another host in a round-robin fashion.

Install fping

fping utility is available in almost all modern Linux/Unix operating systems.

To install fping on Arch Linux, run:

$ sudo pacman -Syu
$ sudo pacman -S fping

On Debian / Ubuntu:

$ sudo apt-get update
$ sudo apt-get install fping

On RHEL / CentOS / Scientific Linux / Fedora:

$ sudo yum install epel-release
$ sudo yum install fping


fping usage is simple and very similar to PING command.

For example, let us ping an IP address in a LAN:

$ fping

Sample output: is alive

To ping multiple hosts, run:

$ fping

Sample output: is alive is alive is alive is alive

Also, you can put the hosts that you want to ping in a text file, and ping them all at once.

Let us create a new text file called ping_hosts.txt.

$ nano ping_hosts.txt

Add the list of hosts, IP addresses, domains, websites etc.

That’s enough. Save and close the file.

Now, run the following command to ping all hosts which we mentioned in the text file as shown below.

$ sudo fping -f ping_hosts.txt

Sample output: is alive is alive is alive is alive is alive is alive

Sample output:

Cool! It works.

For more details, check man pages.

$ man fping

That’s all for now. Hope this guide helps. If you find this tutorial useful, share it on your social, professional networks and support OSTechNix.


Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...

3 Responses

  1. AlekseyShi says:

    fping functionality is not the same as ping. fping doesn’t show any details of ICMP pinging instead of ping.

  2. Rizwan Mohammed says:

    we can also use the traditional ping command as ping -c5 && ping -c5 to ping multiple addresses

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.