ID #1116

How can I update my domain name automatically if my IP address changes when I'm behind a firewall using a Raspberry Pi webserver?

Use cron to schedule this script to run once an hour to update your ip:

#!/bin/bash
the_ip=$(curl -s https://api.ipify.org)
if [ -e "ip.txt" ]
then
old_ip=$(cat ip.txt)
if [ "$the_ip" == "$old_ip" ]
then
echo "Your IP $the_ip didn't change."
else
echo "$the_ip" > ip.txt
echo "The IP Changed from $old_ip to $the_ip"
change_dot_com=$(curl -s "http://update.dnsexit.com/RemoteUpdate.sv?login=YourDnsExitUserName&password=YourDnsExitPassword&host=fancyartwork.com")
echo "$change_dot_com"
sleep 5
change_dot_com=$(curl -s "http://update.dnsexit.com/RemoteUpdate.sv?login=YourDnsExitUserName&password=YourDnsExitPassword&host=expensivecatalog.com")
echo "$change_dot_com"
fi
else
echo "$the_ip" > ip.txt
echo "Your IP is $the_ip"
fi

Tags: -

Related entries:

You can comment this FAQ