No more free DynDNS … time for ORDNS :-)

Last Wednesday on May 7th 2014 DynDNS stopped with their free services. For people who like me use VPN to connect their home LAN this is not a pleasant message. The cheapest paid service from DynDNS is priced at $25/year. Luckily we have OpenRemote and it is very easy to recreate the dynamic DNS service for free. Please follow the steps:

  • register a domain name if you don’t already have one which you will be using for your home LAN. Free domains can be registered here freenom.com.
  • apply for free DNS service here namecheap.com. Setup the dynamic DNS service there too. This step will generate a password which will be used in the OpenRemote setDDNS command later.
  • create command in OpenRemote designer to read your external IP address: name = externalIP, protocol = HTTP, URL = http://ipecho.net/plain, HTTP method = GET, polling interval = 30m.
  • create sensor: name externalIP, command: externalIP, type: custom.
  • create command for setting the address record: name = setDDNS, protocol = HTTP, URL = http://dynamicdns.park-your-domain.com/update?host=@&domain=openremote.pl&password=password_at_namecheap.com&ip=${param}, HTTP method = GET.
  • create rules to forward your external IP changes:
    declare ExternalIP
      @role(event)
      ip : String
    end
    
    rule "ExternalIP init"
    when
      Event(source=="externalIP", $v: value)
      not ExternalIP()
    then
      insert (new ExternalIP($v.toString()));
      String message = "External IP initialized: '"+$v.toString();
      My_NMA nma = new My_NMA(message, -2);
      insert(nma);
      execute.command("setDDNS" , $v.toString());
    end
    
    rule "ExternalIP change"
    when
      Event(source=="externalIP", $v: value, value != "")
      $e: ExternalIP($i: ip, ip != $v)
    then
      String message = "External IP changed: '"+$i+"' -> '"+$v.toString()+"'";
      My_NMA nma = new My_NMA(message, 1);
      insert(nma);
      $e.setIp($v.toString());
      update($e);
      execute.command("setDDNS" , $v.toString());
    end
    
    

    The code above also sends push message to my smartphone using the Notify My Android service. Of course you can also use the Pushover service or remove the notification code from the rules.

  • In case you don’t need push service notifying about IP change then the rule below is all you need:
    rule "ExternalIP DDNS"
    when
      Event(source=="externalIP", $v: value!="")
    then
      execute.command("setDDNS" , $v.toString());
    end
    

Bravo, your OpenRemote is now paying you back 25$ a year for a VIP DynDNS account 😉

One thought on “No more free DynDNS … time for ORDNS :-)

Leave a Reply