skillfed

py3dns

Python 3 DNS library

py3dns v4.0.2 128.0K downloads/30d#11,722 on PyPI
License unclear DORMANT released

What it is and what it does

py3dns is a Python 3 port of the original pydns library, providing a straightforward interface for making DNS queries. It handles nameserver discovery from system configuration, supports multiple nameservers with fallback, and returns results in useful formats—including ipaddress objects for A and AAAA queries by default. The package includes convenience functions for reverse DNS and MX record queries.

The library is synchronous only; async DNS support was removed in version 4.0.0. With no runtime dependencies and low install friction, py3dns is a minimal, self-contained option for basic DNS lookups in Python 3 applications, though its dormant maintenance status means no active development or bug fixes.

Use it for:

  • Perform reverse DNS lookups to resolve IP addresses to hostnames in network monitoring or logging.
  • Query MX records to validate email domain configurations or build mail server lists.
  • Look up A/AAAA records to resolve domain names to IP addresses in custom DNS clients or network tools.
  • Retrieve SOA records to check zone authority and serial numbers for DNS administration tasks.
  • Build DNS query utilities or diagnostic tools that need synchronous, lightweight DNS resolution.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides synchronous DNS query functionality for Python 3, supporting common record types with configurable nameservers and result formatting.

Yes, if you need lightweight synchronous DNS queries and can accept dormant maintenance. The package is stable, has no dependencies, and works reliably for basic DNS lookups in Python >=3.2. No, if you require async DNS, active maintenance, or clarity on licensing terms before deployment. The unclear license treatment warrants verification before use in proprietary contexts.

Install

py3dns on PyPI

pip

pip install py3dns

uv

uv add py3dns

poetry

poetry add py3dns

Installing py3dns

Before you install

Low install friction with no runtime dependencies. Dormant maintenance status (799 days since last release) means no active development, though the package remains functional for its stated purpose.

License in practice

License treatment is unclear—no SPDX identifier or explicit raw license text is available in the metadata, despite classifiers indicating Python License (CNRI Python License). Verify the actual license terms before use in proprietary or restricted contexts.

Quickstart

pip install py3dns
import DNS
req = DNS.Request()
result = req.req('example.com', qtype='A')

Requires Python >=3.2; async DNS queries are not supported (removed in version 4.0.0).

Verify before relying

  • Whether the Python License (CNRI Python License) is compatible with your project's licensing requirements.
  • Current stability and compatibility with Python versions beyond 3.2, given dormant maintenance status.
  • Whether the package handles edge cases in modern DNS environments or has known limitations with certain record types.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.2)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 799 days since the last release
First released
Downloads 128,033/month — #11,722 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py3dns-4.0.2-py3-none-any.whl

Keywords: DNS

Development Status :: 5 - Production/StableEnvironment :: No Input/Output (Daemon)Intended Audience :: DevelopersLicense :: OSI Approved :: Python License (CNRI Python License)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Internet :: Name Service (DNS)Topic :: Software Development :: Libraries :: Python Modules

Tags

DNS queries pythondomain name lookupresolve DNS recordsnameserver queriespython dns libraryA record lookupMX record resolver
dns-resolvernetwork-utilities

More Python Modules packages