本文档指导如何通过 DNSHE 控制台或 API 接口,对即将到期的免费域名进行手动或自动化续期。
一、 核心续期规则
-
续期窗口:域名到期前 180 天 开启。
-
网页操作:登录后台,点击域名旁出现的“免费续期”按钮,成功后会提示新的到期时间。


-
费用:完全免费
二、 API 自动化续期流程
如果您有多个域名需要维护,建议使用 API 方式。
第一步:获取 API 密钥
在 DNSHE 域名页面-[API 管理] 页面创建并保存以下两个关键信息:
-
X-API-Key -
X-API-Secret
第二步:获取域名 ID (subdomain_id)
在执行续期前,您需要先获取目标域名的内部 ID。
查询命令:
curl -X GET "https://api005.dnshe.com/index.php?m=domain_hub&endpoint=dns_records&action=list" \ -H "X-API-Key: 您的Key" \ -H "X-API-Secret: 您的Secret"
返回结果解析示例: 接口会返回一个包含所有域名的列表,请从中找到
id 字段。{
"success": true,
"subdomains": [
{
"id": 1,
"subdomain": "1.de5.net",
"status": "active"
},
...
]
}
"success": true,
"subdomains": [
{
"id": 1,
"subdomain": "1.de5.net",
"status": "active"
},
...
]
}
第三步:提交续期请求
使用获取到的 id 替换下方命令中的 subdomain_id 参数。
续期命令:curl -X GET "https://api005.dnshe.com/index.php?m=domain_hub&endpoint=dns_records&action=list&subdomain_id=1" \
-H "X-API-Key: 您的Key" \
-H "X-API-Secret: 您的Secret"
三、 续期结果确认
当您执行完续期命令后,请检查返回的 JSON 数据:
- 续期成功示例:{
"success": true,
"message": "Subdomain renewed successfully",
"subdomain_id": 1,
"previous_expires_at": "2026-01-05 00:00:00",
"new_expires_at": "2027-01-05 00:00:00",
"charged_amount": 0,
"remaining_days": 365
} - 检查点:
success为true且new_expires_at已更新为一年以后。 -
状态码参考表