Need help with dynamic dns api call

What is the name of the domain?

example.com

What is the issue you’re encountering

Not sure where to put proxied:true in API string

What steps have you taken to resolve the issue?

I am using this API call to dynamically update my DNS (Relvant data dummied out):
#!/bin/sh
curl -s -X PUT “https://api.cloudflare.com/client/v4/zones/12345/dns_records/abcdefg12345” -H “X-Auth-Email:[email protected]” -H “X-Auth-Key:67890” -H “Content-Type: application/json” --data “{"id":"12345","type":"A","name":"subdomain.example.com","content":"curl https://ifconfig.co"}”

Now this script works on it’s own, but the DNS record won’t be proxied.

I found in the API docs that say I can add: -F proxied:true
But it isn’t working. Maybe I’m putting it in the wrong spot, but I’m just not sure. Any help would be appreciated.

What feature, service or problem is this related to?

DNS records

I made some headway, I added this to the end: …https://ifconfig.co`","proxied":"true"}"

But I get this error: {“result”:null,“success”:false,“errors”:[{“code”:9208,“message”:“Failed to parse. proxied must be a bool.”}],“messages”:}

No quotes for true, otherwise it’s a string, and not boolean.

https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/update/

Forgot to do this so it removed backslashes:

#!/bin/sh
curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/########/dns_records/########" -H "X-Auth-Email:#######" -H "X-Auth-Key:##############" -H "Content-Type: application/json" --data "{\"id\":\"##########\",\"type\":\"A\",\"name\":\"############\",\"content\":\"`curl https://ifconfig.co`\",\"proxied\":\"true\"}"

How would I make the above last part a string so it works?

I’m basically trying to follow this guide:

The only issue I need is for it to make the DNS record proxied.

Figured it out, I didn’t even think of this:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.