Updating Namecheap DDNS using BASH, CURL, and good 'ol know how.

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.

I have a server at home that I use to do snapshot style backups using rsync. As such, I’d like to be able to connect to it from time to time when not at home. This is a simple way to update your Dynamic DNS with NameCheap.

Create a file called ddns and place it in /etc/cron.daily and set the permissions to 700

# Update NameCheap DDNS 

# Disclaimer: I have no affiliation with jackson.io, it may not work when you read this.  
# It's just fetching your URL as plain text.  If you had a webserver it would be simple
# to write your own whatismyip service.
IP=$(exec wget -q -O - http://jackson.io/ip/)

curl -s -o temp.html "http://dynamicdns.park-your-domain.com/update?domain=YOURDOMAINNAME&password=YOURVERYLONGPASSWORDFROMNAMECHEAP&host=YOURHOSTNAME&ip=${IP}"

You’ll want to change some of the variables in the long URL. After that, it will update NameCheap DDNS on a nightly basis. No more need for a static IP.

Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. shanestillwell@gmail.com