Skip to main content

AnyDns

An anyio extension featuring compatability of multiple different asynchronous dns resolver libraries. The concept follows the same concept as anyio itself where trio and asyncio can be used either way. This library also adds useful additional tools such as msgspec which can allow you to convert your DNS resuls in whatever way you want or even let you host your own applications with litestar.

Supported Libraries

This library takes c-ares libraries currently but many more implementations could be easily added on in the future as long as they follow the basic concept of anyio support with the ability to run on Windows, Linux and Apple.

Current Usage

Frontend is still being worked on for now but currently picking the library installed should be enough for now.

import anyio

from anydns.cyares import DNSResolver

# this will also work
from anydns.pycares import DNSResolver

async def main():
    async with DNSResolver(["8.8.4.4","1.1.1.1"], timeout=2) as r:
        info = await r.gethostbyaddr("50.87.249.219")
    # HostResult(name='box2079.bluehost.com', aliases=['box2079.bluehost.com'], addresses=['50.87.249.219'])
    print(info)


if __name__ == "__main__":
    anyio.run(main)

cyares

Cyares is implemented as a backend that uses the .cyares module. It utilizes c-ares and cython and was made out of pure inspiration of pycares (by the same author of this library even) with the goal of added features, extreme speed and a few other safety mechanisms.

pip install anydns[cyares]

pycares

Pycares was implemented as a backend that uses the .pycares module. It utilizes c-ares and cffi. pycares this is also a very mature library with over a decade of maitenence.

pip install anydns[pycares]

Installing everything

If you need to test every single supported backend under the sun when developing your applications (example: testing each one out and checking for bugs) do this

pip install anydns[all]

Adding your library to the current List.

If you have a dns library of your own that you want to include the following criteria must be met.

  • must support all operating systems on a PC but mostly the main 3
    • Windows, Linux, Apple
  • must be compatable with anyio's system
  • must be subclassed from AbstractDNSResolver

Current State

Tests are on my todolist but a release should be coming out soon.

Metadata

Release files for anydns 0.1.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 anydns 0.1.0
File Size Uploaded Provenance Actions
anydns-0.1.0.tar.gz 17.9 kB Without provenance Details for anydns-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anydns 0.1.0
File Interpreter ABI Platform Actions
anydns-0.1.0-py3-none-any.whl Python 3 none any Details for anydns-0.1.0-py3-none-any.whl

Total release size: 37.4 kB

Release files / anydns-0.1.0.tar.gz

Download URL anydns-0.1.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
679d5be07d8be4fe4955380e7acc0b2028732d562727dbe4870ce20727bcbf88
BLAKE2b-256 checksum
How to use checksums
0426d382e060fcc64788dd857a8025659be618cee5474d01f42867bc9a898aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / anydns-0.1.0-py3-none-any.whl

Download URL anydns-0.1.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bc9457e9cea73c63bb4a07075b561e05e705a57423a76905ddd055e2076f912
BLAKE2b-256 checksum
How to use checksums
33e88a2ad36fe4378baf2e38decf541e28bfc4cab987395310688af7c42c189b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for anydns 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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