看下
https://hex.moe/p/aaafb04f/ 获取域名的相关信息
创建脚本 zone_id,sub_domain_id,sub_domain,email,global_api_key 填写对应信息
```
#!/bin/sh
zone_id=''
sub_domain_id=''
sub_domain=''
email=""
global_api_key=""
CURRENT_IP=$(curl
ip.cip.cc)
curl -X PUT "
https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records/${sub_domain_id}" \
-H "Content-Type:application/json" \
-H "X-Auth-Key:${global_api_key}" \
-H "X-Auth-Email:${email}" --data '{"type":"A","name":"'${sub_domain}'","content":"'${CURRENT_IP}'","ttl":120,"proxied":false}'
exit
```
加入任务
crontab -e
```
*/10 * * * * /bin/sh ~/
cf-ddns.sh```