--- id: aiohttp-asyncmdnsresolver version: "0.2.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aiohttp-asyncmdnsresolver — An async resolver for aiohttp that supports MDNS License: permissive · Maintenance: active · Downloads: 555.8K/mo ## 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 above — 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 pip install aiohttp-asyncmdnsresolver uv add aiohttp-asyncmdnsresolver poetry add aiohttp-asyncmdnsresolver ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 555.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aiohttp mdns resolver, async mdns resolution, zeroconf aiohttp integration, local domain name resolution, aiohttp custom resolver, mdns dns fallback resolver, asyncio mdns client, mdns, service-discovery, asyncio [View on SkillFed](https://skillfed.io/packages/aiohttp-asyncmdnsresolver) · [View on PyPI](https://pypi.org/project/aiohttp-asyncmdnsresolver/)