22 releases (6 stable)

Uses new Rust 2024

new 2.1.1 May 15, 2026
1.0.2 May 11, 2026
0.5.1 Sep 25, 2025
0.5.0 Mar 14, 2025
0.3.3 Jul 28, 2021

#1146 in Network programming

GPL-3.0-or-later

36KB
900 lines

pingall

CI Crates.io Downloads Docs.rs License AUR AUR Git

Utility to quickly and efficiently discover available IP addresses and their hostnames on your network. This program will always finish within a small timeout, much faster than nmap 192.168.1.*.

  • Quickly find IPv4 and IPv6 addresses and hostnames on your network.
  • Populate DNS/mDNS tables automatically.

Usage

Usage: pingall [OPTIONS]

Options:
  -i, --interface <INTERFACE>  Interface to search
  -d, --dont-resolve           Don't attempt to resolve hostnames
  -r, --raw-socket             Open raw socket instead of using system `ping` command. Unix only, requires permissions
  -t, --timeout <TIMEOUT>      Timeout of pings in seconds [default: 1]
  -4, --ipv4                   Scan IPv4 addresses only
  -6, --ipv6                   Scan IPv6 addresses only
  -h, --help                   Print help
  -V, --version                Print version

Ping all available IP addresses:

$ pingall
192.168.0.1        router.local
192.168.0.19       SAMSUNG-GALAXY-8
192.168.0.98       raspberrypi.local
10.10.0.132
10.10.0.152        vps.local
10.10.0.243
fe80::5054:ff:fe12:3456%wlan0

Ping only Wi-Fi addresses on wlan0, don't resolve hostnames:

pingall --interface wlan0 --dont-resolve
192.168.0.1
192.168.0.19
192.168.0.98

Scan only one address family:

pingall --ipv4
pingall --ipv6 --interface wlan0

Installation

cargo install pingall

On Arch Linux, pingall is also available from the AUR as pingall for the latest crates.io release or pingall-git for the current Git version.

Details

By default, pingall scans both IPv4 and IPv6. It simultaneously pings all IPv4 addresses on your local /24 subnets with a 1 second timeout, so we can gauge who is responsive on the network. IPv6 discovery uses the scoped all-nodes multicast address (ff02::1%interface) because typical IPv6 subnets are too large to sweep. tokio is used to make it all asynchronous (only 1 thread is used).

Raw Ping

The system ping command is used by default for IPv4 sweeps. On Windows, pingall always uses the system ping command. On Unix systems, opening raw sockets requires elevated permissions. To avoid using the ping command for IPv4 sweeps, you can use the --raw-socket flag, but this will require either sudo, or running

setcap cap_net_raw+ep $(which pingall)

to give this program permission. IPv6 multicast discovery uses tiny-ping sockets on Unix and falls back to the system ping command when sockets are unavailable.

Dependencies

Hostname resolution uses avahi-resolve on Linux and the operating system reverse lookup APIs on Windows.

Dependencies

~2–14MB
~83K SLoC