aiodiscover
Discover hosts by arp and ptr lookup
What it is and what it does
aiodiscover is an async library for discovering hosts on a local network via ARP and reverse DNS (PTR) lookups. It exposes a DiscoverHosts context manager that can be reused across multiple scans, with optional interface pinning via local_ip to target a specific subnet. The package depends on aiodns for DNS resolution, async_timeout for operation timeouts, cached_ipaddress for IP caching, ifaddr for interface enumeration, and pyroute2 for netlink socket access to ARP tables.
Beyond the programmatic API, aiodiscover ships a command-line tool (aiodiscover) that scans the local network and outputs results in table, JSON, or pprint format. The CLI supports flags for output formatting, logging verbosity, recursive PTR queries, interface selection, and version display. Hostile DHCP or DNS responses are sanitized to prevent terminal injection.
Use it for:
- Scan a local network to enumerate connected devices and their hostnames, IPs, and MAC addresses for inventory or monitoring.
- Pin discovery to a specific interface on multi-homed hosts to scan a particular subnet instead of relying on the default route.
- Build network monitoring or diagnostics tools that need to discover and track devices asynchronously without blocking.
- Export discovered hosts as JSON for integration with other network management or orchestration systems.
- Validate network connectivity and hostname resolution for devices on a LAN in automated testing or deployment workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Discovers hosts on a local network by performing ARP and PTR lookups asynchronously, with support for interface selection and both programmatic and command-line usage.
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and offers low install friction. It fills a clear niche for async network host discovery with both programmatic and CLI interfaces. The Apache-2.0 license is permissive. Install if you need to discover or enumerate devices on a local network.
Install
aiodiscover on PyPI
pip
pip install aiodiscoveruv
uv add aiodiscoverpoetry
poetry add aiodiscoverInstalling aiodiscover
Before you install
Low install friction with a pure-Python wheel and five runtime dependencies. The package is actively maintained with a recent release (62 days ago) and supports current Python versions (3.10–3.14).
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions; attribution required.
Quickstart
import asyncio
from aiodiscover import DiscoverHosts
async def main():
async with DiscoverHosts() as discover_hosts:
hosts = await discover_hosts.async_discover()
print(hosts)
asyncio.run(main())
Requires Python 3.10 or later; ARP and PTR lookups depend on network interface access and DNS resolver availability.
Verify before relying
- Whether aiodns, pyroute2, and ifaddr are available on all target platforms (Windows, macOS, Linux) or have platform-specific limitations.
- Performance characteristics when scanning large subnets or networks with many hosts.
- Whether the package requires elevated privileges (root/admin) for ARP operations on all platforms.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — aiodns, async_timeout, cached_ipaddress, ifaddr, pyroute2 |
| Maintenance | actively maintained — 62 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 159,881/month — #10,685 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiodiscover-3.3.2-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
getmacRetrieves MAC addresses of local network…
permissive · top 15,000 on PyPI
python-hostsManages hosts file entries…
permissive · top 15,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
aioouiPerforms asynchronous lookups of…
permissive · top 15,000 on PyPI
nslookupProvides high-level DNS lookups (A, AAAA, and…
copyleft · top 15,000 on PyPI
aiodnsProvides asynchronous DNS resolution for…
permissive · top 5,000 on PyPI
zeroconfDiscovers and registers services on local…
copyleft · top 5,000 on PyPI
aiopingaioping provides an asyncio-based ICMP ping…
copyleft · top 15,000 on PyPI
python-nmapPython wrapper for the nmap port scanner that…
copyleft · top 15,000 on PyPI