通过公共解析服务实现动态IP的域名解析
- DNSPod
- 进入DNSPod域名解析控制台,选择域名进入解析记录管理页面,按照自己的需求添加一条A记录。记录值可以随便填一个IP值。
- 获取DNSPod的Token和ID,用于调用API接口。
- 配置项目中的Config.json文件。
{
"Corn": "* */15 * * * ?", // 每15分钟检查一次
"Domain": "", // 域名
"SubDomain": "", // 主机记录值,如”www“
"Id": "", // 从API密钥管理获取的ID
"Token": "" // 从API密钥管理获取的Token
}
- 使用docker部署应用
docker run -it \
--name ddns \
-v /home/dwgoing/.kubernetes/build_dir/Config.json:/.ddns/Config.json \
-e RESOLVER_TYPE=DNSPod \
dwgoing/ddns:v1.0.0