mirror of
https://github.com/NewFuture/DDNS.git
synced 2026-10-19 16:15:45 +00:00
* fix: correct DNS sync results and configuration retention Keep address families independent, reject failed update responses, preserve complete IPv6 addresses, and retain Studio drafts and effective extra settings. Add offline regressions and wire Studio tests into documentation builds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test(provider): make disk cache regressions deterministic Align the cache fixture wall clock and file mtime so Windows Python 3.12 clock granularity cannot turn a freshly saved cache into a future-dated file. Keep real disk reads, all cache assertions, production expiry policy and CI matrices unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
DNS Provider 配置指南
本目录包含各个DNS服务商的详细配置指南。DDNS支持多个主流DNS服务商,每个服务商都有其特定的配置要求和API特性。
🚀 快速导航
添加新的Provider, 创建Issue,并按照模板填好链接
支持自动创建记录
大部分provider支持自动创建不存在的DNS记录,但有例外:
- ⚠️ he: 不支持自动创建记录,需要手动在控制面板中预先创建
- ⚠️ noip: 不支持自动创建记录,需要手动在控制面板中预先创建
📝 配置示例
命令行配置
cli 提供了命令行配置方式,以下是一些常用的命令行示例:
# DNSPod中国版
ddns --dns dnspod --id 12345 --token your_token --ipv4 ddns.newfuture.cc
# 阿里云DNS
ddns --dns alidns --id your_access_key --token your_secret --ipv4 ddns.newfuture.cc
# Cloudflare (使用邮箱)
ddns --dns cloudflare --id user@example.com --token your_api_key --ipv4 ddns.newfuture.cc
# Cloudflare (使用Token)
ddns --dns cloudflare --token your_api_token --ipv4 ddns.newfuture.cc
# 腾讯云EdgeOne
ddns --dns edgeone --id your_secret_id --token your_secret_key --ipv4 ddns.newfuture.cc
# No-IP
ddns --dns noip --id your_username --token your_password --ipv4 ddns.newfuture.cc
JSON配置文件
JSON配置文件提供了更灵活的配置方式,以下是一些常用的JSON配置示例:
单Provider格式
{
"$schema": "https://ddns.newfuture.cc/schema/v4.1.json",
"dns": "dnspod",
"id": "12345",
"token": "your_token_here",
"ipv4": ["ddns.newfuture.cc", "*.newfuture.cc"],
"index4": ["default"],
"ttl": 600
}
多Provider格式
{
"$schema": "https://ddns.newfuture.cc/schema/v4.1.json",
"ssl": "auto",
"cache": true,
"log": {"level": "INFO"},
"providers": [
{
"provider": "cloudflare",
"id": "user@example.com",
"token": "cloudflare-token",
"ipv4": ["cf.example.com"],
"ttl": 300
},
{
"provider": "dnspod",
"id": "12345",
"token": "dnspod-token",
"ipv4": ["dnspod.example.com"],
"ttl": 600
}
]
}
多配置文件方式
命令行指定多个配置文件
# 使用多个独立的配置文件
ddns -c cloudflare.json -c dnspod.json -c alidns.json
# 使用环境变量指定多个配置文件
export DDNS_CONFIG="cloudflare.json,dnspod.json,alidns.json"
ddns
多配置文件示例
cloudflare.json:
{
"dns": "cloudflare",
"id": "user@example.com",
"token": "your-cloudflare-token",
"ipv4": ["cf.example.com"]
}
dnspod.json:
{
"dns": "dnspod",
"id": "12345",
"token": "your-dnspod-token",
"ipv4": ["dnspod.example.com"]
}
环境变量配置
环境变量配置提供了另一种配置方式,以下是一些常用的环境变量示例:
export DDNS_DNS=dnspod
export DDNS_ID=12345
export DDNS_TOKEN=your_token_here
export DDNS_IPV4=ddns.newfuture.cc
export DDNS_INDEX4=default
ddns --debug
📚 相关文档
- 命令行配置 - 命令行参数详细说明
- JSON配置 - JSON配置文件格式说明
- 环境变量配置 - 环境变量配置方式
- Provider开发指南 - 如何开发新的provider
- JSON Schema - 配置文件验证架构
如有疑问或需要帮助,请查看FAQ 或在 GitHub Issues 中提问。