Skip to content

Instantly share code, notes, and snippets.

@marcransome
Last active January 2, 2016 16:49
Show Gist options
  • Save marcransome/8332898 to your computer and use it in GitHub Desktop.
Save marcransome/8332898 to your computer and use it in GitHub Desktop.
DNSimple.com domain ALIAS update script
#!/usr/bin/env bash
EMAIL=""
API_TOKEN=""
DOMAIN_ID=""
RECORD_ID=""
EXTERNAL_IP="`curl http://rqst.io/ip | jgrep -s "ip"`"
curl -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-DNSimple-Token: $EMAIL:$API_TOKEN" \
-X "PUT" \
-d "{\"record\":{\"content\":\"$EXTERNAL_IP\"}}" \
"https://api.dnsimple.com/v1/domains/$DOMAIN_ID/records/$RECORD_ID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment