Last active
December 27, 2015 23:09
-
-
Save whalesalad/7404432 to your computer and use it in GitHub Desktop.
DIY Dynamic DNS for DNSimple (running on my pfSense firewall) You need to acquire a domain API token from DNSimple.com, and you'll also need the record id # of the specific record that you want to update. This will figure out your IP with the command on line #7, then fire off an API call to DNSimple to update your record. I have this running on …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DOMAIN_TOKEN="XXXXXXXXXXXXXXXXXXXXX" | |
| DOMAIN_ID="example.com" | |
| RECORD_ID="12345678" | |
| IP="`curl -s -f http://icanhazip.com/`" | |
| curl -s -S \ | |
| -H "X-DNSimple-Domain-Token: $DOMAIN_TOKEN" \ | |
| -H "Accept: application/json" \ | |
| -H "Content-Type: application/json" \ | |
| -X PUT \ | |
| -d "{\"record\":{\"content\":\"$IP\"}}" \ | |
| -o /dev/null \ | |
| https://dnsimple.com/domains/$DOMAIN_ID/records/$RECORD_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment