Q: How to assign Hostname to local machine with dynamic IP using free DynDNS service?
- Read General Notes
- Read How to add extra repositories?
e.g. Assumed that internet connections have been configured properly
Register free Dynamic DNS at https://www.dyndns.org
Automatically refresh IP in DynDNS Database/DNS every hour
* * * * * means minute hour date month year
sudo apt-get install ipcheck
sudo gedit /root/dyndns_update.sh
- Insert the following lines into the new file
USERNAME=myusername
PASSWORD=mypassword
HOSTNAME=myhostname.dyndns.org
cd /root/
if [ -f /root/ipcheck.dat ]; then
ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
else
ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
fi
- Save the edited file (sample)
sudo chmod 700 /root/dyndns_update.sh
sudo sh /root/dyndns_update.sh
export EDITOR=gedit && sudo crontab -e
- Append the following line at the end of file
00 * * * * sudo sh /root/dyndns_update.sh
- Save the edited file