Openwrt ddns setup for Namecheap

This is a bit off topic but I couldn’t find this piece of information anywhere on the Internet and managed to find out myself. So it’s probably better to share.

This post is valid for openwrt version 15.05 (Chaos Calmer). I cannot say anything sure about other versions. Prerequisites:

  1. Working installation of openwrt 15.05 (with Luci)
  2. Installed “luci-app-ddns” package
  3. Existing host record in Namecheap advanced DNS settings
  4. Enabled Dynamic DNS service in Namecheap dashboard
  5. Port-forwarding configured correctly (if necessary)

In order to have a working ddns client, the following needs to be set in Luci > Services > Dynamic DNS:

  • DDNS Service provider [IPv4]: — custom —
  • Custom update-URL: http://dynamicdns.park-your-domain.com/update?host=yoursubdomain&domain=yourdomain.com&password=yourpassword

Replace the green parts with your own data. You can check your password hash in your namecheap account.

  • Custom update-script: empty
  • Hostname/Domain: your full hostname (ex.: sub.domain.com)
  • Username: not really important, but it throws error if you omit it, so set it to domain name (ex.: domain.com)
  • Password: not really important, but it throws error if you omit it, so set it to your password hash.

After setup don’t forget to press “Save & Apply”. Now let’s check the log file viewer (last tab). It should look something like this:

  192239 : ddns version : 2.4.3-1
 192239 : verbose mode : 0 - run normal, NO console output
 192239 : check interval: 600 seconds
 192239 : force interval: 259200 seconds
 192239 : retry interval: 60 seconds
 192239 : retry counter : 0 times
 192239 : No old process
 192239 : last update: 2015-10-15 18:08
 192239 : Detect registered/public IP
 192239 : #> /usr/bin/nslookup xxxxxx.xxxxx.xx >/var/run/ddns/xxxxxx.dat 2>/var/run/ddns/xxxxxx.err
 192239 : Registered IP 'yyy.yyy.yyy.yyy' detected
 192239 info : Starting main loop at 2015-10-16 19:22
 192239 : Detect local IP on 'network'
 192239 : Local IP 'xxx.xxx.xxx.xxx' detected on network 'wan'
 192240 : Update needed - L: 'xxx.xxx.xxx.xxx' <> R: 'yyy.yyy.yyy.yyy'
 192240 : #> /usr/bin/wget -q -O /var/run/ddns/xxxxxx.dat -Y off 'http://dynamicdns.park-your-domain.com/update?host=xxxxxx&domain=xxxxx.xx&password=0123456789abfdef0123456789abcdef' 2>/var/run/ddns/xxxxxx.err
 192241 : DDNS Provider answered:
<?xml version="1.0"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>xxx.xxx.xxx.xxx</IP><ErrCount>0</ErrCount><ResponseCount>0</ResponseCount><Done>true</Done><debug><![CDATA[]]></debug></interface-response>
 192241 info : Update successful - IP 'xxx.xxx.xxx.xxx' send
 192241 info : Forced update successful - IP: 'xxx.xxx.xxx.xxx' send
 192241 : Waiting 600 seconds (Check Interval)

That’s it! If you need more than one host, go back to the overview and repeat the steps.

Leave a Reply

Your email address will not be published. Required fields are marked *