pycares
Python interface for c-ares
Decision gist · record as of 2026-08-14
Yes, if you need asynchronous DNS resolution in Python. pycares is actively maintained, has no known vulnerabilities, supports modern Python versions, and offers broad platform coverage via prebuilt wheels. The medium install friction (compiled extension) is offset by the availability of wheels. Install only if your application genuinely requires non-blocking DNS queries; the standard library's socket module is sufficient for most synchronous use cases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires cffi and a C compiler or prebuilt wheels for your platform.
- Tests require internet access for real DNS queries.
- Medium install friction due to compiled extension (cffi dependency).
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in commercial and private projects.
last release 2026-01-01 (225 days) · last repo commit 2026-08-01 · 183 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 21,344,113 downloads/mo, #1,003 on PyPI
Alternatives
Verify before relying
pip install pycares
import pycares
# Query A records for a domain
resolver = pycares.Resolver()
resolver.query('example.com', pycares.QUERY_TYPE_A)- Whether async/await patterns are directly supported or only callback-based API
- Performance characteristics compared to standard library socket.getaddrinfo()
- Whether bundled c-ares submodule is kept in sync with upstream security patches
What it is and what it does
pycares is a Python binding to c-ares, a C library that performs DNS resolution asynchronously. It wraps c-ares to allow Python code to make non-blocking DNS queries for A, AAAA, MX, and other record types. The package bundles c-ares as a submodule by default, though you can use a system-provided c-ares library by setting the PYCARES_USE_SYSTEM_LIB environment variable during build.
The package supports Python 3.9 and later on CPython and PyPy, with prebuilt wheels for Windows, macOS, and Linux. It can be used programmatically from Python code or directly from the command line with a dig-like interface. Optional IDNA 2008 support is available by installing the idna package alongside it.
Use it for
- Perform non-blocking DNS lookups in async applications without blocking the event loop
- Resolve multiple domain names concurrently in network tools or web scrapers
- Query specific DNS record types (MX, NS, SRV) for mail server or service discovery
- Use as a CLI tool similar to dig for quick DNS queries from the command line
- Build DNS-dependent services that need fine-grained control over resolution behavior
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need asynchronous DNS resolution in Python.
pycares is actively maintained, has no known vulnerabilities, supports modern Python versions, and offers broad platform coverage via prebuilt wheels. The medium install friction (compiled extension) is offset by the availability of wheels. Install only if your application genuinely requires non-blocking DNS queries; the standard library's socket module is sufficient for most synchronous use cases.
Install
pycares on PyPI
Before you install
Medium install friction due to compiled extension (cffi dependency). Active maintenance with recent commits and broad platform coverage via prebuilt wheels for CPython 3.9–3.14 and PyPy.
Requires cffi and a C compiler or prebuilt wheels for your platform. Tests require internet access for real DNS queries.
License in practice
MIT license permits unrestricted use, modification, and distribution in commercial and private projects.
Quickstart
pip install pycares
import pycares
# Query A records for a domain
resolver = pycares.Resolver()
resolver.query('example.com', pycares.QUERY_TYPE_A)
Verify before relying
- Whether async/await patterns are directly supported or only callback-based API
- Performance characteristics compared to standard library socket.getaddrinfo()
- Whether bundled c-ares submodule is kept in sync with upstream security patches
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagecffi |
| Maintenance | Actively maintained 225 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 21,344,113 / month, #1,003 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming 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 :: 3.9Programming Language :: Python :: Free Threading :: 3 - StableProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: pycares-5.0.1-cp310-cp310-macosx_10_9_x86_64.whl; pycares-5.0.1-cp310-cp310-macosx_11_0_arm64.whl; pycares-5.0.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pycares-5.0.1-cp310-cp310-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl; pycares-5.0.1-cp310-cp310-manylinux_2_26_s390x.manylinux_2_28_s390x.whl; pycares-5.0.1-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; pycares-5.0.1-cp310-cp310-musllinux_1_2_aarch64.whl; pycares-5.0.1-cp310-cp310-musllinux_1_2_ppc64le.whl; pycares-5.0.1-cp310-cp310-musllinux_1_2_s390x.whl; pycares-5.0.1-cp310-cp310-musllinux_1_2_x86_64.whl; pycares-5.0.1-cp310-cp310-win_amd64.whl; pycares-5.0.1-cp310-cp310-win_arm64.whl; pycares-5.0.1-cp311-cp311-macosx_10_9_x86_64.whl; pycares-5.0.1-cp311-cp311-macosx_11_0_arm64.whl; pycares-5.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pycares-5.0.1-cp311-cp311-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl; pycares-5.0.1-cp311-cp311-manylinux_2_26_s390x.manylinux_2_28_s390x.whl; pycares-5.0.1-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; pycares-5.0.1-cp311-cp311-musllinux_1_2_aarch64.whl; pycares-5.0.1-cp311-cp311-musllinux_1_2_ppc64le.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “c-ares binding”
- pycarespycares provides a Python interface to c-ares, a C library for…
- shiboken2Shiboken2 provides Python access to metadata and utilities for…
- ccimportccimport builds Python C++ bindings on-the-fly using pybind11 and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internet packages
Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.
Install it if you need programmatic access to AWS services.
Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.
Install it if you need to call AWS services from async Python code; it is the standard way to do so.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.
See also aiodns · dnspython · nslookup · dnslib · apeye-core · py3dns · aiohttp-asyncmdnsresolver · google-cloud-dns · idna_ssl · adguardhome