Standard network troubleshooting on Linux relies on the ubiquitous ping utility to verify ICMP reachability and measure round-trip latency. However, standard ping operates sequentially against a single host at a time. When auditing an entire local subnet, checking thirty server endpoints, or monitoring microservice availability, running sequential pings takes minutes. In Ubuntu, the fping (Fast Ping) utility sends round-robin ICMP echo requests in parallel, testing hundreds of network hosts simultaneously in seconds.
Installing fping in Ubuntu
The fping package is available directly within the standard Ubuntu Universe repositories.
sudo apt update
sudo apt install fping -y
Verify installation by checking the installed version:
fping --version
Pinging Multiple Targets in a Single Command
You can supply multiple individual domain names or IP addresses separated by spaces:
fping 1.1.1.1 8.8.8.8 9.9.9.9 example.com
The terminal immediately displays the status of each target host:
1.1.1.1 is alive
8.8.8.8 is alive
9.9.9.9 is alive
example.com is alive
Scanning Entire Subnet Ranges (-g flag)
Network administrators frequently need to discover which devices are currently connected and active on a local network. Using the -g (generate) flag, fping scans entire CIDR ranges:
# Scan an entire /24 subnet and display only responsive hosts
fping -a -g 192.168.1.0/24 2>/dev/null
Flag details:
-g: Generates an IP list dynamically from CIDR notation or start/end ranges (e.g.192.168.1.1 192.168.1.50).-a: Shows only alive (responsive) targets, suppressing clutter from inactive IPs.2>/dev/null: Silences ICMP error diagnostics (such as destination host unreachable) for cleaner output.
Reading Target Hosts from a Text File (-f flag)
For automated server auditing or recurring cron monitoring scripts, you can maintain a plain text file containing hostnames or IP addresses (one per line):
# Ping all hosts listed in servers.txt
fping -f servers.txt -s
The -s flag prints a comprehensive summary table at the end of the execution run, reporting total targets checked, alive counts, unreachable hosts, and minimum/average round-trip times.