skillfed

dns-lexicon

Manipulate DNS records on various DNS providers in a standardized/agnostic way

dns-lexicon v3.25.2 161.1K downloads/30d#10,643 on PyPI126
Permissive license MIT Active released

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-lexicon

uv

uv add dns-lexicon

poetry

poetry add dns-lexicon

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: Name Service (DNS)Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Systems AdministrationTopic :: Utilities

Tags

dns record managementmulti-provider dns apidns automationletsencrypt dns challengedns provider abstractionbulk dns operationsdns cli tool
dns-automationletsencryptmulti-provider

More Python Modules packages