Skip to main content

Manage your DNS records with ease.

Project description

dns-manager

PyPI - Python Version pypi PyPI - Downloads LICENSE
CodSpeed Badge
uv ruff Gitmoji

一个可扩展的 DNS 管理工具。

安装 Downloads

使用 pip/pipx/uv 安装

在此之前请确保安装 Python3.10 及以上版本,并安装了 pip。

pip install dns-manager[all]

如果想要尝试 Nightly 版本,可尝试(需确保使用 Python3.12)

pip install git+https://github.com/zrr1999/dns-manager@main

在此之前请确保安装了 pipx/uv

pipx install dns-manager[all]
uv tool install dns-manager[all]

pipx/uv 会无感地为 dns-manager 创建一个虚拟环境,与其余环境隔离开,避免污染其他环境, 因此相对于 pip,pipx/uv 是更推荐的安装方式。

使用说明

基础示例

首先创建一个配置文件,例如类似 examples/simple.toml 文件中的内容,如下:

[test]
domain = "mydomain.com"
setter_name = "cloudflare"
records = [
    [
      "test",  # 也就是 test.mydomain.com 指向的路径
      "baidu.com"  # 解析值,目前只支持 A 记录和 CNAME 记录,会根据此处的值自动判断
    ]
]

然后执行以下命令:

dns-manager update examples/simple.toml
# dnsm update examples/simple.toml

此时,你的解析记录就会增加一条 test.mydomain.com 的 CNAME 记录指向 baidu.com

支持的 dns 提供商

本项目实现了一个 lexicon 的适配 Setter, 支持情况与其一致。

定时执行

你可以使用 cronie 定时执行,例如

@reboot dnsm update ~/.config/dns-manager/config.toml
@hourly dnsm update ~/.config/dns-manager/config.toml

你可以通过下面的命令添加定时任务

(crontab -l 2>/dev/null; echo "@reboot dnsm update ~/.config/dns-manager/config.toml") | crontab
(crontab -l 2>/dev/null; echo "@hourly dnsm update ~/.config/dns-manager/config.toml") | crontab

如何贡献

非常欢迎你的加入!提一个 Issue 或者提交一个 Pull Request

贡献者

感谢以下参与项目的人:

使用许可

GNU © Rongrui Zhan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dns_manager-0.4.0-py312-none-any.whl (37.5 kB view details)

Uploaded Python 3.12

dns_manager-0.4.0-py311-none-any.whl (37.5 kB view details)

Uploaded Python 3.11

dns_manager-0.4.0-py310-none-any.whl (37.5 kB view details)

Uploaded Python 3.10

File details

Details for the file dns_manager-0.4.0-py312-none-any.whl.

File metadata

  • Download URL: dns_manager-0.4.0-py312-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dns_manager-0.4.0-py312-none-any.whl
Algorithm Hash digest
SHA256 8f2eb8550a246bebf8b63b6a348fb4a17b32d50026ab36bcd5f6535310f68617
MD5 530089adaae418dc1e577de0a156b237
BLAKE2b-256 e676fc8b16b3a10fd7f381128e63d61eed8e83eba53be11fe4d92cb492444bbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-0.4.0-py312-none-any.whl:

Publisher: release.yml on zrr-lab/dns-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dns_manager-0.4.0-py311-none-any.whl.

File metadata

  • Download URL: dns_manager-0.4.0-py311-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dns_manager-0.4.0-py311-none-any.whl
Algorithm Hash digest
SHA256 c80d40413126ce8cac36b4fb48b2050506b0f1adccd3635be7fd6b41f741e515
MD5 aad667bb1db36403244b0d83b48acd11
BLAKE2b-256 47d7b3494f643a2745471541efd94a24ea9ba2c7c6f43f1797f71f50b8a4ef24

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-0.4.0-py311-none-any.whl:

Publisher: release.yml on zrr-lab/dns-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dns_manager-0.4.0-py310-none-any.whl.

File metadata

  • Download URL: dns_manager-0.4.0-py310-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3.10
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dns_manager-0.4.0-py310-none-any.whl
Algorithm Hash digest
SHA256 9b1815e1fc9ec8383bdc5be815cec19aa080d0432557516f36a3a5aae8abc0ba
MD5 7bd435cb3ace52ea55692ee850a38436
BLAKE2b-256 548c68cfc6b7ebf61aac328baee8a65b5b4de4091e05c6537cfbf337cb9ac3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-0.4.0-py310-none-any.whl:

Publisher: release.yml on zrr-lab/dns-manager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page