ChatDNS
ChatDNS 是 ChatArch 的 DNS、DDNS 与 ACME DNS-01 证书工具。它统一 Aliyun DNS 与 Tencent Cloud / DNSPod provider,通过 ChatEnv profile 选择账号,并将证书安全写入 $CHATARCH_HOME/certs/<registered-domain>/<cert-path>/。
- 文档:https://arch.gh.wzhecnu.cn/ChatDNS/
- 快速开始:https://arch.gh.wzhecnu.cn/ChatDNS/quickstart/
- CLI 树:https://arch.gh.wzhecnu.cn/ChatDNS/cli-tree/
- 证书规则:https://arch.gh.wzhecnu.cn/ChatDNS/certificate-storage/
按场景进入
| 目标 | 入口 |
|---|---|
| 第一次安装并安全验证 profile | 快速开始 |
| 查找命令、参数和副作用 | CLI 树 |
| 理解证书目录、SAN 复用和 symlink 拒绝规则 | 证书目录与创建规则 |
| 直接查看所有公开命令 | chatdns --tree / chatdns --help |
安装
推荐使用 Python 3.12;包元数据中的 >=3.10 只表示最低兼容版本,不会把环境固定到 Python 3.10。
uv venv --python 3.12
uv pip install ChatDNS
chatdns --version
开发安装:
uv pip install -e '.[dev,docs]'
安全起步
先选择 ChatEnv profile 和 provider,再从只读命令开始:
chatdns --env work list --provider tencent
chatdns --env work records example.com --provider tencent
chatdns ip --type public
chatdns --env work cert check '*.example.com' --cert-path default
确认账号、zone 与记录无误后,再执行 set、delete、ddns 或 cert apply。
CLI 树
chatdns
├── --help # Show this message and exit.
├── --version # Show the installed ChatDNS version.
├── --tree # Print this registered command tree and exit.
├── cert # Manage Let's Encrypt certificates through DNS-01 validation.
│ ├── apply [--domain DOMAINS] [--email EMAIL] [--provider PROVIDER] [--env ENV-PROFILE] [--cert-dir CERT-DIR] [--cert-path CERT-PATH] [--staging] [--force] [--log-file LOG-FILE] [--log-level LOG-LEVEL] [--interactive] # Apply or renew certificates using ACME DNS-01 validation.
│ ├── check [DOMAINS...] [--cert-dir CERT-DIR] [--cert-path CERT-PATH] [--provider PROVIDER] # Check local certificate expiry for one or more domains.
│ ├── manifest # Show, create, or validate Infra certificate manifests.
│ │ ├── init [MANIFEST-PATH] [--cert-dir CERT-DIR] [--cert-path CERT-PATH] [--from-store] [--scripts-dir SCRIPTS-DIR] [--force] [--format OUTPUT-FORMAT] # Create an Infra manifest and scripts/README scaffold from the local store.
│ │ ├── show [MANIFEST-PATH] # Render an Infra certificate manifest as a table without modifying it.
│ │ └── validate [MANIFEST-PATH] # Validate manifest shape and referenced local certificate files.
│ └── status [DOMAINS...] [--cert-dir CERT-DIR] [--cert-path CERT-PATH] [--expiring-within EXPIRING-WITHIN] [--format OUTPUT-FORMAT] [--strict] # Scan the internal certificate store and report current leaf status.
├── ddns [FULL-DOMAIN] [--domain DOMAIN] [--rr RR] [--ttl TTL] [--interval INTERVAL] [--max-retries MAX-RETRIES] [--retry-delay RETRY-DELAY] [--monitor] [--log-file LOG-FILE] [--log-level LOG-LEVEL] [--ip-type IP-TYPE] [--local-ip-cidr LOCAL-IP-CIDR] [--provider PROVIDER] [--env ENV-PROFILE] [--interactive] # Run dynamic DNS updates once or in continuous monitoring mode.
├── delete [FULL-DOMAIN] [--domain DOMAIN] [--rr RR] [--type RECORD-TYPE] [--value VALUE] [--yes] [--provider PROVIDER] [--env ENV-PROFILE] [--interactive] # Delete DNS records by domain, host record, type, and optional value.
├── ip [--type IP-TYPE] [--local-ip-cidr LOCAL-IP-CIDR] # Show the current public or local IP without touching DNS records.
├── list [--provider PROVIDER] [--page PAGE-NUMBER] [--page-size PAGE-SIZE] [--env ENV-PROFILE] # List DNS domains in the provider account.
├── records [TARGET] [--domain DOMAIN] [--rr RR] [--type RECORD-TYPE] [--provider PROVIDER] [--env ENV-PROFILE] [--interactive] # Show DNS record details.
└── set [FULL-DOMAIN] [--domain DOMAIN] [--rr RR] [--type RECORD-TYPE] [--value VALUE] [--ttl TTL] [--provider PROVIDER] [--env ENV-PROFILE] [--interactive] # Create or update a DNS record.
完整参数、profile 位置规则、交互选项和副作用矩阵见 CLI 树。
证书状态入口是 chatdns cert status。chatdns cert manifest init 会从当前证书根创建/更新 Infra 工作区里的 manifest.json,并创建 scripts/README.md 作为模型/人工手写同步脚本的说明入口;ChatDNS 不提供 cert script 生成或执行接口。
配置解析
Provider 选择顺序:
- 命令行
--provider; - ChatDNS profile 的
CHATDNS_PROVIDER; - 默认
aliyun。
Profile 使用全局 chatdns --env PROFILE ... 选择;DNS 命令也支持命令级 --env。Aliyun 与 Tencent 凭据由同名 ChatEnv profile 读取,敏感值不写入仓库。
能力与边界
| 操作 | 副作用 |
|---|---|
list、records |
provider 只读 API |
ip |
本机接口读取或公网 IP 查询 |
cert check、cert status、cert manifest show、cert manifest validate |
本地只读 |
cert manifest init |
只写本地 Infra manifest.json 与 scripts/README.md |
set、delete、ddns |
写 DNS provider |
cert apply |
写 DNS challenge 与本地证书 |
ChatDNS 负责 DNS、证书申请/检查、证书根状态扫描和 manifest 创建/解析;SSH 分发、Nginx rewrite/reload 与服务器 rollback 属于 Infra,不在 ChatDNS 中执行,也不生成同步脚本。
Python API 与 MCP
from chatdns import create_dns_client, DynamicIPUpdater, SSLCertUpdater
MCP 暴露 DNS 查询/设置、IP 查询、DDNS 与证书申请工具;MCP 工具不属于 CLI 子命令。完整映射见 CLI 树。
验证
pytest -q
mkdocs build --strict
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatdns-0.1.9.tar.gz.
File metadata
- Download URL: chatdns-0.1.9.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a78da5d509734695c5a24867a9339e5b83300a9c8ac8c599c73f966ba937f7f
|
|
| MD5 |
725513ed7723d0c4c75876172297b4c5
|
|
| BLAKE2b-256 |
869131b7e446c7909e35bd379ff5d6d8ce85512b8970fe7c03551d690adf14da
|
Provenance
The following attestation bundles were made for chatdns-0.1.9.tar.gz:
Publisher:
publish.yml on ChatArch/ChatDNS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatdns-0.1.9.tar.gz -
Subject digest:
4a78da5d509734695c5a24867a9339e5b83300a9c8ac8c599c73f966ba937f7f - Sigstore transparency entry: 2420217352
- Sigstore integration time:
-
Permalink:
ChatArch/ChatDNS@edaf5e59b187204d45bb4abb50591916e279ca08 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@edaf5e59b187204d45bb4abb50591916e279ca08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chatdns-0.1.9-py3-none-any.whl.
File metadata
- Download URL: chatdns-0.1.9-py3-none-any.whl
- Upload date:
- Size: 49.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a67e492cd1f63f4db3799a364cca56e5716cf3a7d898ed3235747e80cd4ebf8c
|
|
| MD5 |
557701730931fed7f7c0a4b1156f84e7
|
|
| BLAKE2b-256 |
c76b742efc1a5ad30a2329d29d4b91a10ddf78d427414f6eb80d3db6bacb7a10
|
Provenance
The following attestation bundles were made for chatdns-0.1.9-py3-none-any.whl:
Publisher:
publish.yml on ChatArch/ChatDNS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatdns-0.1.9-py3-none-any.whl -
Subject digest:
a67e492cd1f63f4db3799a364cca56e5716cf3a7d898ed3235747e80cd4ebf8c - Sigstore transparency entry: 2420217431
- Sigstore integration time:
-
Permalink:
ChatArch/ChatDNS@edaf5e59b187204d45bb4abb50591916e279ca08 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@edaf5e59b187204d45bb4abb50591916e279ca08 -
Trigger Event:
push
-
Statement type: