Update Dynamic DNS record hosted with DNSMadeEasy with current local IP address. This is useful for local web testing on mobile devices on the same WiFi Network
This file contains 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 | |
# Auth/DNS Record Details | |
USERNAME="USERNAME" | |
PASSWORD="PASSWORD" | |
ID="DNS-RECORD-ID" | |
# Get the IP Address | |
IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') | |
# Make the API Request | |
URL="http://www.dnsmadeeasy.com/servlet/updateip?username=${USERNAME}&password=${PASSWORD}&id=${ID}&ip=${IP}"; | |
curl -s "${URL}" > /dev/null | |
# Clear the local cache | |
dscacheutil -flushcache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment