赞
踩
X-Auth-Key
登录cloudflare后,右上角->头像->我的个人资料->API令牌->Global API Key->查看
curl -X GET "https://api.cloudflare.com/client/v4/zones" \
-H "X-Auth-Email: 账号邮箱" \
-H "X-Auth-Key: " 准备中获取的令牌\
-H "Content-Type: application/json"
在响应中找到域名的ID,备用
curl -X GET "https://api.cloudflare.com/client/v4/zones/域名ID/dns_records?page=1&per_page=20&order=type&direction=asc" \
-H "Content-Type:application/json" \
-H "X-Auth-Key: 准备中获取的令牌" \
-H "X-Auth-Email: 账号邮箱"
找到你要解析的二级域名记录ID,备用
curl -X PUT "https://api.cloudflare.com/client/v4/zones/域名ID/dns_records/域名记录ID" \
-H "X-Auth-Email: 账号邮箱" \
-H "X-Auth-Key: 准备中获取的令牌" \
-H "Content-Type: application/json" \
--data '{"type":"A","name":"记录值(www.abc.com)","content":"127.0.0.1","ttl":120,"proxied":false}'
自此完成,总的来讲,不复杂,主要是心急实现又吃了英语不好的亏,上来就想更新解析,却又不知道在哪里获取相关的参数。
参考:https://api.cloudflare.com/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。