Skip to content

Instantly share code, notes, and snippets.

Last active July 15, 2018 17:37
Show Gist options
  • Save digitaljhelms/a1f1d9e2d8aaa3838571 to your computer and use it in GitHub Desktop.
Save digitaljhelms/a1f1d9e2d8aaa3838571 to your computer and use it in GitHub Desktop.
DNSimple DNS Updater for OS X Yosemite
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
AUTH_EMAIL='your@email' # dnsimple account email address
AUTH_TOKEN='your-api-token' # dnsimple api token
DOMAIN_ID='' # domain name or id
RECORD_ID='12345' # record id to update
curl -H "X-DNSimple-Token: $AUTH_EMAIL:$AUTH_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-X PUT \
-d "{\"record\":{\"content\":\"$IP\"}}" \$DOMAIN_ID/records/$RECORD_ID
Copy link

digitaljhelms commented May 27, 2015


  1. Fork this gist
  2. Edit variables in the DNSimpleUpdater file
  3. Clone fork into ~/.DNSimpleUpdater
  4. cd ~/.DNSimpleUpdater
  5. Edit DNSimpleUpdater config
  6. ln -s DNSimpleUpdater /usr/local/bin
  7. ln -s com.dnsimple.dynamicdns.plist ~/Library/LaunchAgents
  8. launchctl load ~/Library/LaunchAgents/com.dnsimple.dynamicdns.plist
  9. Verify results on DNSimple website

Upon all future startups, the DNSimpleUpdater will run automatically and update the DNS entry with your current IP address each time.

Copy link

Note: Ensure the record you're updating is an A record type. While it's not mentioned in the DNSimple API documentation, if the DNS record being updated [with an IP address] is a CNAME record type (and likely other types as well) the API call will fail with the following response: {"message":"Validation failed","errors":{"content":["must be a domain name"]}} Strangely, however, an IP address can be assigned as the value of a CNAME record type when using the website.

Copy link

aeden commented May 28, 2015

At this point it should not be possible to use an IP address in a CNAME from the site either. I recently added a validation that will prohibit that, which is probably what caused the problem to appear for you recently.

Copy link

Couple of things changed since then... API is now v2, which is a bit different. The service you need to specify -4 to return ipv4 ip otherwise you just get an error from dnsimple saying it's not valid.

IP=$(curl -4

curl -H 'Authorization: Bearer <token>' \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -X PATCH \
     -d "{\"content\":\"$IP\"}" \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment