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?
#!/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:
- How is DNSExit.com different from other registration services?
- What services does DNSExit.com provide
- What is DNS?
- What is dynamic DNS and how to setup it up?
- How can I know the IP address of my PC?
You can comment this FAQ