Showing posts with label dyndns. Show all posts
Showing posts with label dyndns. Show all posts

Friday, May 04, 2007

Dynamic DNS Setup In Ubuntu Using DynDNS

I use Dyndns.org for dynamic domain services. There is easy setup and you can update your IP via a web browser, or schedule an application to run on a regular basis. Updating your IP address is important because you will lose your domain if you don’t update your record every 30-35 days. Here is a basic guide.

In Debian/Ubuntu you can install the updater via apt:


sudo apt-get install ipcheck

Create bin directory, dyndns directory and updater script:



mkdir ~/bin
mkdir ~/.dyndns
touch ~/bin/dyndns-update.sh
chmod 700 ~/bin/dyndns-update.sh
vi ~/bin/dyndns-update.sh

#!/bin/sh

USERNAME=yourusername
PASSWORD=yourpassword
HOSTNAME=your.domain.name

cd ~/.dyndns
if [ -f ~/.dyndns/ipcheck.dat ]; then
/usr/sbin/ipcheck -r checkip.dyndns.org:8245 \
$USERNAME $PASSWORD $HOSTNAME
else
/usr/sbin/ipcheck --makedat -r checkip.dyndns.org:8245 \
$USERNAME $PASSWORD $HOSTNAME
fi

Edit your crontab:


crontab -e

Add the following line to your crontab to run the script daily.


* 6 * * * /home/username/bin/dyndns-update.sh