Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Feisty,Gutsy,Hardy,Intrepid

  • RSS Feed

    subscribe to the ubuntu Geek RSS feed


  • Sponsor

  • Categories

  • Meta

  • Sponsor

  • Archives

  • Support Ubuntugeek

    Amount $:
    Website(Optional):


  • Favourite Sites

Update IP addresses at dynamic DNS services Using ddclient

Posted by admin on May 28th, 2008 Email This Post Email This Post

If you are using zoneedit.com or dyndns.org for your DNS service so that you can access your server using a URL, then you might have to update your DNS record at the service periodically whenever the IP address of your computer changes.Now here is simple solution for this ddclient.

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

Share/Save/Bookmark

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

13 Responses to “Update IP addresses at dynamic DNS services Using ddclient”

  1. Salimane MOUSTAPHA Says:

    to Restart ddclient service, it should be the following command

    sudo /etc/init.d/ddclient force-reload
    or
    sudo /etc/init.d/ddclient restart

  2. admin Says:

    @moustapha

    thanks for your comment i have updated the article

  3. Robert Levy Says:

    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 - http://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”); }

  4. Robert Levy Says:

    Also, because I have this as a cron job, I receive an email of the output when it updates the IP.

  5. KevDog Says:

    Can this be used with noip.com?

  6. robbo Says:

    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 ?

  7. admin Says:

    @robbo
    use the following option

    daemon=300

    The above line tells ddclient to update your public IP address every 5 minutes (specified in secconds).

  8. robbo Says:

    @admin,
    thanks, I was just concerned though since DynDNS said it would drop the account if it was done too often.

  9. chris Says:

    my routers got a ddns client on it most do.

    how would you use this behind a nat address pool ?

  10. zainuddin Says:

    sudo aptitude install ddclient

    Couldn’t find any package whose name or description matched “ddclient”

  11. admin Says:

    @zainuddin

    make sure you have enabled universe and multiverse repositories

  12. gayan Says:

    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

  13. Per Says:

    @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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>