前一篇介绍域名已经手动映射到公网IP,运营商提供的公网IP应该都是动态IP,重启拨号或者定时更换公网IP。
这就要用到DDNS,Dynamic Domain Name Server,将动态IP映射到固定的域名解析服务器上。
登录阿里云,选择AccessKey管理,创建AccessKey。
![阿里云DDNS动态域名解析](http://p1.pstatp.com/large/pgc-image/3261e17fb4cd424bbe92327f24642169)
以上是创建root权限的AccessKey,最安全的办法是创建只有域名解析功能AccessKey。
登录阿里云用户权限控制台
https://ram.console.aliyun.com/overview
点击蓝色新建用户按钮
![阿里云DDNS动态域名解析](http://p3.pstatp.com/large/pgc-image/12a53eb62857451a9af760c4c01788e4)
访问方式选择变成访问,因为我们要通过调用阿里云服务API的方式去修改DNS要解析的IP地址。
![阿里云DDNS动态域名解析](http://p1.pstatp.com/large/pgc-image/b72a7fc311054a2f890a794d10938fdc)
输入绑定手机验证码后,得到AccessKey ID和AccessKeySecret,请保管好AccessKey信息,非常重要!
![阿里云DDNS动态域名解析](http://p1.pstatp.com/large/pgc-image/6f0142c956a241c7a9794aec354140c4)
然后在用户管理界面为新建用户添加修改解析IP权限,
AliyunDNSFullAccess
管理云解析(DNS)的权限
![阿里云DDNS动态域名解析](http://p3.pstatp.com/large/pgc-image/e9225666b96d4d1d90b1b927093059d4)
![阿里云DDNS动态域名解析](http://p9.pstatp.com/large/pgc-image/4da9533cf0624ed0aac549a4a21373a9)
Padavan老毛系统已经内置了阿里DDNS,进入界面直接配置。
![阿里云DDNS动态域名解析](http://p1.pstatp.com/large/pgc-image/32a247067ddf46a0865259a535404c41)
也可以将解析脚本部署在服务器上,加入系统服务或者crontab,请参考。
下方扩展链接
系统日志中可以看到,DDNS解析成功的记录。
![阿里云DDNS动态域名解析](http://p3.pstatp.com/large/pgc-image/9bc6fddc8f6b40109c84512564590b50)
登录阿里云控制台查看
![阿里云DDNS动态域名解析](http://p1.pstatp.com/large/pgc-image/0c394cf3235f49d28c7c656ee942c8ef)