Skip to main content
https://github.com/aio-libs/aiohttp-asyncmdnsresolver/actions/workflows/ci-cd.yml/badge.svg https://codecov.io/gh/aio-libs/aiohttp-asyncmdnsresolver/branch/main/graph/badge.svg https://badge.fury.io/py/aiohttp-asyncmdnsresolver.svg https://readthedocs.org/projects/aiohttp-asyncmdnsresolver/badge/?version=latest https://img.shields.io/pypi/pyversions/aiohttp-asyncmdnsresolver.svg Matrix Room — #aio-libs:matrix.org Matrix Space — #aio-libs-space:matrix.org

Introduction

This module provides an aiohttp resolver that supports mDNS, which uses the zeroconf library to resolve mDNS queries.

For full documentation please read https://aiohttp-asyncmdnsresolver.readthedocs.io.

Installation

$ pip install aiohttp-asyncmdnsresolver

Quick start

import asyncio
import aiohttp
from aiohttp_asyncmdnsresolver.api import AsyncMDNSResolver

async def main():
    resolver = AsyncMDNSResolver()
    # aiohttp does not own a resolver passed to TCPConnector, so close it here.
    try:
        connector = aiohttp.TCPConnector(resolver=resolver)
        async with aiohttp.ClientSession(connector=connector) as session:
            async with session.get('http://example.com') as response:
                print(response.status)
            async with session.get('http://xxx.local.') as response:
                print(response.status)
    finally:
        await resolver.close()

asyncio.run(main())

Resolving with both mDNS and DNS

AsyncDualMDNSResolver is a variant that resolves .local names over mDNS and regular DNS concurrently, returning the first successful result. Use it when a .local name may be served by a unicast DNS server as well as mDNS.

import asyncio
import aiohttp
from aiohttp_asyncmdnsresolver.api import AsyncDualMDNSResolver

async def main():
    resolver = AsyncDualMDNSResolver()
    # aiohttp does not own a resolver passed to TCPConnector, so close it here.
    try:
        connector = aiohttp.TCPConnector(resolver=resolver)
        async with aiohttp.ClientSession(connector=connector) as session:
            async with session.get('http://printer.local.') as response:
                print(response.status)
    finally:
        await resolver.close()

asyncio.run(main())

API documentation

The documentation is located at https://aiohttp-asyncmdnsresolver.readthedocs.io.

Source code

The project is hosted on GitHub

Please file an issue on the bug tracker if you have found a bug or have some suggestion in order to improve the library.

Authors and License

It’s Apache 2 licensed and freely available.

Metadata

Release files for aiohttp-asyncmdnsresolver 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiohttp-asyncmdnsresolver 0.2.0
File Size Uploaded
aiohttp_asyncmdnsresolver-0.2.0.tar.gz 37.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiohttp-asyncmdnsresolver 0.2.0
File Interpreter ABI Platform
aiohttp_asyncmdnsresolver-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.5 kB

Release files / aiohttp_asyncmdnsresolver-0.2.0.tar.gz

Download URL aiohttp_asyncmdnsresolver-0.2.0.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aab2cef7ef8ae45b94abf1fc92aa9f4d70cbef7ac0a3d495a86fb96fce357262
BLAKE2b-256 checksum
How to use checksums
c1861b94f5669df188f5267e26d48c4cc734b704310e53d695af5f39ee1af67d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 20, 2026.

Transparency log

Release files / aiohttp_asyncmdnsresolver-0.2.0-py3-none-any.whl

Download URL aiohttp_asyncmdnsresolver-0.2.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e6dc01719dc563346ae051122fa7dc3a757317e3e6bf4ef8b23cfd034089c22
BLAKE2b-256 checksum
How to use checksums
1ed5c08b4e242d50d2aded314a16105ee708946fa3dfd37b837b1ca625d26397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page