Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Created February 21, 2020 19:29
Show Gist options
  • Save cwjohnston/d09935f4b22d0976887c03057ed98254 to your computer and use it in GitHub Desktop.
Save cwjohnston/d09935f4b22d0976887c03057ed98254 to your computer and use it in GitHub Desktop.
#!/bin/bash
TOKEN="YOUR_TOKEN_HERE" # The API v2 OAuth token
ACCOUNT_ID="YOUR_ACCOUNT_ID_HERE" # Replace with your account ID
ZONE_ID="example.com" # The zone ID is the name of the zone (or domain)
RECORD_ID="42424242" # Replace with the Record ID
IP=`curl -s -4 v4.ifconfig.co` # or provide your own value
curl -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X "PATCH" \
-i "https://api.dnsimple.com/v2/$ACCOUNT_ID/zones/$ZONE_ID/records/$RECORD_ID" \
-d "{\"content\":\"$IP\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment