Skip to content

Instantly share code, notes, and snippets.

@ignaciolg
Last active March 11, 2019 00:12
Show Gist options
  • Save ignaciolg/cc580934e29294eaeeeaa1c7b11ac24f to your computer and use it in GitHub Desktop.
Save ignaciolg/cc580934e29294eaeeeaa1c7b11ac24f to your computer and use it in GitHub Desktop.
Update a namecheap DNS registry from shell
# Using httpbin.org, and the next links
# https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-do-i-use-a-browser-to-dynamically-update-the-hosts-ip
# https://www.namecheap.com/support/knowledgebase/article.aspx/595/11/how-to-enable-dynamic-dns-option-for-a-domain
# setup a cron job and that's all
# works on sysnology scheduled task ;D
HOST="REPLACE BY YOUR HOST, LIKE @ OR ANY SUBDOMAIN";
DOMAIN="REPLACE BY YOUR DOMAIN";
PASSWORD="REPLACE BY YOUR PASSWORD";
IP=$(curl -s https://httpbin.org/ip | python -c "import sys, json; print json.load(sys.stdin)['origin'].split(\",\")[0]");
curl "https://dynamicdns.park-your-domain.com/update?host=$HOST&domain=$DOMAIN&password=$PASSWORD&ip=$IP"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment