Skip to content

Instantly share code, notes, and snippets.

@yourbuddyconner
Last active April 10, 2017 15:11
Show Gist options
  • Save yourbuddyconner/96e68e87a08b02efa4d2 to your computer and use it in GitHub Desktop.
Save yourbuddyconner/96e68e87a08b02efa4d2 to your computer and use it in GitHub Desktop.
NameCheap Dynamic DNS Updater Script
  1. Enable Dynamic DNS for your domain. You'll get a "password" that you can use for their API Endpoint.
  2. Replace variable values with your own.
  3. Put the script in a safe place (I just used my home folder)
  4. Set a cron job (or other recurring service) to run your script.
  5. ???
  6. Profit
#/bin/bash
Host_Name=host
Domain=example.com
Password="PASS_HASH_FROM_NAMECHEAP"
IP_Address=$(curl -s icanhazip.com)
url="https://dynamicdns.park-your-domain.com/update?host=$Host_Name&domain=$Domain&password=$Password"
result=$(curl -s --globoff $url)
echo $url
echo ""
echo "$result"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment