dns-lexicon
Manipulate DNS records on various DNS providers in a standardized/agnostic way
What it is and what it does
dns-lexicon abstracts away the differences between DNS provider APIs, letting you manage DNS records using a single standardized interface. It supports many providers—from major cloud platforms like AWS Route 53, Azure, and Google Cloud DNS to registrars like GoDaddy, Namecheap, and smaller regional providers. You can use it as a command-line tool for one-off operations or import it as a Python library for automation scripts.
The package was designed specifically for Let's Encrypt certificate automation, where you need to prove domain ownership by creating DNS challenge records. It handles the boilerplate of authentication, API calls, and response parsing for each provider, so you write the same code regardless of which DNS backend you're using. Dependencies include requests for HTTP, cryptography for secure operations, dnspython for DNS utilities, and parsing libraries like beautifulsoup4 and pyyaml.
Use it for:
- Automate DNS record creation for Let's Encrypt ACME challenges across multiple DNS providers without rewriting provider-specific code.
- Build multi-tenant DNS management tools that support customers using different registrars or DNS hosting services.
- Migrate DNS records between providers by reading from one and writing to another using the same API.
- Create or update DNS records programmatically in CI/CD pipelines for dynamic infrastructure provisioning.
- Manage DNS records for intranet or private network SSL certificates where DNS validation is required.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
dns-lexicon provides a unified Python interface to create, read, update, and delete DNS records across multiple DNS providers via their APIs, usable as both a CLI tool and a library.
Yes. dns-lexicon is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a real problem for anyone managing DNS across multiple providers. The low install friction and broad provider support make it the standard choice for DNS automation, especially in Let's Encrypt workflows. Install it if you need to automate DNS operations or support multiple DNS backends.
Install
dns-lexicon on PyPI
pip
pip install dns-lexiconuv
uv add dns-lexiconpoetry
poetry add dns-lexiconInstalling dns-lexicon
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release and steady commit activity. Nine runtime dependencies are all well-established packages (requests, cryptography, dnspython, pyyaml, beautifulsoup4, etc.), so installation should be straightforward.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or redistribution in proprietary or commercial contexts.
Quickstart
pip install dns-lexicon
from lexicon.client import Client
from lexicon.config import ConfigResolver
config = ConfigResolver().with_env().with_dict({
"provider_name": "cloudflare",
"domain": "example.com",
})
with Client(config) as operations:
operations.create_record("TXT", "foo", "bar")
Requires Python 3.10 or later. Provider-specific API credentials must be configured via environment variables or passed in the config dict.
Verify before relying
- Whether all listed providers are equally well-maintained or if some have stale implementations.
- Performance characteristics when managing large numbers of DNS records across providers.
- Error handling and retry behavior for transient API failures from DNS providers.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — beautifulsoup4, cryptography, dnspython, importlib-metadata, pyotp, pyyaml, requests-unixsocket, requests, tldextract |
| Maintenance | actively maintained — 96 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 161,094/month — #10,643 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dns_lexicon-3.25.2-py3-none-any.whl
Keywords: dehydrated, dns, dns-lexicon, letsencrypt, lexicon
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
certbot-dns-multiA Certbot DNS plugin that automates ACME DNS…
permissive · top 15,000 on PyPI
octodnsoctoDNS provides tools to manage DNS records…
permissive · top 15,000 on PyPI
certbot-dns-duckdnsA certbot plugin that automates DNS-01…
permissive · top 15,000 on PyPI
google-cloud-dnsPython client library for Google Cloud DNS API…
permissive · top 15,000 on PyPI
nslookupProvides high-level DNS lookups (A, AAAA, and…
copyleft · top 15,000 on PyPI
dnspythondnspython is a DNS toolkit that handles…
permissive · top 1,000 on PyPI
certbot-dns-directadminA Certbot plugin that automates DNS-01…
unclear · top 15,000 on PyPI
dnslibEncodes and decodes DNS wire-format packets,…
permissive · top 5,000 on PyPI
certbot-dns-cloudflareAutomates DNS validation for Let's Encrypt…
permissive · top 5,000 on PyPI
infoblox-clientClient library for programmatic interaction…
permissive · top 15,000 on PyPI