Skip to content

Instantly share code, notes, and snippets.

@cwise
Created April 5, 2013 15:56
Show Gist options
  • Save cwise/5320439 to your computer and use it in GitHub Desktop.
Save cwise/5320439 to your computer and use it in GitHub Desktop.
Update DNSimple with DynamicD
#!/bin/bash
LOGIN="<your DNSimple login here>"
TOKEN="<your API token here>"
DOMAIN_ID="<your domain id here - use /domains to find it>"
RECORD_ID="<your record id here - use /domains/:domain_id/records to find it>"
IP="`curl http://icanhazip.com/`"
curl -H "Accept: application/json" \
-H "X-DNSimple-Token: $LOGIN:$TOKEN" \
-H "Content-Type: application/json" \
-X PUT \
https://DNSimple.com/domains/$DOMAIN_ID/records/$RECORD_ID.json \
-d {\"record\":{\"content\":\"$IP\"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment