Update IP addresses at dynamic DNS services Using ddclient
Sponsored Link
Update IP addresses at dynamic DNS services.A perl based client to update your dynamic IP address at DynDNS.com (or other dynamic DNS services such as Hammernode, Zoneedit or EasyDNS), thus allowing you and others to use a fixed hostname (myhost.dyndns.org) to access your machine. This client supports both the dynamic and (near) static services, MX setting, and alternative host. It caches the address, and only attempts the update if the address actually changes.
Install ddclient in ubuntu
sudo aptitude install ddclient
This will complete the installation
Configuring ddclient
If you want to reconfigure you seetings use the following command
dpkg-reconfigure ddclient
You want to make sure it runs as a service and monitors changes in ppp–something that the install wizard doesn’t cover.
Edit the configuration file /etc/ddclient.conf
sudo gedit /etc/ddclient.conf
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=easydns
use=web
server=members.easydns.com
login=yournamehere
password=’password’
*.your.domain
If you can’t find the public IP address, then you can have ddclient check your public IP address from the web by editing /etc/ddclient.conf and making it use the web by saying
use=web
or
use=web, web=checkip.dyndns.org/, web-skip=’IP Address’
Save and exit the file
Restart ddclient service using the following command
sudo /etc/init.d/ddclient restart
to Restart ddclient service, it should be the following command
sudo /etc/init.d/ddclient force-reload
or
sudo /etc/init.d/ddclient restart
@moustapha
thanks for your comment i have updated the article
Isn’t this just what people have been doing? Here is the short Perl I wrote to update my ZoneEdit.
#!/usr/bin/perl
($user,$pass,$host,$homedir)=("YOURNAME","YOURPASS","YOURHOST.COM","YOURHOMEDIR");
$ipthere = `cat $homedir/.ip`;
chomp $ipthere;
$ipnow="";
while ($ipnow eq "") {
$ipnow=`wget -q -O - www.whatismyip.com/automation/n09230945.asp`;
sleep(3) if $ipnow eq ""; }
if (!($ipthere eq $ipnow )) {
print "changing $ipthere to $ipnow\n";
print `curl -s --basic --user "$user:$pass" --data-ascii "host=$host" "http://dynamic.zoneedit.com/auth/dynamic.html"`;
system("echo $ipnow > $homedir/.ip"); }
Also, because I have this as a cron job, I receive an email of the output when it updates the IP.
Can this be used with noip.com?
DynDNS requires that the IP needs to be updated at least once a month but that it shouldn’t be done too often. Where in the ddclient.conf is a time period located ?
@robbo
use the following option
daemon=300
The above line tells ddclient to update your public IP address every 5 minutes (specified in secconds).
@admin,
thanks, I was just concerned though since DynDNS said it would drop the account if it was done too often.
my routers got a ddns client on it most do.
how would you use this behind a nat address pool ?
sudo aptitude install ddclient
Couldn’t find any package whose name or description matched “ddclient”
@zainuddin
make sure you have enabled universe and multiverse repositories
hiiiiii all
plsssssssss can u help me.. let me know this script how to configure in with zoneedit plsssss post or mail me.. i m not familyer with script so plssss help me step by step or pls tell website..
thanks
@robbo
@admin
the daemon=300 only tells ddclient daemon to check once every 5 minutes, if the ip address has been updated, and if so, it sends an update the the ddns server
if no ip address changes have occured, it does NOT send an update to the ddns server
however, the ddclient running in daemon mode should automatically send an update every month, (i think every 25 days or something like that), even if no changes have been made in the ip address, in order to keep the account active
if you run the ddclient from a cron job, you can simply make another cron job with a FORCED update once every 30 days or so, see the manual for info about how to make a forced update
if your ip address changes more often than once a month, there is no problem, since it will be updated no longer than 5 minutes after the ip address changes
but if your ip address is in constant use for months, u will have to make the separate cron job, or preferably, run ddclient in daemon mode
in the end it all depends on which ip renewal rules your internet provider has set up for their DHCP server
This is my /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=dyndns2
## use=if, if=eth0
use=web, web=checkip.dyndns.org/
server=members.dyndns.org
login=someuser
password=’somepass’
my.site.com
It is a little bit different from the setting here, can anyone see a problem in my settings?
Also, what is web-skip=’IP Address’
Thanks
I set everything up correctly and the status is running. But it show this error when restart:
* Restarting Dynamic DNS service update utility ddclient WARNING: skipping host: Address´: ‘login=’ is an invalid login.
Can anyone help me out. I have a account with DYNDNS.com. The username I used is correct but error says its invalid. Password is also correct.
mrmikey, do you have quotes around your username and password? I believe you need them around your host name as well… Ex:
login=’yourlogin’
password=’yourpassword’
I’ll probably have it figured out by the time anybody answers this, but what is
web-skip=’IP Address’
?
@ invalid login error:
If you cut and paste this line from above:
use=web, web=checkip.dyndns.org/, web-skip=’IP Address’
you will end up with ’ characters, not ‘ characters, which causes this error.