Updated: 10 October 2026 · Applies to: fping 5.1 (Debian 13, Ubuntu 24.04 and 26.04), 5.2 (AlmaLinux 10 with EPEL) and 5.5 (Fedora 44), all tested

The fping command pings many hosts at once. Run fping host1 host2 host3 and each target is reported as "is alive" or "is unreachable"; run fping -a -q -g 192.0.2.0/24 to list the addresses in a subnet that answer. Unlike ping, which finishes one host before starting the next, fping sends to all targets in parallel, so it is the quick way to check a list of servers and it is easy to use in scripts.

Install fping

sudo apt install fping                                     # Debian, Ubuntu
sudo dnf install epel-release && sudo dnf install fping    # AlmaLinux, Rocky Linux (EPEL)
sudo dnf install fping                                     # Fedora

Versions differ a lot between distributions: Debian 13, Ubuntu 24.04 and Ubuntu 26.04 ship fping 5.1, EPEL has 5.0 for version 9 and 5.2 for version 10, and Fedora 44 has 5.5, the current upstream release. Everything below works on 5.1 unless it says otherwise. Check yours with fping --version.

Most used fping commands

  • fping host1 host2: is each host alive?
  • fping -f servers.txt: check every host listed in a file.
  • fping -u -f servers.txt: print only the hosts that do not answer.
  • fping -a -q -g 192.0.2.0/24: list the live addresses in a subnet.
  • fping -c 10 -q host1 host2: packet loss and min/avg/max latency per host.
  • fping -l -D host: ping forever with a timestamp on each line.
  • fping -s host1 host2: add a statistics summary at the end.

1. Check several hosts

Host names and IP addresses can be mixed. Output from our Debian 13 test (the second address is a documentation address that does not exist):

$ fping 127.0.0.1 192.0.2.1 localhost
127.0.0.1 is alive
localhost is alive
192.0.2.1 is unreachable
$ echo $?
1

The exit code tells a script what happened: 0 when every host answered, 1 when at least one did not, and 2 when a name could not be resolved (fping then prints, for example, nosuchhost.invalid: Name or service not known). With the default settings an address that never answers takes about 4 seconds before fping gives up, because it retries 3 times with a growing timeout.

2. Read the hosts from a file

Put one host name or IP address per line in a file, then:

$ fping -f servers.txt
127.0.0.1 is alive
198.51.100.20 is alive
localhost is alive
192.0.2.1 is unreachable
$ fping -u -f servers.txt
192.0.2.1

-a prints only the hosts that answer. You can also pipe a list in: cat servers.txt | fping or fping -f -. Reading a file as a normal user worked in our tests, although the 5.1 manual still says -f is for root only.

A small check you can run from cron, which prints a line only when something is down:

down=$(fping -u -f /root/servers.txt)
[ -n "$down" ] && echo "Not answering: $down"

3. Find which addresses in a subnet answer

fping -a -q -g 192.0.2.0/24
fping -a -q -g 192.0.2.10 192.0.2.20

-g generates the targets from a CIDR range or from a start and end address, -a shows only the ones that answer and -q hides per-probe results and ICMP error messages. With a CIDR range the network and broadcast addresses are skipped; for example fping -a -q -g 127.0.0.0/30 printed only 127.0.0.1 and 127.0.0.2. To scan faster, cut the retries and the timeout: fping -a -q -r 0 -t 200 -g 192.0.2.0/28 finished in 0.5 seconds in our test. Only scan networks you own or manage, and remember that many hosts block ping, so a silent address is not always a free one.

4. Measure packet loss and latency

Count mode sends a fixed number of pings to each host. With -q you get only the summary:

$ fping -c 5 -q 127.0.0.1 198.51.100.20 192.0.2.1
127.0.0.1     : xmt/rcv/%loss = 5/5/0%, min/avg/max = 0.024/0.027/0.031
198.51.100.20 : xmt/rcv/%loss = 5/5/0%, min/avg/max = 17.9/17.9/18.1
192.0.2.1     : xmt/rcv/%loss = 5/0/100%

The summary is written to standard error, so add 2>&1 when you pipe it into another command or a file. -C 4 instead lists the time of every single reply, which is handy for spreadsheets:

$ fping -C 4 -q 198.51.100.20 127.0.0.1
198.51.100.20 : 17.9 18.0 17.9 17.8
127.0.0.1     : 0.046 0.039 0.033 0.020

Add -o to see the accumulated outage time, for example 192.0.2.1 : xmt/rcv/%loss = 4/0/100%, outage(ms) = 4000. -e adds the round-trip time to the normal output (198.51.100.20 is alive (18.1 ms)).

5. Watch hosts continuously

$ fping -l -D 127.0.0.1
[1791565526.90458] 127.0.0.1 : [0], 64 bytes, 0.021 ms (0.021 avg, 0% loss)
[1791565527.90542] 127.0.0.1 : [1], 64 bytes, 0.035 ms (0.028 avg, 0% loss)

-l pings until you press Ctrl+C and then prints the loss and latency summary; -D adds a Unix timestamp. -l -Q 60 prints only a summary every 60 seconds. fping 5.5 can print readable times with -D --timestamp-format=iso ([2026-10-09T17:15:16+0000] style).

6. Statistics, thresholds and JSON

  • -s prints a final report: targets alive and unreachable, echoes sent and received, and minimum, average and maximum round-trip time.
  • -x 2 succeeds when at least 2 of the hosts answer: Enough hosts reachable (required: 2, reachable: 2) with exit code 0, or Not enough hosts reachable with exit code 1. From 5.2, -X does the same but stops as soon as enough hosts have answered.
  • fping 5.5 (Fedora 44) adds -J: with -c, -C or -l it prints one JSON object per line (5.1 and 5.2 do not have it), for example {"summary": {"host": "127.0.0.1", "xmt": 2, "rcv": 2, "loss": 0, "rttMin": 0.031, "rttAvg": 0.035, "rttMax": 0.039}}.

Other useful options

  • -r N retries (default 3), -t MSEC initial timeout (default 500 ms), -p MSEC time between pings to the same host in count and loop mode (default 1000 ms), -i MSEC time between packets to different hosts (default 10 ms).
  • -b BYTES packet size, -H N set the TTL, -M set Don't Fragment. Together they make a quick MTU test: on our 1500-byte path, fping -M -b 1472 -c 1 HOST got a reply and -b 1473 showed 100% loss.
  • -4 or -6 IPv4 or IPv6 only. -A shows addresses instead of names; on our system fping -A localhost printed ::1 is alive.
  • -n and -d show targets by reverse DNS name, -I eth0 or -S IP choose the interface or source address.

Common problems

  • "Operation not permitted" when running fping in a container: fping needs raw socket access. In our Podman test, a container without that capability failed with bash: line 1: /usr/bin/fping: Operation not permitted; starting it with --cap-add NET_RAW fixed it. On a normal server the packages set the capability on the binary for you.
  • Everything is unreachable: a firewall blocks ICMP on the targets, in between or on your side. Some servers turn off ping replies on purpose; see how to disable ping (ICMP echo) responses on a Linux server for the settings to look for.
  • The summary is missing from a file: count-mode statistics go to standard error; redirect with 2>&1.
  • Option not recognised: -J, -X and --timestamp-format are newer than the fping 5.1 in Debian and Ubuntu.

For single-host options such as packet size and flood tests see practical ping command examples. To see where along the route packets are lost, use MTR: how to diagnose network issues with MTR.

Official documentation: fping manual.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket