NewFuture / DDNS

:triangular_flag_on_post: 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
https://ddns.newfuture.cc/
MIT License
4.23k stars 650 forks source link

cloudflare解析ddns后如果ip变了就会不走cdn #271

Closed lsCoding666 closed 2 years ago

lsCoding666 commented 2 years ago

如果本机ip变了,那么cloudflare的代理(cdn)会灭了,变成“仅dns”。我希望更新ip的时候不会改变云也就是cdn的状态。 image

NewFuture commented 2 years ago

115 和这个一样的问题?

xiaofami commented 2 years ago

https://github.com/cloudflare/python-cloudflare/issues/73

https://github.com/cloudflare/python-cloudflare

这个项目应该能通过python控制cloudflare状态

项目提供了示例: https://github.com/cloudflare/python-cloudflare/blob/master/examples/example_proxied.py

phlinhng commented 2 years ago

把這裡的 proxied 改成 True 就行 https://github.com/NewFuture/DDNS/blob/914f3c09c3c133b1883d5002462d68cfe59984aa/dns/cloudflare.py#L151 懶得改的話,可以另外設置一個 ddns 專用的域名,然後把要開啟 cdn 的域名 cname 到 ddns 域名上。

NewFuture commented 2 years ago

master已更新,保留之前的配置