Post

Cloudflare API update dns

Backup

Get dns list, please check zonesID at domain dashboard

1
2
3
4
curl -X GET "https://api.cloudflare.com/client/v4/zones/zonesID/dns_records" \
     -H "Content-Type:application/json" \
     -H "X-Auth-Key:API_KEY" \
     -H "X-Auth-Email:yourname@gmail.com"

Update dns record

1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
  --url https://api.cloudflare.com/client/v4/zones/zonesID/dns_records/domainID \
  --header 'Content-Type: application/json' \
   -H "X-Auth-Key:API_KEY" \
   -H "X-Auth-Email:yourname@gmail.com" \
  --data '{
  "content": "2600:fe80:0000:000",
  "name": "test.test.com",
  "proxied": false,
  "type": "AAAA",
  "ttl": 1
}'
This post is licensed under CC BY 4.0 by the author.