Friday, November 5, 2010

Update No-IP.com and DynDNS.com Dynamic DNS with ddclient

I have registered several host names with two dynamic DNS service providers: DynDNS.com and No-IP.com, and I've been using ddclient and noip2 to update my dynamic IP address with these services, respectively.

I've recently installed a wireless router, so I poked at ddclient trying to figure out how to use it when the computer running it is behind a router, such that its IP address is an internal address (10.x.x.x) and not the external IP address that needs to be sent over to the dynamic DNS service.

This turns out to be pretty easy: just add use=web to /etc/ddclient.conf to have ddclient discover the external IP via the DynDNS.com IP checking service.

Along the way I've discovered that ddclient also supports No-IP.com - a fact that's only mentioned in the usage message that's displayed when running
ddclient --help
and after some futzing around I've come up with the following configuration file, in order to update both services with the same client, using their respective IP checking services:
use=web
web=http://ip1.dynupdate.no-ip.com/
protocol=noip, login=username, password='password' group_or_comma_separated_host_list
protocol=dyndns2, use=web, web=dyndns, server=members.dyndns.org, login=username, password='password' hostname
(according to the help message, it should've been possible to specify the first two lines inside the third line, but this doesn't work for some reason - I guess it's a bug).

8 comments:

  1. Use 'server=dynupdate.no-ip.com/nic/update' instead :-)

    Reference: http://www.no-ip.com/integrate/request

    ReplyDelete
  2. That's the default server in ddclient. My problem is that my box is behind a NAT and ddclient always sends over the myip= parameter, so it has to know the external IP.

    Thanks.

    ReplyDelete
  3. Great way to deal with being behind a NAT! I'm not really sure many people want PPPoE, they just end up with it. :)

    I ended up using this method and the one posted in the comments at two different locations.

    Also, I'm willing to bet the reason that you can't have the 2nd, 3rd, and 4th lines all together is because that file was edited in a windows text editor (notepad). Try creating the file from scratch on the linux side using vi, nano, or joe.

    ReplyDelete
  4. I'm glad this blog post helped you. That's cool.

    And you shouldn't bet: I don't edit Linux text files on Windows, and I don't use vi, nano or joe on Linux.

    I live in Emacs. Usually in console mode.

    ReplyDelete
  5. @Zung:

    A caveat that can mislead into thinking it works correctly with leaving the default use=if parameter, i've seen in syslog that it sent my private IP to no-ip.

    Then i checked into no-ip's web interface and it appears that when they receive a private IP they replace it with the public IP of the request's sender so it seems fine.

    The problem is that ddclient uses this information not only for sending into the request, but also to determine when an update is needed (to avoid unnecessary requests). So it might miss updates if the DSL changes adress while the internal IPs don't.

    This is aggravated if (a very probable scenario) the machine that does the updates is a 24/24 machine like a fixed-IP server or a mini-PC with a permanent DHCP lease.

    Hence the real need of using this parameter, even if it seems ok with the default configuration

    ReplyDelete
  6. Thanks for clearing this up.

    I've never tested this with the default configuration. But even if I did, I doubt I would've noticed this problem - after all, it would still update my IP (at least initially).

    Nice catch.

    ReplyDelete
  7. a little correction could help someone to use noip:
    ------------------------------------------------------------------------------
    and after some futzing around I've come up with the following configuration file, in order to update both services with the same client, using their respective IP checking services:

    use=web
    web=http://ip1.dynupdate.no-ip.com/
    protocol=noip, login=username, password='password' group_or_comma_separated_host_list
    protocol=dyndns2, use=web, web=dyndns, server=members.dyndns.org, login=username, password='passwor
    ---------------------------------------------------

    it's missing a comma in this line:
    protocol=noip, login=username, password='password' group_or_comma_separated_host_list
    correcting it adding a comma after 'password ' and finally dynamic-dns seem to work, just always remember to port forwarding port 80 in the router
    protocol=noip, login=username, password='password', group_or_comma_separated_host_list

    ReplyDelete
    Replies
    1. The text is a copy of my config file, with personal data replace with placeholders, which seems to work at my end. Not sure what to make of this. Anyhow, if this works better for you, then I guess other will also benefit. Thanks!

      Delete