腾讯云 DNS(TencentCloud DNSPod)是腾讯云提供的专业 DNS 解析服务,具有高可用性和高性能,支持动态 DNS 记录的创建与更新。本 DDNS 项目通过 SecretId 和 SecretKey 进行 API 认证。
官网链接:
腾讯云DNS使用SecretId
和SecretKey
进行API认证,这是最安全和推荐的认证方式。
{
"dns": "tencentcloud",
"id": "Your_Secret_Id", // 腾讯云 SecretId
"token": "Your_Secret_Key" // 腾讯云 SecretKey
}
有以下两种方式获取 API 密钥:
最为简单快捷地获取
确保使用的腾讯云账号具有以下权限:
可以在 访问管理控制台 中查看和配置权限。
{
"$schema": "https://ddns.newfuture.cc/schema/v4.0.json", // 格式验证
"dns": "tencentcloud", // 当前服务商
"id": "Your_Secret_Id", // 腾讯云 SecretId
"token": "Your_Secret_Key", // 腾讯云 SecretKey
"index4": ["url:http://api.ipify.cn", "public"], // IPv4地址来源
"index6": "public", // IPv6地址来源
"ipv4": ["ddns.newfuture.cc"], // IPv4 域名
"ipv6": ["ddns.newfuture.cc", "ipv6.ddns.newfuture.cc"], // IPv6 域名
"endpoint": "https://dnspod.tencentcloudapi.com", // API端点
"line": "默认", // 解析线路
"ttl": 600 // DNS记录TTL(秒)
}
参数 | 说明 | 类型 | 取值范围/选项 | 默认值 | 参数类型 |
---|---|---|---|---|---|
dns | 服务商标识 | 字符串 | tencentcloud |
无 | 服务商参数 |
id | 认证 ID | 字符串 | 腾讯云 SecretId | 无 | 服务商参数 |
token | 认证密钥 | 字符串 | 腾讯云 SecretKey | 无 | 服务商参数 |
index4 | IPv4 来源 | 数组 | 参考配置 | default |
公用配置 |
index6 | IPv6 来源 | 数组 | 参考配置 | default |
公用配置 |
ipv4 | IPv4 域名 | 数组 | 域名列表 | 无 | 公用配置 |
ipv6 | IPv6 域名 | 数组 | 域名列表 | 无 | 公用配置 |
endpoint | API 端点 | URL | 参考下方 | https://dnspod.tencentcloudapi.com |
服务商参数 |
line | 解析线路 | 字符串 | 参考下方 | 默认 |
服务商参数 |
ttl | TTL 时间 | 整数(秒) | 参考下方 | 600 |
服务商参数 |
proxy | 代理设置 | 数组 | 参考配置 | 无 | 公用网络 |
ssl | SSL 验证方式 | 布尔/字符串 | "auto" 、true 、false |
auto |
公用网络 |
cache | 缓存设置 | 布尔/字符串 | true 、false 、filepath |
true |
公用配置 |
log | 日志配置 | 对象 | 参考配置 | 无 | 公用配置 |
参数类型说明:
- 公用配置:所有支持的DNS服务商均适用的标准DNS配置参数
- 公用网络:所有支持的DNS服务商均适用的网络设置参数
- 服务商参数:当前服务商支持,值与当前服务商相关 注意:
ttl
和line
不同套餐支持的值可能不同。
腾讯云 DNSPod API 支持多个区域端点,可根据网络环境选择最优节点:
https://dnspod.tencentcloudapi.com
https://dnspod.ap-guangzhou.tencentcloudapi.com
https://dnspod.ap-shanghai.tencentcloudapi.com
https://dnspod.ap-beijing.tencentcloudapi.com
https://dnspod.ap-chengdu.tencentcloudapi.com
https://dnspod.ap-hongkong.tencentcloudapi.com
https://dnspod.ap-singapore.tencentcloudapi.com
https://dnspod.ap-bangkok.tencentcloudapi.com
https://dnspod.ap-mumbai.tencentcloudapi.com
https://dnspod.ap-seoul.tencentcloudapi.com
https://dnspod.ap-tokyo.tencentcloudapi.com
https://dnspod.na-ashburn.tencentcloudapi.com
https://dnspod.na-siliconvalley.tencentcloudapi.com
https://dnspod.eu-frankfurt.tencentcloudapi.com
注意:建议使用默认端点
https://dnspod.tencentcloudapi.com
,腾讯云会自动路由到最优节点。只有在特殊网络环境下才需要指定特定区域端点。
ttl
参数指定 DNS 记录的生存时间(TTL),单位为秒。腾讯云 DNSPod 支持的 TTL 范围为 1 到 604800 秒(即 7 天)。如果不设置,则使用默认值。
套餐类型 | 支持的 TTL 范围(秒) |
---|---|
免费版 | 600 ~ 604800 |
专业版 | 60 ~ 604800 |
企业版 | 1 ~ 604800 |
尊享版 | 1 ~ 604800 |
参考:腾讯云 云解析 TTL 说明
line
参数指定 DNS 解析线路,腾讯云 DNSPod 支持的线路:
线路标识 | 说明 |
---|---|
默认 | 默认 |
电信 | 中国电信 |
联通 | 中国联通 |
移动 | 中国移动 |
教育网 | 中国教育网 |
境外 | 境外 |
更多线路参考:腾讯云 云解析 DNS 解析线路说明
故障排除
启用调试日志查看详细信息:
ddns -c config.json --debug
错误代码 | 说明 | 解决方案 |
---|---|---|
AuthFailure.SignatureExpire | 签名过期 | 检查系统时间 |
AuthFailure.SecretIdNotFound | SecretId不存在 | 检查密钥配置 |
ResourceNotFound.NoDataOfRecord | 记录不存在 | 检查记录设置 |
LimitExceeded.RequestLimitExceeded | 请求频率超限 | 降低请求频率 |
建议:推荐使用子账号 API 密钥并仅授予必要的 DNSPod 权限,以提高安全性。定期轮换 API 密钥确保账号安全。