aiohttp-asyncmdnsresolver
An async resolver for aiohttp that supports MDNS
What it is and what it does
aiohttp-asyncmdnsresolver is a resolver plugin for aiohttp's TCPConnector that adds support for multicast DNS (mDNS) name resolution. It wraps the zeroconf library to resolve .local domain names asynchronously, enabling aiohttp clients to discover and connect to services advertised on local networks via mDNS. The package includes two resolver classes: AsyncMDNSResolver for mDNS-only resolution, and AsyncDualMDNSResolver for concurrent mDNS and regular DNS queries, returning the first successful result.
The package is designed for scenarios where you need to connect to devices or services on a local network that advertise themselves via mDNS (common in IoT, printers, and home automation). It integrates directly into aiohttp's connection pipeline by passing a resolver instance to TCPConnector, making it transparent to the rest of your aiohttp code. The resolver must be explicitly closed after use since aiohttp does not own it.
Use it for:
- Connect to IoT devices or smart home services advertised on the local network via mDNS (e.g., printers, cameras).
- Build a service discovery client that resolves .local hostnames without relying on external DNS servers.
- Implement fallback resolution for .local names that may exist in both mDNS and unicast DNS using AsyncDualMDNSResolver.
- Integrate mDNS support into aiohttp-based microservices running on local networks without DNS infrastructure.
- Test aiohttp clients against local services during development using mDNS-based hostnames.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an async resolver for aiohttp that enables mDNS name resolution using zeroconf, with a dual-resolver variant that queries both mDNS and regular DNS concurrently.
Yes. The package solves a specific, real problem (mDNS resolution in aiohttp) with low install friction, active maintenance, no known vulnerabilities, and a permissive license. Install it if you need to resolve .local hostnames or discover services on a local network; skip it if your application only uses standard DNS.
Install
aiohttp-asyncmdnsresolver on PyPI
pip
pip install aiohttp-asyncmdnsresolveruv
uv add aiohttp-asyncmdnsresolverpoetry
poetry add aiohttp-asyncmdnsresolverInstalling aiohttp-asyncmdnsresolver
Before you install
Low friction: pure Python wheel with three runtime dependencies (aiohttp, aiodns, zeroconf). Actively maintained with recent releases and no known vulnerabilities.
License in practice
Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
import asyncio
import aiohttp
from aiohttp_asyncmdnsresolver.api import AsyncMDNSResolver
async def main():
resolver = AsyncMDNSResolver()
try:
connector = aiohttp.TCPConnector(resolver=resolver)
async with aiohttp.ClientSession(connector=connector) as session:
async with session.get('http://example.local.') as response:
print(response.status)
finally:
await resolver.close()
asyncio.run(main())
Requires Python 3.10 or later; resolver must be explicitly closed after use.
Verify before relying
- Whether aiodns or zeroconf have their own system-level dependencies (e.g., compiled libraries or network services).
- Performance characteristics when resolving many concurrent mDNS queries or handling network timeouts.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiodns, aiohttp, zeroconf |
| Maintenance | actively maintained — 86 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 555,806/month — #6,024 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiohttp_asyncmdnsresolver-0.2.0-py3-none-any.whl
Tags
More WWW/HTTP 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
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
zeroconfDiscovers and registers services on local…
copyleft · top 5,000 on PyPI
aiodnsProvides asynchronous DNS resolution for…
permissive · top 5,000 on PyPI
nslookupProvides high-level DNS lookups (A, AAAA, and…
copyleft · top 15,000 on PyPI
aiohttp-client-cacheAdds transparent request caching to…
permissive · top 15,000 on PyPI
aiohttp_socksProvides a proxy connector for aiohttp that…
permissive · top 5,000 on PyPI
pycarespycares provides a Python interface to c-ares,…
permissive · top 5,000 on PyPI
aioairqAsynchronous Python library for retrieving…
permissive · top 15,000 on PyPI
aiohttp-retryWraps aiohttp's ClientSession to automatically…
permissive · top 1,000 on PyPI
aiohttp-asgi-connectorProvides an AIOHTTP connector that lets you…
permissive · top 15,000 on PyPI