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-1.0.0-py312-none-any.whl (37.5 kB view details)

Uploaded Python 3.12

dns_manager-1.0.0-py311-none-any.whl (37.6 kB view details)

Uploaded Python 3.11

dns_manager-1.0.0-py310-none-any.whl (37.6 kB view details)

Uploaded Python 3.10

File details

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

File metadata

  • Download URL: dns_manager-1.0.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-1.0.0-py312-none-any.whl
Algorithm Hash digest
SHA256 3c47a200f7eeb3bc449705ae4220d1b9d8c935508ffad5f61707e51ed171eefc
MD5 308e1af5bf2d32a07c193f24b4b1c09d
BLAKE2b-256 35da784c234db91071a1760dbfe7352346f27d44859b48549884e0c94b2a449a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-1.0.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-1.0.0-py311-none-any.whl.

File metadata

  • Download URL: dns_manager-1.0.0-py311-none-any.whl
  • Upload date:
  • Size: 37.6 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-1.0.0-py311-none-any.whl
Algorithm Hash digest
SHA256 0ef036ae470a21577bd5051736ec51ff6a60e7efed828974cff864405c6f81d2
MD5 c90d927687e4435ef59a25cd24cc42c4
BLAKE2b-256 e12fe7e8394f2d10181a2c734340a2db6f41ceaee55ad925b44290bd711d3dbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-1.0.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-1.0.0-py310-none-any.whl.

File metadata

  • Download URL: dns_manager-1.0.0-py310-none-any.whl
  • Upload date:
  • Size: 37.6 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-1.0.0-py310-none-any.whl
Algorithm Hash digest
SHA256 cb5b664ea4ce861b92a8108b95fa31871d8e11e82baa9e432ed14ab751c4dfdc
MD5 c98e8edcdbd94f4354432351fde1bed8
BLAKE2b-256 46939f1ae229837f78bcabb8608afee23f45586fe31102522c305ff6f5da1c79

See more details on using hashes here.

Provenance

The following attestation bundles were made for dns_manager-1.0.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