skillfed

aiohttp-asyncmdnsresolver

An async resolver for aiohttp that supports MDNS

aiohttp-asyncmdnsresolver v0.2.0 555.8K downloads/30d#6,024 on PyPI2
Permissive license Apache-2.0 Active released

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-asyncmdnsresolver

uv

uv add aiohttp-asyncmdnsresolver

poetry

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 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

Development Status :: 5 - Production/StableFramework :: AsyncIOFramework :: aiohttpIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTyping :: Typed

Tags

aiohttp mdns resolverasync mdns resolutionzeroconf aiohttp integrationlocal domain name resolutionaiohttp custom resolvermdns dns fallback resolverasyncio mdns client
mdnsservice-discoveryasyncio

More WWW/HTTP packages