树莓派搭建私人服务器 (2)

路由器端口映射,配置完成记得点击保存并且生效

image

最后一步把动态解析脚本配置到crontab中定时执行

/1 * /usr/bin/python /home/bill/basic/BasicTask.py

附:

accessKey、accessKeySecret如何获取
登录阿里云控制台()

域名解析RecoreId如何获取

# dns_domain 域名 如uthinks.com def check_records(dnsDomain): clt = client.AcsClient(accessKeyId, accessKeySecret, \'cn-hangzhou\') request = DescribeDomainRecordsRequest.DescribeDomainRecordsRequest() request.set_DomainName(dnsDomain) request.set_accept_format(\'json\') result = clt.do_action(request) print result return result 返回值: { "PageNumber": 1, "TotalCount": 2, "PageSize": 20, "RequestId": "***", "DomainRecords": { "Record": [ { "RR": "*", "Status": "ENABLE", "Value": "****", "RecordId": "****", "Type": "A", "DomainName": "uthinks.com", "Locked": false, "Line": "default", "TTL": "600" }, ] } }

如果我的文章对你有帮助,或者有什么疑问。欢迎在下方留言,一起交流讨论

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzszjz.html