--- id: pycares version: "5.0.1" license: MIT license_treatment: permissive maintenance: active --- # pycares — Python interface for c-ares License: permissive · Maintenance: active · Downloads: 21.3M/mo ## 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 above — verify before relying. pycares provides a Python interface to c-ares, a C library for asynchronous DNS requests and name resolution. 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 pip install pycares uv add pycares poetry add pycares ## Installing pycares 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. 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) Requires cffi and a C compiler or prebuilt wheels for your platform. Tests require internet access for real DNS queries. 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_current - Install friction: medium - Maintenance: active - Downloads: 21.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags async DNS resolution, DNS queries python, c-ares binding, asynchronous name resolution, DNS client library, domain name lookup, network DNS resolver, dns-resolution, async-networking, c-binding [View on SkillFed](https://skillfed.io/packages/pycares) · [View on PyPI](https://pypi.org/project/pycares/)