User Tools

Site Tools


doc:howto:ddns.client

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:ddns.client [2013/04/22 23:06]
valentt no-ip.com example
doc:howto:ddns.client [2015/07/28 14:19] (current)
chris5560 [dnsomatic.com]
Line 1: Line 1:
 +<​html>​
 +<table class="​inline"​ style="​width:​70%;​ margin-left:​5%">​
 +  <tr>
 +    <td style="​border-left:​6px solid #d3bc00; vertical-align:​middle">​
 +      <img src="/​_media/​meta/​icons/​tango/​48px-construction.svg.png"​ alt=""​ style="​float:​left;​ margin-right:​0.5em"​ />
 +      <​strong>​Under Construction!</​strong><​br />
 +      This page is currently under (re-)construction. You can <a href="?​do=edit">​edit</​a>​ the article to help completing it.
 +    </td>
 +  </tr>
 +</​table>​
 +</​html>​
 +
 ====== DDNS Client ====== ====== DDNS Client ======
 If you want to set up a DDNS Server instead, please see [[doc:​howto:​ddns.server]]. If you want to set up a DDNS Server instead, please see [[doc:​howto:​ddns.server]].
  
-===== Using LuCI =====+:!: **During reconstruction you will find the old wiki text [[#​old_wiki_text|here.]]** :!:
  
-DDNS stands for Dynamic DNS. Simply put, using this service gives a name to your ip. So if you're hosting something on your line, people wouldn'​t have to bother typing your IP. They can just type in your domain name! It also helps when your ip changes. Users won't need to discover what your new ip is, they can simply type your domain name. +===== Introduction =====
  
-First of all, you'll need to register to a DDNS. See the [[http://​wiki.openwrt.org/​doc/​howto/​ddns.client#​requirements]] section below for list of suggested DDNS providers.+DDNS stands for [[wp>​Dynamic_DNS|Dynamic DNS]]. Simply put, using this service gives name to your IP. So if you're hosting something on your line, people would not have to bother typing your IP. They can just type in your domain name! It also helps when your IP changes. Users won't need to discover what your new IP is, they can simply type your domain name
  
-This guide will help you configure your ddns service, so that your router auto-updates your ip to your ddns. The simplest method possible would be through LuCI (the default webUI for openwrt).+This guide will help you configure your DDNS service, so that your router auto-updates your IP to your DDNS provider. The simplest method possible would be through LuCI (the default webUI for OpenWrt).
  
-==== Step 1, install ​the packages ====+OpenWrt uses //​ddns-scripts//​ which are [[wp>​Bourne_shell|Bourne shell]] scripts.\\ 
 +There are other scripts and programs available in the web, also some DDNS providers offer their own programs.\\ 
 +All of them are currently not ported and tested on OpenWrt.
  
-Login into your router through your browser. Go to Administration (top right) > System (top left) > Software > Update Package Lists +:!: **Inside OpenWrt two package versions are available:​**\\ 
-Let it update, go back to SoftwareFind luci-app-ddns. Install it, then when it says the installation ​is finished, it's installed!+up to Barrier Breaker 14.07 it's //​ddns-scripts//​ version 1.x\\ 
 +since Chaos Calmer 15.05 it's //​ddns-scripts//​ version 2.x with IPv6 support and many other extensions\\ 
 +the corresponding LuCI application //luci-app-ddns// is also available.
  
-Just press any other link at the openwrt WebUI, and the WebUI will refresh itself and Dynamic DNS will appear under Services > Dynamic DNS. If those tabs don't show up, reboot the machine.+**Without ​any annotation ​the description works for all //​ddns-scripts//​ versions.**
  
-==== Step 2, configuration ====+===== Requirements ===== 
 + 
 +First of all, you'll need to pick and register a DNS name with a compatible DynamicDNS service provider.\\ 
 +For a list of DDNS providers, see: 
 +  * https://​www.google.de/​search?​q=dynamic+dns+provider+list 
 +  * http://​www.dmoz.org/​Computers/​Internet/​Protocols/​DNS/​DNS_Providers/​Dynamic_DNS/​ 
 +  * http://​dnslookup.me/​dynamic-dns/​ 
 + 
 +//​ddns-scripts//​ support the following services out of the box:\\ 
 +^  since 10.03\\ ver. 1.0.0-17 ​ ^  added in AA 12.09\\ ver. 1.0.0-21 ​ ^  added in BB 14.07\\ ver. 1.0.0-23 ​ ^  added in CC 15.05\\ ver. 2.4.3-1 ​ ^  added in trunk  ^ 
 +|  changeip.com ​ |  3322.org ​ |  ddns.com.br ​ |  BIND nsupdate <​sup>​3) 4) 6)</​sup>​ | | 
 +|  dnsdynamic.org ​ |  dnsomatic.com ​ |  duiadns.net ​ |  cloudflare.com <​sup>​2) 5) 6)</​sup> ​ | | 
 +|  dnsexit.com ​ |  easydns.com ​ |  mythic-beasts.com ​ |  domains.google.com <​sup>​5)</​sup> ​ | | 
 +|  dnsmax.com / thatip.com ​ |  namecheap.com ​ |  spdns.de <​sup>​6)</​sup> ​ |  loopia.se <​sup>​6)</​sup> ​ | | 
 +|  dyndns.org ​ |  ovh.com ​ | |  mydns.jp <​sup>​6)</​sup> ​ | | 
 +|  free.editdns.net ​ | | |  no-ip.com / noip.com <​sup>​1)</​sup> ​ | | 
 +|  freedns.afraid.org <​sup>​6)</​sup> ​ | | |  no-ip.pl <​sup>​6)</​sup> ​ | | 
 +|  he.net <​sup>​6)</​sup> ​ | | |  selfhost.de ​ | | 
 +|  no-ip.com / noip.com <​sup>​1)</​sup> ​ | | |  twodns.de ​ | | 
 +|  zoneedit.com <​sup>​5)</​sup> ​ | | 
 +<​sup>​1)</​sup>​ **__Since CC 15.05__** require additional package //​ddns-scripts_no-ip_com//​ to be installed.\\ 
 +<​sup>​2)</​sup>​ needs additional package //​ddns-scripts_cloudflare//​ to be installed.\\ 
 +<​sup>​3)</​sup>​ directly updates a PowerDNS (or maybe bind server) via nsupdate.\\ 
 +<​sup>​4)</​sup>​ needs additional package //​ddns-scripts_nsupdate//​ and ''​bind-client''​ to be installed.\\ 
 +<​sup>​5)</​sup>​ SSL support required.\\ 
 +<​sup>​6)</​sup>​ **__Since CC 15.05__** support IPv6 
 + 
 +If you have picked a DDNS service provider and create your host/domain name you need to note additional your username and password.\\ 
 +Now you need to decide if you want to use secure communication with your DDNS provider or not.\\ 
 +Some provider require secure ([[wp>​HTTPS|HTTPS]]) communication. Read their help pages for details and also read provider specific informations below. 
 + 
 + 
 +===== Support ===== 
 +If you need supportfound an issue or only want to request a new extension for the next release, please post your questions/​issues/​requests here: **(Don'​t forget to post informations about your used software versions.)** 
 +   * [[https://​forum.openwrt.org/​|OpenWrt Forum]] 
 +   * [[https://​github.com/​openwrt/​packages/​issues|Github-OpenWrt-Packages]] for //​ddns-scripts//​ 
 +   * [[https://​github.com/​openwrt/​luci/​issues|Github-OpenWrt-LuCI]] for //​luci-app-ddns//​ 
 +A full list of supported settings (some not supported by LuCI webUI): 
 +   * UCI documentation -> [[doc:​uci:​ddns|Dynamic DNS Client ​configuration]] 
 +The source code is available at GitHub: 
 +|  BB 14.07  | [[https://​github.com/​openwrt/​packages/​tree/​for-14.07/​net/​ddns-scripts|ddns-scripts_1.0.0-23 ]]  | [[https://​github.com/​openwrt/​luci/​tree/​luci-0.12/​applications/​luci-ddns|luci-app-ddns_0.12+svn-r10530-1]] ​ | 
 +|  CC 15.05  | [[https://​github.com/​openwrt/​packages/​tree/​for-15.05/​net/​ddns-scripts|ddns-scripts_2.4.3-1]] ​ | [[https://​github.com/​openwrt/​luci/​tree/​for-15.05/​applications/​luci-app-ddns| luci-app-ddns_2.2.4-1]] ​ | 
 +|  trunk  | [[https://​github.com/​openwrt/​packages/​tree/​master/​net/​ddns-scripts|ddns-scripts]] ​ | [[https://​github.com/​openwrt/​luci/​tree/​master/​applications/​luci-app-ddns|luci-app-ddns]] ​ | 
 + 
 +===== Installation ===== 
 +==== using LuCI ==== 
 +Login into your router through your browser.\\ 
 +From the menu select '''​System'''​ -> '''​Software'''​\\ 
 +Press button [Update Lists] to update internal lists of available packages.\\ 
 +Filter for //ddns// and install //​luci-app-ddns//​ package. 
 + 
 +Installing the package //​luci-app-ddns//​ will automatically install the package //​ddns-scripts//​.\\ 
 +**__Since CC 15.05__** you might need to install provider specific packages //​ddns-scripts_xxxxx//​ and LuCI language packages //​luci-i18n-ddns-xx//​. 
 + 
 +After luci-app-ddns (and other packages) are installed, just press any other menu entry on the Openwrt LuCI webUI, and the page will refresh itself and it will appear in the menu under '''​Services'''​ -> '''​%%Dynamic DNS%%'''​. 
 + 
 +==== via console ==== 
 +To install //​ddns-scripts//​ use the [[doc:​techref:​opkg|OPKG Package Manager]] \\ 
 +**__Since CC 15.05__** you might need to install provider specific packages 
 +<​code|root@OpenWrt:/#>​ 
 +opkg update 
 +opkg install ddns-scripts 
 +opkg install ddns-scripts_xxxxx 
 +</​code>​ 
 + 
 +==== SSL support ==== 
 + 
 +By default //​ddns-scripts//​ uses BusyBox buildin '''​wget'''​ for DDNS updates over http, which does not support https (SSL). \\  
 +To perform DDNS updates over https (SSL), you will need to install the '''​wget'''​ or '''​curl'''​ package, and add the appropriate root certificate for your ddns provider. 
 + 
 +**__Including AA 12.09__** only '''​curl'''​ package is supported to use for SSL communication.\\ 
 +To install curl and needed certificate bundle follow these steps on console: 
 +<​code|root@OpenWrt:/#>​ 
 +opkg update 
 +opkg install curl 
 +mkdir -p -m0755 /​etc/​ssl/​certs 
 +curl -o /​etc/​ssl/​certs/​ca-certificates.crt http://​curl.haxx.se/​ca/​cacert.pem 
 +</​code>​ 
 + 
 +**__Since BB 14.07__** //​ddns-scripts//​ support both '''​wget'''​ and '''​curl'''​ package.\\ 
 +Installation is simple by installing either '''​wget'''​ or '''​curl'''​ plus '''​ca-certificates'''​ packages.\\ 
 +If both packages are installed //​ddns-scripts//​ will use '''​wget'''​. 
 + 
 +**__Since CC 15.05__** If both packages installed you can configure which one to prefere. Default is '''​wget'''​. 
 + 
 +You can install either via LuCI (from the menu select '​System'​ → '​Software'​) and search for '''​wget'''​ or '''​curl'''​\\ 
 +of install via console using following commands: 
 +<​code|root@OpenWrt:/#>​ 
 +opkg update 
 +opkg install wget     # normally you only need 
 +opkg install curl     # either wget or curl 
 +opkg install ca-certificates 
 +</​code>​ 
 + 
 +:!: If you, also for other software, needs all certificates in one file or you want to update CA certificates reulary then do **NOT** install '''​ca-certificates'''​ package.\\ 
 +'''​ca-certificate'''​ package is not always backported to older OpenWrt versions. 
 +Install latest CA certificates (in one file) using console: 
 +<​code|root@OpenWrt:/#>​ 
 +mkdir -p -m0755 /​etc/​ssl/​certs 
 +curl -o /​etc/​ssl/​certs/​ca-certificates.crt http://​curl.haxx.se/​ca/​cacert.pem ​  # using curl 
 +wget -O /​etc/​ssl/​certs/​ca-certificates.crt http://​curl.haxx.se/​ca/​cacert.pem ​  # using wget 
 +</​code>​ 
 +==== other functions ==== 
 + 
 +**__Since CC 15.05__** //​ddns-scripts//​ support other special communication functions to be used: 
 +  * Run once (useful for usage with ''​crond''​) 
 +  * Set proxy with/​without authenfication for http/https requests 
 +  * Set DNS server to use other than system default 
 +  * Binding to specific network if ''​wget''​ or to specific interface if ''​curl''​ installed. 
 +  * Force the usage of either IPv4 or IPv6 communication only. Require either ''​wget''​ or ''​curl''​ AND ''​bind-host''​ ! 
 +  * DNS requests via TCP. Require either ''​wget''​ or ''​curl''​ AND ''​bind-host''​ ! 
 + 
 +===== Configuration ===== 
 +==== Basics ==== 
 +ddns-scripts are designed to update one host per configuration/​section.\\ 
 +To update multiple hosts or providers or IPv4 and IPv6 for the same host you need to define separate configurations/​sections.\\ 
 +Some provider offer to update multiple host within one update request. A possible solution for this option is to use ''​--custom--''​ service name settings.\\ 
 +Have a look at [[#​provider_specifics|Provider specifics]]. 
 + 
 +The main settings you need to set are (all other normally work fine with the defaults):​\\ 
 +|  Service name | the DDNS service provider to use  | 
 +|  Host/Domain | your [[wp>​Fully_qualified_domain_name|FQDN]] you want to update (used by //​ddns-scripts//​ using nslookup to check if update has happen) ​ | 
 +|  Username | username or other parameter to use as username ​ | 
 +|  Password | password or other parameter to use as password\\ :!: **__including BB 14.07__** Ensure this password does not have "​$1"​ or $ with any number following in it, as this breaks the script. ​ | 
 +|  Interface | network name (i.e. wan, wan6) used by OpenWrt hotplug event system to start //​ddns-scripts// ​ | 
 + 
 +After fresh installation a configuration/​section '''​myddns'''​ and **__since CC 15.05__** '''​myddns_ipv4'''​ and '''​myddns_ipv6'''​ exists ready to be modified for your needs.\\ 
 +You could delete them and define your own.\\ 
 + 
 +{{:​meta:​icons:​tango:​dialog-warning.png?​nolink&​32x32}} ​ **Please heed the following important hints:** 
 +  *** It is NOT allowed to use ''​dash''​-sign "​-"​ inside configuration/​section names.** 
 +  ***A full list of supported settings (some not supported by LuCI webUI) you will find in [[doc:​uci:​ddns|UCI documentation]]!** 
 +  ***Always keep in mind the [[#​provider_specifics|Provider specific]] settings if there are any!** 
 +  ***Don'​t forget to enable your configuration/​section!** 
 +  ***You need minimum one enabled configuration/​section for //ddns// service to start!** 
 +  ***__since BB 14.07__ you need to enable //ddns// service to enable updates being send on reboot and hotplug events!** 
 +  ***__//​Although described elsewhere, it is not recommended to change the files '''/​usr/​lib/​ddns/​services'''​ or '''/​usr/​lib/​ddns/​services_ipv6'''​ because they will be overwritten during system and package updates!//​__** 
 +==== using LuCI ==== 
 +Login into your router through your browser.\\ 
 +From the menu select '''​Services'''​ -> '''​%%Dynamic DNS%%'''​.\\ 
 +Navigate to the configuration/​section you like to change.\\ 
 +Modify the fields you need to change.\\ 
 +Don't forget to check the '''​Enabled'''​ option!\\ 
 +Click [Save & Apply] button to save changes. 
 + 
 +To add a new configuration/​section:​\\ 
 +Type the new name into the text entry box at the bottom of the page next to [Add] button.\\ 
 +:!: **Do not use a ''​dash''​ character "​-"​ in configuration/​section name!**\\ 
 +Click [Add] button.\\ 
 +Modify the fields you need to change.\\ 
 +Don't forget to check the '''​Enabled'''​ option!\\ 
 +Click [Save & Apply] button to save changes. 
 + 
 +**__Since CC 15.05__** '''​Username'''​ and '''​Password'''​ fields are required fields. If your provider do not require one or both of them, simply put in a character of your choise. 
 + 
 +:!: **__Since BB 14.07__ you need to enable ddns service!**\\ 
 +From the menu select '''​System'''​ -> '''​Startup'''​.\\ 
 +Set //ddns// service to enabled. 
 + 
 +=== SSL Support === 
 +**__Including BB 14.07__** it is not possible to configure SSL-Support (using HTTPS) via LuCI webUI. You need to configure [[#​ssl_support2|via console]]!\\ 
 +**__Since CC 15.05__** options to configure HTTPS communication are only available if ''​wget''​ or ''​curl''​ package is installed. (See ''​Hints''​ if shown.) 
 + 
 +Check '''​Use HTTP Secure'''​ option.\\ 
 +Additional field '''​Path to CA-Certificate'''​ is shown with it's default setting.\\ 
 +If you have installed ''​ca-certificate''​ package leave the shown default! (''/​etc/​ssl/​certs''​)\\ 
 +If you have installed CA certificates in one file from [[#​ssl_support|above]] set the value to: ''/​etc/​ssl/​certs/​ca-certificates.crt''​\\ 
 +If you like to use other certificate you need to set here the full path to the certificate including file name. (''/​path/​to/​file.crt''​)\\ 
 +If your certificates are stored in a different path, set here the path where your certificates are located. (''/​path/​to/​files''​)\\ 
 +Click [Save & Apply] button to save changes. 
 + 
 +=== Custom Service === 
 +If you want to use a DDNS provider currently not listed or you want to update multiple hosts within one configuration/​section then you should do the following:​\\ 
 +Choose '''​--custom--'''​ as service.\\ 
 +Additional field '''​%%Custom update-URL%%'''​ is shown.\\ 
 +Fill in the URL you like to use. :!: Please read URL syntax description [[#​custom_service1|below]].\\ 
 +Also have a look at [[#​provider_specifics|Provider specifics]].\\ 
 +Click [Save & Apply] button to save changes. 
 + 
 +:!: **If you found a DDNS provider not listed or with additional IPv6 support or with changed update URL please open an issue at [[https://​github.com/​openwrt/​packages|Github-OpenWrt-Packages]] so it can be included with the next release.** 
 +==== via Console ==== 
 + 
 +The easiest way to configure //​ddns-scripts//​ via console is to edit the file ''/​etc/​config/​ddns''​ directly using build-in [[wp>​Vi|vi editor]] or any other editor you prefer. Other editors as ''​vi''​ needs to be installed separately. 
 + 
 +A configuration/​section looks like: 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + option '​service_name'​ '​example.org'​ 
 + option '​domain'​ '​yourhost.example.org'​ 
 + option '​username'​ '​your_username'​ 
 + option '​password'​ '​your_password'​ 
 + option '​interface'​ '​wan'​ 
 + option '​ip_source'​ '​network'​ 
 + option '​ip_network'​ '​wan'​ 
 +</​code>​ 
 + 
 +Alternatively you can use [[doc:​uci#​command_line_utility|UCI command line interface]].\\ 
 +Example input: 
 +<​code|root@OpenWrt:/#>​ 
 +uci set ddns.myddns.service_name="​ddnsprovider.com"​ #​ only use names listed in /​usr/​lib/​ddns/​services  
 + # or /​usr/​lib/​ddns/​services_ipv6 (since CC 15.05) 
 +uci set ddns.myddns.domain="​host.yourdomain.net"​ 
 +uci set ddns.myddns.username="​your_user_name"​ 
 +uci set ddns.myddns.password="​p@ssw0rd"​ 
 +uci set ddns.myddns.interface="​wan"​ #​ network interface that should start this configuration/​section 
 +uci set ddns.myddns.enabled="​1"​ 
 +uci commit ddns # don't forget this, otherwise data not written to configuration file 
 +</​code>​ 
 + 
 +''​ddns.myddns.enabled="​1"''​ means: 
 +  * '''​ddns'''​ is the configuration file to change (here ''/​etc/​config/​ddns''​) 
 +  * '''​myddns'''​ is the configuration/​section to change 
 +  * '''​enabled'''​ is the option to set/​change 
 +  * behind the ''​equal''​-sign is the value to set. :!: Set ''​single''​- or ''​double''​-quotes around the value and no space or whitespace around the ''​equal''​-sign. 
 + 
 +Example to create/add a new configuration/​section "​newddns":​ 
 +<​code|root@OpenWrt:/#>​ 
 +uci set ddns.newddns="​service"​ 
 +uci set ddns.newddns.service_name="​ddnsprovider.com"​ #​ only use names listed in /​usr/​lib/​ddns/​services 
 + # or /​usr/​lib/​ddns/​services_ipv6 (since CC 15.05) 
 +uci set ddns.newddns.domain="​host.yourdomain.net"​ 
 +uci set ddns.newddns.username="​your_user_name"​ 
 +uci set ddns.newddns.password="​p@ssw0rd"​ 
 +uci set ddns.newddns.interface="​wan"​ #​ network interface that should start this configuration/​section 
 +uci set ddns.newddns.enabled="​1"​ 
 +uci commit ddns # don't forget this, otherwise data not written to configuration file 
 +</​code>​ 
 + 
 +:!: **__Since BB 14.07__ you need to enable //ddns// service by:** 
 +<​code|root@OpenWrt:/#>​ 
 +/​etc/​init.d/​ddns enable 
 +</​code>​ 
 + 
 +=== SSL Support === 
 + 
 +**__Including AA12.09__** //​ddns-scripts//​ only support '''​curl'''​ package to use for SSL communication.\\ 
 +You should have followed the installation steps [[#​ssl_support|above]] and\\ 
 +add the following entries to desired section in '''/​etc/​config/​ddns'''​ file: 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_https'​ '​1'​ 
 + option '​cacert'​ '/​etc/​ssl/​certs/​ca-certificates.crt'​ 
 +</​code>​ 
 + 
 +**__Since BB 14.07__** you need to add the following entries to the desired section in '''/​etc/​config/​ddns'''​ file:\\ 
 +using '''​ca-certificates'''​ package: 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_https'​ '​1'​ 
 + option '​cacert'​ '/​etc/​ssl/​certs'​ 
 +</​code>​ 
 +using single file (ie. as descriped [[#​ssl_support|above]]):​ 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_https'​ '​1'​ 
 + option '​cacert'​ '/​etc/​ssl/​certs/​ca-certificates.crt'​ 
 +# option '​cacert'​ '/​full/​path/​to/​file.crt'​ 
 +</​code>​ 
 + 
 +**__Since CC 15.05__** above options can also be set via LuCI webUI.\\ 
 +The options are only shown if '''​wget'''​ or '''​curl'''​ package is installed! 
 + 
 +=== Custom Service === 
 +Following changes need to be done if you use a DDNS provider currently not listed or to update multiple hosts within one configuration/​section.\\ 
 +Edit '''/​etc/​config/​ddns'''​ 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 +# option '​service_name'​ '​example.org'​ #​ comment out "#"​ or delete 
 + option '​update_url'​ '​http://​your.update.url...[USERNAME]...[PASSWORD]...[DOMAIN]...[IP]'​ 
 +</​code>​ 
 +or use UCI command line interface 
 +<​code|root@OpenWrt:/#>​ 
 +uci delete ddns.myddns.service_name 
 +uci set ddns.myddns.update_url="​http://​your.update.url...[USERNAME]...[PASSWORD]...[DOMAIN]...[IP]"​ 
 +uci commit ddns # don't forget this, otherwise data not written to configuration file 
 +</​code>​ 
 + 
 +== URL Syntax == 
 +:!: It's not needful to set '''​https:​%%//​%%'''​. If SSL support is activated '''​http:​%%//​%%'''​ is replaced automatically.\\ 
 +:!: The entries [USERNAME] [PASSWORD] [DOMAIN] [IP] are replaced by //​ddns-scripts//​ just before update.\\ 
 +[USERNAME] is replaced by content of '''​option username'''​ from configuration file.\\ 
 +[PASSWORD] is replaced by content of '''​option password'''​ from configuration file.\\ 
 +[DOMAIN] is replaced by content of '''​option domain'''​ from configuration file.\\ 
 +[IP] is replaced by the current IP address of your OpenWrt system. 
 + 
 +:!: carefully set '''​option domain'''​ in your configuration. This option is also used to detect if the update was successfully done.\\ :!: This entry is the DNS name your OpenWrt system will be reachable from the internet.\\ 
 +:!: Have a look at [[#​provider_specifics|Provider specifics]] for samples.\\ 
 + 
 +:!: **If you found a DDNS provider not listed or with additional IPv6 support or with changed update URL please open an issue at [[https://​github.com/​openwrt/​packages|Github-OpenWrt-Packages]] so it can be included with the next release.** 
 + 
 +===== Operation ===== 
 + 
 +|  {{:​meta:​icons:​tango:​48px-emblem-important.svg.png?​nolink&​32x32}} ​ | **Enable minimum one configuration/​section !\\ since BB 14.07 you need to enable ddns service !**  | 
 + 
 +==== Basics ==== 
 +Normally no user actions are required because //​ddns-scripts//​ starts when hotplug ''​ifup''​ event happens. This will happen automatically at system startup when the named interface comes up. Event ''​ifup''​ also happen when a dialup network comes up.\\ 
 +//​ddns-scripts//​ regularly check if there is a difference between your IP address at DNS and your interface. If different an update request is send to DDNS provider. 
 + 
 +**__Including BB 14.07__** if you modify your configuration from LuCI webUI you need to restart //​ddns-scripts//​ manually (see below).\\ 
 +**__Since CC 15.05__** whenever you [Save & Apply] an ''​Enabled''​ configuration/​section from LuCI webUI the corresponding script is automatically restarted. 
 + 
 +:!: **__for all versions__** if you modify '''/​etc/​config/​ddns'''​ configuration file from console, you need to restart //​ddns-scripts//​ (see below) to apply changes. 
 + 
 +To check if //​ddns-scripts//​ are running you could check inside LuCI via '''​Status'''​ -> '''​Processes'''​\\ or via console running <​code|root@OpenWrt:/#>​ps -w | grep dynami[c]</​code>​ 
 +You should find something like '''​... /bin/sh /​usr/​lib/​ddns/​dynamic_dns_updater.sh **myddns** 0'''​\\ 
 +for every configuration/​section you configured and enabled, where **myddns** shows your configuration/​section name. 
 + 
 +**__Since CC 15.05__** inside LuCI also exists a section '''​Dynamic DNS'''​ at '''​Status'''​ -> '''​Overview'''​ page showing the current status of your DDNS configurations. 
 +==== Run manually ==== 
 +=== using LuCI === 
 +To **check** running //​ddns-scripts//​ processes from the menu goto '''​Status'''​ -> '''​Processes'''​.\\ 
 +Look for something like '''/​bin/​sh /​usr/​lib/​ddns/​dynamic_dns_updater.sh **myddns** 0'''​.\\ 
 +To **stop** a desired process press the [Terminate] or [Kill] button.\\ 
 +The process should remove from the list. 
 + 
 +**__Including AA 12.09__** //​ddns-scripts//​ can only be started creating an '''​ifup'''​ hotplug event by restarting the desired interface.\\ 
 +:!: Keep in mind that also other service processes (i.e. firewall) might be (re-)started via '''​ifup'''​ hotplug event!\\ 
 +From the menu select '''​Network'''​ -> '''​Interfaces'''​. Select the desired interface and press [Connect] button. 
 + 
 +**__Since BB 14.07__** you can enable/​disable and start/stop //​ddns-scripts//​ from '''​System'''​ -> '''​Startup'''​ menu.\\ 
 +Look for service '''​ddns'''​ and press the button for the desired action. 
 + 
 +**__Since CC 15.05__** you can additional enable/​disable and start/stop individual configuration/​section from '''​Overview'''​-page at '''​Services'''​ -> '''​%%Dynamic DNS%%'''​. 
 + 
 + 
 +=== via console === 
 +From console command line you could create an '''​ifup'''​ hotplug event for the desired network interface. This will start all enabled ddns configurations/​sections monitoring this interface.\\ 
 +:!: Keep in mind that also other service processes (i.e. firewall) might be (re-)started via '''​ifup'''​ hotplug event!\\ 
 +For INTERFACE, type the specified //​ddns-scripts//​ interface name (the interface name from /​etc/​config/​network,​ usually '​wan'​) 
 +<​code|root@OpenWrt:/#>​ 
 +ACTION=ifup INTERFACE=wan /​sbin/​hotplug-call iface 
 +</​code>​ 
 +To **start** only one //​ddns-scripts//​ configuration/​section (here '''​myddns'''​):​ 
 +<​code|root@OpenWrt:/#>​ 
 +/​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns 0 & 
 +</​code>​ 
 +To **start** all //​ddns-scripts//​ configurations configured for one interface (the interface name from /​etc/​config/​network,​ usually '​wan'​):​ 
 +<​code|root@OpenWrt:/#>​ 
 +sh 
 +. /​usr/​lib/​ddns/​dynamic_dns_functions.sh #​ note the leading period followed by a space 
 +start_daemon_for_all_ddns_sections "​wan"​ 
 +exit 
 +</​code>​ 
 +To **stop** one configuration/​section you need to list running ddns processes with: 
 +<​code|root@OpenWrt:/#>​ 
 +ps -w | grep dynami[c] 
 +</​code>​ 
 +you will get something like: 
 +<​code|root@OpenWrt:/#>​ 
 +2493 root      1440 R    {dynamic_dns_upd} /bin/sh /​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns_1 0 
 +2494 root      1440 R    {dynamic_dns_upd} /bin/sh /​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns_2 0 
 +</​code>​ 
 +now you need to kill every running process: 
 +<​code|root@OpenWrt:/#>​ 
 +kill 2493 # to kill one process 
 +kill 2493 2494 # to kill multiple processes 
 +</​code>​ 
 +To **stop** all running processes at once ('''​killall'''​ might not be available on all systems): 
 +<​code|root@OpenWrt:/#>​ 
 +killall dynamic_dns_updater.sh #​ if killall is available 
 +ps | grep dynami[c] | awk '​{print $1}' | xargs kill # or if not available 
 +</​code>​ 
 +**__Since BB 14.07__** you could ''​enable/​disable''​ and ''​start/​stop/​restart''​ all enabled ddns configuration/​section like every other service: 
 +<​code|root@OpenWrt:/#>​ 
 +/​etc/​init.d/​ddns disable 
 +/​etc/​init.d/​ddns enable 
 +/​etc/​init.d/​ddns start 
 +/​etc/​init.d/​ddns stop 
 +/​etc/​init.d/​ddns restart 
 +</​code>​ 
 + 
 + 
 +=== using scheduler === 
 +**__Since CC 15.05__** each configuration/​section of //​ddns-scripts//​ can be configured to run once including retry on error so it is garanted that the update is send to the provider.\\ 
 + 
 +To configure your configuration/​section to run once you need to set '''​option force_interval'''​ to '''​0'''​. Setting of '''​option force_unit'''​ is ignored.\\ 
 +Inside LuCI set '''​Force Interval'''​ in [Timer Settings]-tab of your desired configuration\\ 
 +or edit '''/​etc/​config/​ddns'''​ on console. 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​force_interval'​ '​0'​ 
 +</​code>​ 
 + 
 +If you set //ddns// service to ''​enable''​ then all configurations/​sections are started during interface '''​ifup'''​.\\ 
 +The configuration/​section configured to run once will stop after successful update.\\ 
 +To garant that your configurations only run once not looking for an interface event you need to disable //ddns// service.\\ 
 +To start your configuration via [[doc:​howto:​notuci.config?#​etccrontabsroot_cronjob_aka_crontab|build in crond]] use the following entry as ''​command''​ inside crontab configuration (replace '''​myddns'''​ with the name of your configuration/​section):​ 
 +<​code|root@OpenWrt:/#>​ 
 +/​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns 0 & 
 +</​code>​ 
 + 
 +==== Monitoring ==== 
 + 
 +=== Syslog === 
 +**__Including AA 12.09__** there is no ''​syslog''​ support implemented in //​ddns-scripts//​.\\ 
 +To get an output to ''​syslog''​ you need to do the following modifications.\\ 
 +Edit '''/​etc/​config/​ddns'''​ and insert the new '''​option use_syslog'''​ to each configuration/​section:​ 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_syslog'​ '​1'​ 
 +</​code>​ 
 +Edit '''/​usr/​lib/​ddns/​dynamic_dns_functions.sh'''​ and append the following lines: 
 +<​code|/​usr/​lib/​ddns/​dynamic_dns_functions.sh>​ 
 +syslog_echo() 
 +
 + if [ "​$use_syslog"​ = 1 ] 
 + then 
 + echo $1|logger -t ddns-scripts-$service_id 
 + fi 
 +
 +</​code>​ 
 + 
 +**__For 10.03__** additional edit '''/​usr/​lib/​ddns/​dynamic_dns_updater.sh'''​ and add the following lines: 
 +<​code|/​usr/​lib/​ddns/​dynamic_dns_updater.sh>​ 
 +260 time_since_update=$(($current_time - $last_update)) 
 +261 
 +262 
 + syslog_echo "​Running IP check ..." # add this line 
 +263 verbose_echo "​Running IP check..."​ 
 +... 
 +... 
 +291 update_output=$( $retrieve_prog "​$final_url"​ ) 
 +292 
 + syslog_echo "​Update returned: $update_output"​ #​ add this line 
 +293 verbose_echo "​Update Output:"​ 
 +</​code>​ 
 + 
 +**__For AA 12.09__** additional edit '''/​usr/​lib/​ddns/​dynamic_dns_updater.sh'''​ and add the following lines: 
 +<​code|/​usr/​lib/​ddns/​dynamic_dns_updater.sh>​ 
 +284 time_since_update=$(($current_time - $last_update)) 
 +285 
 +286 
 + syslog_echo "​Running IP check ..." # add this line 
 +287 verbose_echo "​Running IP check..."​ 
 +288 verbose_echo "​current system ip = $current_ip"​ 
 +289 verbose_echo "​registered domain ip = $registered_ip"​ 
 +... 
 +... 
 +316 if [ $? -gt 0 ] 
 +317 then 
 + syslog_echo "​update failed, retrying in $retry_interval_seconds seconds"​ #​ add this line 
 +318 verbose_echo "​update failed"​ 
 +319 sleep $retry_interval_seconds 
 +320 continue 
 +321 fi 
 +322 
 + syslog_echo "​Update successful"​ #​ add this line 
 +323 verbose_echo "​Update Output:"​ 
 +</​code>​ 
 + 
 +**__For BB 14.07__** output to syslog is already supported by //​ddns-scripts//​\\ 
 +but you need to edit '''/​etc/​config/​ddns'''​ via console because LuCI does not support this setting: 
 +<​code|/​etc/​config/​ddns>​ 
 +config service "​myddns"​ 
 + ... 
 + option use_syslog "​1"​ 
 +</​code>​ 
 + 
 +**__Since CC 15.05__** the '''​option use_syslog'''​ (also in LuCI) allow to define the level of events logged to syslog: 
 +^  Value  ^ Reporting ​ ^ 
 +|  0  | disable ​ | 
 +|  1  | info, notice, warning, errors ​ | 
 +|  2  | notice, warning, errors ​ | 
 +|  3  | warning, errors ​ | 
 +|  4  | errors ​ | 
 +|  :!: Critical errors forcing //​ddns-scripts//​ to break (stop) are always logged to syslog. :!:  || 
 + 
 + 
 +=== Logfile === 
 + 
 +**__Including BB 14.07__** //​ddns-scripts//​ have no logfile support.\\ 
 +To add logfile support to these versions you need to do the following modifications.\\ 
 +Edit '/​etc/​config/​ddns'​ and insert the new '​option use_logfile'​ to each configuration/​section:​ 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_logfile'​ '​1'​ 
 +</​code>​ 
 + 
 +Edit '''/​usr/​lib/​ddns/​dynamic_dns_functions.sh'''​ and add the following lines to '''​verbose_echo()'''​ function: 
 +<​code|/​usr/​lib/​ddns/​dynamic_dns_functions.sh>​ 
 +102 
 +103 verbose_echo() 
 +104 { 
 +105 if [ "​$verbose_mode"​ = 1 ] 
 +106 then 
 +107 echo $1 
 +108 fi 
 + if [ "​$use_logfile"​ = 1 ] 
 + then 
 + LOGDIR="/​var/​log/​ddns"​ #​ log directory 
 + LOGFILE="​$LOGDIR/​${service_id}.log"​ #​ logfile name 
 + LOGLINES=500 #​ max number of lines in logfile 
 + [ -d $LOGDIR ] || mkdir -p -m755 $LOGDIR 
 + echo $1 >> $LOGFILE 
 + # verbose mode then no log truncate 
 + [ "​$verbose_mode"​ = 1 ] || sed -i -e :a -e '​$q;​N;'​$LOGLINES',​$D;​ba'​ $LOGFILE 
 + fi 
 +109 } 
 +110 
 +</​code>​ 
 + 
 +**__Since CC 15.05__** //​ddns-scripts//​ have buildin logfile support.\\ 
 +Logfiles are automatically truncated to a settable number of lines (default 250 lines). 
 + 
 +Inside LuCI you could enable logfile in [Advanced Settings]-tab of desired configuration/​section.\\ 
 +From console you need to edit '''/​etc/​config/​ddns'''​ file: 
 +<​code|/​etc/​config/​ddns>​ 
 +config '​service'​ '​myddns'​ 
 + ... 
 + option '​use_logfile'​ '​1'​ 
 +</​code>​ 
 + 
 +To view logfile content from LuCI select the [Log File Viewer]-tab of desired configuration/​section and press the [Read / Reread log file]-button. 
 +From console you should change to the ddns log directory (default '''/​var/​log/​ddns'''​).\\ 
 +You will find a logfile for every configuration/​section. 
 +<​code|root@OpenWrt:/#>​ 
 +cd /​var/​log/​ddns 
 +ls -la 
 +cat myddns_ipv4.log 
 +cat myddns_ipv6.log 
 +</​code>​ 
 + 
 +=== Debugging === 
 + 
 +To debug what's going on, you can run //​ddns-scripts//​ in verbose mode.\\ Following verbose level are defined: 
 +|  0  | Non verbose - No output ​ | 
 +|  1  | Output to console (default) ​ | 
 +| **__Since CC 15.05__** additional: ​ || 
 +|  2  | Output to console and logfile.\\ Run once WITHOUT retry on error. ​ | 
 +|  3  | Output to console and logfile.\\ Run once WITHOUT retry on error.\\ Sending NO update to DDNS service. ​ | 
 + 
 +Before starting debugging stop all running //​ddns-scripts//​ processes:​\\ 
 +**__Including AA 12.09__** 
 +<​code|root@OpenWrt:/#>​ 
 +ps | grep dynami[c] | awk '​{print $1}' | xargs kill 
 +</​code>​ 
 + 
 +**__Since BB 14.07__** 
 +<​code|root@OpenWrt:/#>​ 
 +/​etc/​init.d/​ddns stop 
 +/​etc/​init.d/​ddns disable 
 +</​code>​ 
 +validate that no //​ddns-scripts//​ processes running: 
 +<​code|root@OpenWrt:/#>​ps | grep dynami[c]</​code>​ 
 + 
 +Now you can start one configuration/​section for debugging. To stop/break running script press [CTRL]+C.\\ 
 +Replace '''​myddns'''​ with your desired configuration/​section name and '''​level'''​ with the desired verbose level. 
 +<​code|root@OpenWrt:/#>​ 
 +/​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns level 
 +</​code>​ 
 +**__Including BB 14.07__** if you see:\\ 
 +only the update_url=... output you forgot to enable this configuration/​section.\\ 
 +'''​badauth'''​ in Update Output, you have to change your password which contains only letters and numbers. Because busybox'​s (v1.15.3) wget implementation has an issue handling encoded URLs.\\ 
 +**__Since CC 15.05__** you will get full description of errors and the output of programs like wget, nslookup etc. used by //​ddns-scripts//​\\ 
 + 
 +=== Common errors === 
 + 
 +**Network and name resolution problems:​**\\ 
 +Check your communication settings with the following commands: 
 +<​code|root@OpenWrt:/#>​ 
 +nslookup google-public-dns-a.google.com 
 + 
 +ping -c 5 google-public-dns-a.google.com 
 +ping -c 5 -4 google-public-dns-a.google.com #​ (-4) force IPv4 communication 
 +ping -c 5 -6 google-public-dns-a.google.com #​ (-6) force IPv6 communication if installed 
 + 
 +wget -O- http://​checkip.dyndns.com #​ for IPv4 
 +wget -d -O- http://​checkipv6.dyndns.com #​ for IPv6 needs wget package and IPv6 to be installed 
 +curl -v http://​checkipv6.dyndns.com #​ for IPv6 needs curl package and IPv6 to be installed 
 +</​code>​ 
 + 
 +**HTTPS/SSL problems:​**\\ 
 +Check if your DDNS provider ONLY support secure requests and enable HTTPS (''​option use_https''​) in your configuration.\\ 
 +Packages '''​wget'''​ or '''​curl'''​ not installed to support secure communication.\\ 
 +'''​wget'/'​curl'''​ could not access/​validate SSL certificates.\\ 
 +Check certificate installation and run '''​wget'''​ or '''​curl'''​ in verbose/​debug mode: 
 +<​code|root@OpenWrt:/#>​ 
 +ls -la /etc/ssl 
 +ls -la /​etc/​ssl/​certs 
 + 
 +wget -d -O /​tmp/​wget.out https://​www.google.com --ca-certificate=/​etc/​ssl/​certs/​ca-certificates.crt #​ single certificate file 
 +wget -d -O /​tmp/​wget.out https://​www.google.com --ca-directory=/​etc/​ssl/​certs #​ certificate directory 
 +wget -d -O /​tmp/​wget.out https://​www.google.com --no-check-certificate #​ ignore certificate !!! INSECURE !!! 
 + 
 +curl -v -o /​tmp/​curl.out https://​www.google.com --cacert /​etc/​ssl/​certs/​ca-certificates.crt #​ single certificate file 
 +curl -v -o /​tmp/​curl.out https://​www.google.com --capath /​etc/​ssl/​certs #​ certificate directory 
 +curl -v -o /​tmp/​curl.out https://​www.google.com --insecure #​ ignore certificate !!! INSECURE !!! 
 +</​code>​
  
-^ Variable ^ Description ^ Example ^ 
-| enable | Self explanatory | none | 
-| Service | Which DDNS do you use? Choose one | dyndns | 
-| use_https | If set to 1 DDNS updates use SSL |  | 
-| Host | The DNS name of the ip, as configured in the DDNS site | your.domain.name | 
-| Username | Username of your DDNS | yourusername | 
-| Password | Password of your DDNS | yourpassword | 
-| Source of IP-address | This tells the router where to look for your actual WAN IP Address | Usually at '​Network'​ | 
-| Network/​Interface/​URL | If you choose Network, it would be the one negotiating your connection, in this case, the wan | wan | 
-| Check for changed IP every | Self Explanatory | 10 | 
-| Check-time unit | The unit for the value above | min | 
-| Force Update every | Self explanatory | 72 | 
-| Force-time unit | Unit for the value above | hr | 
  
 +===== Provider specifics =====
  
 +==== Overview ====
 +Remember to read who to [[#​custom_service1|configure a custom service]].\\
 +At provider specific settings, only parameters that needs to be changed are described.\\
 +The relevant paramters to use together with a custom settings are:
 +^ UCI option ​ ^ LuCI description ​ ^ Explanatory note  ^
 +| service_name ​ | DDNS Service provider ​ | Inside LuCI set to '''​--custom--'''​ or delete from '''/​etc/​config/​ddns'''​ if you need to use custom update URL.  |
 +| update_url ​ | Custom update-URL ​ | Copy from description below, if nessesary. ​ |
 +| domain ​ | Hostname/​Domain ​ | The already registered name at your DDNS provider.\\ :!: **Must be your public FQDN** because used by nslookup command to check if the send IP update was recognized by your provider and published around World Wide DNS.  |
 +| username ​ | Username ​ | Normally your username but possibly used with different settings. ​ |
 +| password ​ | Password ​ | Normally your password but possibly used with different settings. ​ |
  
-==== Step 3You're done====+If you find a FIXME at a provider description belowplease support me to test and update this wiki.\\ 
 +Please post a [[#​support]] request if something not working as described or needs to be updated.\\ 
 +**Thanks!**
  
-That's all you need to do! First update takes as long as the force update option is set to.+==== dnsomatic.com ==== 
 +Last updated: 2015-07-28\\ 
 +[[https://​www.dnsomatic.com/​|Homepage]] -- [[https://​www.dnsomatic.com/​wiki/​|Documentation]]
  
-If the wan interface changes its address, the DDNS account ​is updated automatically+The default ​is to use '''​domain'''​ together with '''​service_name'''​ set to '''​dnsomatic.com'''​.\\ 
-Additionally an unconditional ​update ​is sent periodicallyThe interval is specified by the force update option.+'''​domain'''​ needs to be set to FQDN to update/verify:!: NEVER use '​all.dnsomatic.com'!
  
-After initial ​configuration ​the ''​ifup wan''​ command can be used to force a DDNS update. Or, for Backfire, ​the following ​commands.+To update all services registered with DNS-O-Matic in one configuration/section use the following ​settings:
 <​code>​ <​code>​
-. /etc/profile # That's a period followed by a space +service_name delete / --custom-- 
-ifup wan+update_url http://​[USERNAME]:​[PASSWORD]@updates.dnsomatic.com/nic/update?​hostname=all.dnsomatic.com&​myip=[IP]&​wildcard=NOCHG&​mx=NOCHG&​backmx=NOCHG 
 +domain [Only ONE of your defined hostnames to verify update was send] 
 +username [Your username] 
 +password [Your password]
 </​code>​ </​code>​
  
-===== Using ddns-scripts =====+==== duckdns.org ​==== 
 +Last updated: 2015-07-14\\ 
 +[[http://​www.duckdns.org/​|Homepage]] -- [[http://​www.duckdns.org/​install.jsp|Installation instructions]] -- [[http://​www.duckdns.org/​faqs.jsp|FAQ]]
  
-OpenWrt uses the package <​code>​ddns-scripts</​code>​ +FIXME There is another [[doc:​howto:​ddns.client:​duckdns|description]] here. I take over the link during rewriting this wiki page. DELETEME
- for providing DDNS service.+
  
-==== Requirements ==== +Inside LuCI web UI select ​**--custom--** and fill in the other options accordingly.\\ 
-  ​A recent OpenWrt version. This howto was written for the '​Kamikaze 7.07' and later releases+:!: Be sure you install ssl support.\\ 
-  * An account with a compatible DDNS service, currently:​ +Additional use update_url and settings from below:\\ 
-   * http://​dyndns.org ​  :!: needs credit card number, even for "​Trial"​ Account+<​code>​ 
-   * http://​changeip.com :!: non-free +update_url http://www.duckdns.org/update?​domains=[USERNAME]&​token=[PASSWORD]&​ip=[IP] 
-   * http://zoneedit.com :!: non-free +domain [Your FQDN] 
-   * http://no-ip.com    still free =) +username [Your Host without ".duckdns.org"] 
-   * http://​freedns.afraid.org +password [Your token] 
-   * http://​dnsdynamic.org +use_https 1 
-   * Any other service that can update when some URL is accessed. ​ The script is quite versatile.+cacert [path to certificate file or directory] 
 +</code>
  
-For a longer list of additional DDNS providers, see:+==== freedns.afraid.org ==== 
 +Last updated2015-07-15\\ 
 +[[http://​freedns.afraid.org/​|Homepage]] -- [[http://​freedns.afraid.org/​faq/​|FAQ]]\\
  
-   ​* ​http://www.dmoz.org/Computers/Internet/Protocols/DNS/DNS_Providers/​Dynamic_DNS+Option 1: FIXME 
-   * http://dnslookup.me/dynamic-dns/+<​code>​ 
 +service_name freedns.afraid.org 
 +domain [Your FQDN] 
 +username [NOT used. Set to a character of your choice, because LuCI does not accept empty field] 
 +password [Your authorisation token, NOT your account password] 
 +</​code>​ 
 +To find your authorisation token, go to http://freedns.afraid.org/dynamic/, login, click "​Direct URL"​.\\ 
 +On the location bar of your browser, copy the authorisation token,\\ 
 +which is the part after %%http://freedns.afraid.org/dynamic/update.php?​%% url\\ 
 +and paste it in the password field. 
 + 
 +Option 2: FIXME ([[https://dev.openwrt.org/​ticket/​10192|Taken from here.]]) 
 +<​code>​ 
 +service_name delete ​/ --custom-- 
 +update_url [Your direct URL updater from your freedns.afraid.org account] 
 +domain [Your FQDN] 
 +username [NOT used. Set to a character of your choice, because LuCI does not accept empty field] 
 +password [NOT used because already part of direct URL. Set to a character of your choice, because LuCI does not accept empty field] 
 +</​code>​ 
 + 
 +==== gratisdns.dk ==== 
 +Last updated: 2015-07-20\\ 
 +[[http://​web.gratisdns.dk/|Homepage]] (Danish only)
  
-==== Installation ==== +Taken from [[https://​forum.openwrt.org/​viewtopic.php?​pid=281262|OpenWrt forum]]
-Install the ddns-scripts package.+
  
 +GratisDNS.dk is only supported by //​ddns-scripts//​ using custom service settings.\\
 +GratisDNS.dk require to [[#​ssl_support|install]] and configure SSL support.
 <​code>​ <​code>​
-opkg update +service_name delete / --custom-- 
-opkg install ​ddns-scripts+update_url http://​ssl.gratisdns.dk/​ddns.phtml?​u=[USERNAME]&​p=[PASSWORD]&​d=Mydomain&​h=[DOMAIN]&​i=[IP] 
 + !!! replace "​Mydomain"​ in this url with domain part of your FQDN. 
 + Sample: your FQDN: host.example.com ​-> "​Mydomain"​ set to example.com 
 + Sample: http://​ssl.gratisdns.dk/​ddns.phtml?​u=[USERNAME]&​p=[PASSWORD]&​d=example.com&​h=[DOMAIN]&​i=[IP] 
 +domain [Your FQDN] 
 +username [Your username] 
 +password [Your password]
 </​code>​ </​code>​
  
-If you like to configure ​<​code>​ddns-scripts</​code>​ + 
- using the LuCI WebUI also install this package:+==== he.net ==== 
 +Last updated: 2015-07-15\\ 
 +[[https://​dns.he.net/​|Homepage]] 
 + 
 +FIXME There is another [[doc:​howto:​ddns.client:​hurricaneelectricfreedns|description]] here. I take over the link during rewriting this wiki page. DELETEME 
 + 
 +Use the following settings: 
 +<​code>​ 
 +service_name he.net 
 +domain [Your FQDN] 
 +username [Your FQDN] 
 +password [Your password] 
 +</​code>​ 
 + 
 +==== mythic-beasts.com ==== 
 +Last updated: 2015-07-20\\ 
 +[[http://​mythic-beasts.com/​|Homepage]] -- [[https://​www.mythic-beasts.com/​support|Support]] 
 + 
 +FIXME\\ 
 +Looking on description at "​[[https://​www.mythic-beasts.com/​support/​domains/​dynamic/​openwrt|Use Mythic Beasts Dynamic DNS with your OpenWRT router]]"​ and on the existing source code I found out that there must be issues updating Dynamic DNS.\\ 
 +I have gone in contact with support of mythic-beasts.com. I will update as soon a solution is available.\\ 
 + 
 +==== namecheap.com ==== 
 +Last updated: 2015-07-21\\ 
 +[[https://​www.namecheap.com/​|Homepage]] -- [[https://​www.namecheap.com/​support/​knowledgebase.aspx|Knowledgebase]] 
 + 
 +Note that with the namecheap protocol, the username option is translated to the host argument in the update request.\\ 
 +Therefore, it should be the host-part on the DNS record, not the username that you use to log into the namecheap.com site.\\ 
 +To update multiple hosts you might need to define separate configuration/​section for each host.\\ 
 +To get your password, log into the namecheap.com site, enter the management console for the domain, and click the Dynamic DNS menu option.\\ 
 + 
 +:!: Currently //​ddns-scripts//​ only support configuration where defined FQDN using the same IP address as for your domain. Otherwise you will send updates to namecheap.com every "​option check_interval"​ 10 minutes (default) because your FQDN is not validated. 
 + 
 +Let assume you define two FQDN at your domain "​example.com":​ "​%%www.example.com%%"​ and "​%%ftp.example.com%%"​\\ 
 +To update only your domain record "​example.com":​ 
 +<​code>​ 
 +service_name namecheap.com 
 +domain [Your domain, here: example.com] 
 +username @ 
 +password [Your password] 
 +</​code>​ 
 +To update for example only your "​%%ftp.example.com%%"​ host: 
 +<​code>​ 
 +service_name namecheap.com 
 +domain [Your domain, here: example.com] 
 +username ftp 
 +password [Your password] 
 +</​code>​ 
 +To update all to the same IP address: 
 +<​code>​ 
 +service_name namecheap.com 
 +domain [Your domain, here: example.com] 
 +username @ -a www -a ftp 
 + !!! @ stands for your domain, www for www.example.com,​ ftp for ftp.example.com 
 +password [Your password] 
 +</​code>​ 
 + 
 +==== noip.com ==== 
 +Last updated: 2015-07-21\\ 
 +[[http://​www.noip.com/​|Homepage]] -- [[http://​www.noip.com/​support/​|SupportCenter]] 
 + 
 +:!: **Starting CC 15.05** do not forget to additional install //​ddns-scripts_no-ip_com//​ package. 
 + 
 +The default is to use your '''​username'''​ and '''​password'''​ as normal inside //​ddns-scripts//​ together with '''​service_name'​ '​no-ip.com'''​ or '''​noip.com'''​. 
 + 
 +If you want to update multiple hosts inside one configuration/​section you need the following settings: 
 +<​code>​ 
 +service_name delete / --custom-- 
 +update_url http://​[USERNAME]:​[PASSWORD]@dynupdate.no-ip.com/​nic/​update?​myip=[IP]&​hostname= 
 + 
 + !!! After the '​hostname='​ fill in a comma separated list of hosts to update. 
 + Sample: host1.example.com,​host2.example.com,​host3.example.com without any spaces in between. 
 + Sample: http://​[USERNAME]:​[PASSWORD]@dynupdate.no-ip.com/​nic/​update?​myip=[IP]&​hostname=host1.example.com,​host2.example.com,​host3.example.com 
 + 
 +domain [Only ONE of your defined hostnames, i.e. host1.example.com] 
 +username [Your username] 
 +password [Your password] 
 +</​code>​ 
 + 
 +==== spdns.de ==== 
 +Last updated: 2015-07-13\\ 
 +[[http://​spdns.de/​|Homepage]] -- [[http://​wiki.securepoint.de/​index.php/​SPDNS_FAQ|Wiki/​FAQ]] (German only) 
 + 
 +The default is to use your '''​username'''​ and '''​password'''​ as normal inside //ddns-scripts// together with '''​service_name'​ '​spdns.de'''​.\\ 
 +If you want to use Update-Token,​ keep in mind that this token can only update the host it is generated for.\\ 
 +Use this settings: 
 +<​code>​ 
 +service_name spdns.de 
 +domain [Your defined hostname at spdns.de] 
 +username [Your defined hostname at spdns.de] 
 +password [The token generated for this hostname] 
 +</​code>​ 
 +If you want to update multiple hosts inside one configuration/​section you need the following settings (Update-Token doesn'​t work): 
 +<​code>​ 
 +service_name delete / --custom-- 
 +update_url http://​[USERNAME]:​[PASSWORD]@update.spdns.de/​nic/​update?​myip=[IP]&​hostname= 
 + 
 + !!! After the '​hostname='​ fill in a comma separated list of hosts (max. 20) to update. 
 + Sample: host1.spdns.de,​host2.spdns.de,​host3.spdns.de without any spaces in between. 
 + Sample: http://​[USERNAME]:​[PASSWORD]@update.spdns.de/​nic/​update?​myip=[IP]&​hostname=host1.spdns.de,​host2.spdns.de,​host3.spdns.de 
 + 
 +domain [Only ONE of your defined hostnames i.e. host3.spdns.de] 
 +username [Your username at spdns.de] 
 +password [Your password at spdns.de] 
 +</​code>​ 
 +==== ... ==== 
 +{{:​meta:​icons:​tango:​48px-emblem-progress.svg.png?​nolink}} 
 +===== - ===== 
 +**===========================================================================================================** 
 + 
 +===== OLD WIKI TEXT ===== 
 + 
 +  * Tested with: 
 +    * OpenWrt Attitude Adjustment 12.09 
 +    * OpenWrt Barrier Breaker 14.07 
 +  * New Version (2.x) with IPv6 support and many other options availible since: 
 +    * Chaos Calmer 
 +===== Introduction ===== 
 + 
 +DDNS stands for [[https://​en.wikipedia.org/​wiki/​Dynamic_DNS|Dynamic DNS]]. Simply put, using this service gives a name to your ip. So if you're hosting something on your line, people wouldn'​t have to bother typing your IP. They can just type in your domain name! It also helps when your ip changes. Users won't need to discover what your new ip is, they can simply type your domain name.  
 + 
 +This guide will help you configure your ddns service, so that your router auto-updates your ip to your ddns. The simplest method possible would be through LuCI (the default webUI for openwrt). 
 + 
 +===== Requirements ===== 
 + 
 +First of all, you'll need to pick and register a DNS name with a compatible DDNS service. Note the DNS name, your service username and password for use below. 
 + 
 +Here is a list of suggested DDNS providers. 
 + 
 +  * http://​freedns.afraid.org :!: free - but currently a [[https://​dev.openwrt.org/​ticket/​10192|workaround]] is needed - FIXME 
 +  * http://​noip.com :!: free but requires annoying account confirmation every 30 days - FIXME 
 +  * http://​changeip.com :!: free 
 +  * http://​duckdns.org :!: free - generated config on site, or see the updated, [[doc:​howto:​ddns.client:​duckdns|sample config]] here. 
 +  * http://​system-ns.com :!: free 
 +  * https://​dns.he.net/​ :!: free - if you have your own domain name, [[doc/​howto/​ddns.client/​hurricaneelectricfreedns]]. 
 +  * http://​dnsdynamic.org ​ :!: free 
 +  * http://​zoneedit.com :!: non-free (dns update by https required, curl needed. See [[http://​wiki.openwrt.org/​doc/​howto/​ddns.client#​ssl_support|SSL support]].) 
 +  * http://​dyndns.org :!: non-free except if you donated in 1998-2001. 30-day free trial needs credit card number. 
 +  * http://​dyndns.fr :!: non-free 
 +  * Any other service that can update when some URL is accessed. ​ The script is quite versatile. 
 + 
 +A list of currently supported DDNS providers by ddns-scripts:​ 
 +  * **IPv4:** [[https://​github.com/​openwrt/​packages/​blob/​master/​net/​ddns-scripts/​files/​services|/​usr/​lib/​ddns/​services]] 
 +  * **IPv6:** [[https://​github.com/​openwrt/​packages/​blob/​master/​net/​ddns-scripts/​files/​services_ipv6|/​usr/​lib/​ddns/​services_ipv6]] - :!: needs ddns-scripts V 2.x 
 + 
 +For a longer list of additional DDNS providers, see: 
 + 
 +  * http://​www.dmoz.org/​Computers/​Internet/​Protocols/​DNS/​DNS_Providers/​Dynamic_DNS/​ 
 +  * http://​dnslookup.me/​dynamic-dns/​ 
 + 
 +===== Using LuCI ===== 
 + 
 +==== Step 1: Install the Packages ==== 
 + 
 +Login into your router through your browser. Go to Administration (top right) > System (top left) > Software > Update Package Lists 
 +Let it update, go back to Software. Find ''​luci-app-ddns''​ and install ​the package. 
 + 
 +Installing the package ''​luci-app-ddns''​ will automatically install the package ''​ddns-scripts'',​ which contains the scripts that actually update the dynamic DNS name (see below). 
 + 
 +After ''​luci-app-ddns''​ is installed, just press any other link on the Openwrt LuCI WebUI, and the page will refresh itself and Dynamic DNS will appear under Services > Dynamic DNS. If those tabs don't show up, run ''/​etc/​init.d/​uhttpd restart'',​ delete ''/​tmp/​luci-indexcache''​ or reboot the router. 
 + 
 +Beginning ddns-scripts Version 1.0.0-23 you need to enable ''​ddns''​ service in "​System"​-"​Startup"​ or run: ''/​etc/​init.d/​ddns enable''​ to enable updates being send on reboot and hotplug events. 
 + 
 +==== Step 2: Configuration ==== 
 + 
 +In LuCI, go to Services > Dynamic DNS. 
 + 
 +There is a default configuration called "​MYDDNS"​ ready to edited. 
 + 
 +^ Variable ^ Description ^ Example ^ 
 +| Enable | Self-explanatory | check this to enable this configuration | 
 +| Event interface | The DDNS scripts use the Linux hotplug events system. When this specified network interface comes up, a related ifup hotplug event will cause DDNS script to start to monitor (and update) the external IP address of . Select the WAN interface that will have the external IP address to use in the DDNS registration. | wan | 
 +| Service | Which DDNS online service do you use? Choose one | dyndns.org | 
 +| Hostname | The DNS name to update (this name must already be registered with the the DDNS service) | your.domain.name | 
 +| Username | Username of your DDNS service account | yourusername | 
 +| Password | Password of your DDNS service account. Ensure this password does **not** have "​$1"​ or $ with any number following in it, as this **breaks** the script. **For freedns.afraid.org,​ [[ddns.client#​Specific settings for freedns.afraid.org|read below]]**. | yourpassword | 
 +| Source of IP address | This tells the script how to determine your interface external IP address. See below for a description. | Usually "​network"​ | 
 +| Network/​Interface/​URL | This will be named based on the section of "​Source of IP address"​. Select the network, interface physical name, or type in the URL to use to determine the external IP address. | Usually "​wan"​ | 
 +| Check for changed IP every | Self Explanatory. Checks below 5 minutes make no sence because from testing, it takes this time until the global DNS servers be in sync | 10 | 
 +| Check-time unit | The unit for the value above | min | 
 +| Force update every | Even if the detected external IP address has not changed, update the DDNS name anyway after this time interval | 72 | 
 +| Force-time unit | Unit for the value above | h | 
 + 
 +Click "Save & Apply" to save changes. 
 + 
 +=== Specific settings for freedns.afraid.org === 
 +    * You must **NOT** set your account password in the "​password"​ field. On the contrary, go to http://​freedns.afraid.org/​dynamic/,​ login, click "​Direct URL". On the location bar of your browser, copy the the authorisation token, the part after http://​freedns.afraid.org/​dynamic/​update.php?​ url. and paste it in the password field. 
 +    * DO enter the host into the Hostname field. Although it is not used for the update, it //is// used to check the host's current IP address (via ''​nslookup''​). 
 + 
 +=== Further details === 
 +  * **A full list of supported settings (some not supported by LuCI WebUI) and their description you will find [[doc:​uci:​ddns|in UCI documentation]].** 
 +  * Source of IP address ("​ip_source"​ in the configuration file) 
 +    * The "​ip_source"​ option can be "​network",​ "​interface",​ "​script"​ or "​web",​ with "​network"​ as the default 
 +    * If "​ip_source"​ is "​network"​ you specify a network section in your /​etc/​network config file (e.g. "​wan",​ which is the default) with the "​ip_network"​ option. ​ If you specify "​wan",​ you will update with whatever the ip for your wan is. 
 +    * If "​ip_source"​ is "​interface"​ you specify a hardware interface (e.g. "​eth1"​) and whatever the current ip of this interface is will be associated with the domain when an update is performed. 
 +    * If "​ip_source"​ is "​script"​ you specify a script to obtain ip address. The "​ip_script"​ option should contain path to your script. This option is not available through the LuCI web interface. 
 +    * The last possibility is that "​ip_source"​ is "​web",​ which means that in order to obtain our ip address we will connect to a website (specified in the URL field), and use the first valid ip address listed on that page. Use this option if the OpenWrt device is behind a NAT device and does not have a real external IP address assigned to the WAN interface being monitored. The correct URL will depend on the DDNS service being used. Check with the service'​s documentation to determine if they offer this feature and, if so, what the correct URL is. 
 +      * For the DynDNS service, the URL is [[http://​checkip.dyndns.org]] 
 +      * Multiple URLs can be used by separating the entries with a space. 
 + 
 +==== Step 3: Start ddns-scripts ==== 
 + 
 +  * Normally, the DDNS scripts are automatically started through a hotplug event. The very first time they are configured, there is no ifup event to start them. 
 +  * The simplest option is to reboot the router. This will automatically start the scripts as part of the normal interface startup process. 
 +  * If a reboot should be avoided, the scripts can be started manually by generating a hotplug event from the command line (see below for details) 
 +  * Beginning ddns-scripts Version 1.0.0-23 you need to enable //​**ddns**//​ service in "​System"​-"​Startup"​ to enable updates being send on reboot and hotplug events. 
 +  * You can also start/​stop/​restart the service without reboot or generating a hotplug event. 
 + 
 +==== Step 4: You're done! ==== 
 + 
 +  * If the wan interface changes its address, the DDNS account is updated automatically. 
 +  * Additionally,​ an unconditional update is sent periodically. The interval is specified by the force update option. 
 + 
 +==== Additional DDNS registration entries ==== 
 + 
 +In LuCI, go to Services > Dynamic DNS. 
 + 
 +  * Use the text entry box and "​Add"​ button to add additional DDNS configurations 
 +    * Do not use a - character in the DDNS configuration name 
 + 
 +===== Using ddns-scripts directly ===== 
 + 
 +The ddns-scripts ​package ​can be installed and used on its own without luci-app-ddns. No web GUI will be available in this case. This section describes how to use the command line to use ddns-script directly. 
 + 
 +==== Step 1Installation ==== 
 +Install the ''​ddns-scripts''​ package.
  
 <​code>​ <​code>​
 opkg update opkg update
-opkg install ​luci-app-ddns+opkg install ​ddns-scripts
 </​code>​ </​code>​
  
-==== Configuration ==== +==== Step 2: Configuration ==== 
-The configuration is stored in **/​etc/​config/​ddns** which contains more thorough documentation.+The configuration is stored in ''​/​etc/​config/​ddns'' ​which contains more thorough documentation.
  
-In order to enable Dynamic DNS you need at least one section, and in that section the "enabled" option ​must be set to one.+In order to enable Dynamic DNS you need at least one section, and in that section the ''​enabled''​ variable ​must be set to ''"​1"''​.
  
 Each section represents an update to a different service. ​ This sections specifies several things: Each section represents an update to a different service. ​ This sections specifies several things:
  
   * service (dyndns.org,​ etc.)   * service (dyndns.org,​ etc.)
-  * domain (set this to all.dnsomatic.com for DNS-o-Matic)+  * domain (set this to your registered hostname/​FQDN you want to update)
   * username   * username
   * password (sometimes it is the api token, not your login password)   * password (sometimes it is the api token, not your login password)
-  * IP source ​(wan, eth0, web) +  * ip_source ​(wan, eth0, web) 
-Optionally, ​thse following may be specified:+ 
 +Optionally, ​the following may be specified:
  
-  * option ​update_url (needed if the service isn't supported by /​usr/​lib/​ddns/​services)+  * update_url (needed if the service isn't supported by /​usr/​lib/​ddns/​services)
   * check_interval   * check_interval
   * force_interval   * force_interval
-Use the "check_interval" ​to specify how often to check whether an update is necessary, and the "force_interval" option ​to specify how often to force an update. ​ Specify the units for these values with the "check_unit" ​and the "force_unit" options.  Units can be "​days",​ "​hours",​ "​minutes"​ or "​seconds"​. ​ The default ​force_unit ​is hours and the default check_unit is seconds.  The default ​check_interval ​is 600 seconds, or ten minutes. ​ The default force_interval is 72 hours or 3 days.+ 
 +Use the ''​check_interval''​ variable ​to specify how often to check whether an update is necessary, and the ''​force_interval''​ variable ​to specify how often to force an update. ​ Specify the units for these values with the ''​check_unit'' ​and ''​force_unit''​ variables.  Units can be ''​"​days"​''​''​"​hours"​''​''​"​minutes"​'' ​or ''​"​seconds"​''​. The default ​value for ''​check_interval'' ​is ''"​600"'', ​and the default ​value for ''​check_unit'' ​is ''"​seconds"''​ (''​check_interval''​ = 10 minutes). The default ​value for ''​force_interval'' ​is ''"​72"'',​ and the default value for ''​force_unit''​ is ''"​hours"''​ (''​force_interval''​ = 72 hours). 
 + 
 +=== Default configuration === 
 + 
 +This is the default configuration in /​etc/​config/​ddns as of OpenWrt Attitude Adjustment 12.09.
  
 <​code>​ <​code>​
 config service "​myddns"​ config service "​myddns"​
         option enabled ​         "​0"​         option enabled ​         "​0"​
 +        option interface ​       "​wan"​
 +
         option service_name ​    "​dyndns.org"​         option service_name ​    "​dyndns.org"​
         option domain ​          "​mypersonaldomain.dyndns.org"​         option domain ​          "​mypersonaldomain.dyndns.org"​
         option username ​        "​myusername"​         option username ​        "​myusername"​
         option password ​        "​mypassword"​         option password ​        "​mypassword"​
-        option ip_source ​       "​network"​ +
-        option ip_network ​      "​wan"​+
         option force_interval ​  "​72"​         option force_interval ​  "​72"​
         option force_unit ​      "​hours"​         option force_unit ​      "​hours"​
         option check_interval ​  "​10"​         option check_interval ​  "​10"​
         option check_unit ​      "​minutes"​         option check_unit ​      "​minutes"​
 +        option retry_interval ​  "​60"​
 +        option retry_unit ​      "​seconds"​
 +
 +        #option ip_source ​      "​network"​
 +        #option ip_network ​     "​wan"​
 +
         #option ip_source ​      "​interface"​         #option ip_source ​      "​interface"​
         #option ip_interface ​   "​eth0.1"​         #option ip_interface ​   "​eth0.1"​
-        ​#option ip_source ​      "​web+ 
-        #option ip_url ​         "​http://​ipv4.wtfismyip.com/text"+        ​#option ip_source ​      "​script
 +        #option ip_script ​      "​path to your script"​ 
 + 
 +        option ip_source ​       "​web"​ 
 +        ​option ip_url ​          ​"​http://​checkip.dyndns.com/" 
         #option update_url ​     "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​hostname=[DOMAIN]&​myip=[IP]"​         #option update_url ​     "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​hostname=[DOMAIN]&​myip=[IP]"​
-        #option use_https ​      "​1"​ 
-        #option cacert ​         "/​etc/​ssl/​certs/​cacert.pem"​ 
 </​code>​ </​code>​
 +
 +=== Configuration using the uci program ===
  
 A short example for a **dyndns.org** service to configure via UCI CLI: A short example for a **dyndns.org** service to configure via UCI CLI:
Line 135: Line 1026:
 root@OpenWrt:​~#​ uci set ddns.myddns.enabled=1 root@OpenWrt:​~#​ uci set ddns.myddns.enabled=1
 root@OpenWrt:​~#​ uci commit ddns root@OpenWrt:​~#​ uci commit ddns
-root@OpenWrt:​~#​ ACTION=ifup INTERFACE=wan /​sbin/​hotplug-call iface 
 </​code>​ </​code>​
  
 +=== Configuration for namecheap.com ===
 +
 +An example for a **namecheap.com** domain with an A-record with name '​@'​.
  
-An example for **noip.com** service that updates via pinging web url: 
 <​code>​ <​code>​
-config ​'service' ​'​myddns'​ +config service '​myddns'​ 
- option '​interface' ​'​wan'​ +        option ​enabled ​'1' 
- option ​'force_interval' ​'​72'​ +        option ​interface '​wan'​ 
- option ​'force_unit' ​'​hours'​ +        option force_interval '​72'​ 
- option ​'check_interval' ​'​10'​ +        option force_unit '​hours'​ 
- option ​'check_unit' ​'​minutes'​ +        option check_interval '​10'​ 
- option 'enabled' '1+        option check_unit '​minutes'​ 
- option ​'service_name' ​'no-ip.com'​ +        option ​retry_interval ​'60' 
- option '​username' ​'​YOUR-USERNAME+        option retry_unit ​'seconds
- option ​'password' ​'YOUR-PASSWORD+        option service_name 'namecheap.com'​ 
- option ​'ip_source'​ 'web+        option ​domain ​'yourdomain.info'​ 
- option 'ip_url' 'http://[USERNAME]:​[PASSWORD]@dynupdate.no-ip.com/nic/update?​hostname=[DOMAIN]&​myip=[IP]'​ +        option ​username '@
- option '​domain'​ '​YOUR-DOMAIN.no-ip.org'+        option password 'xxxxxxx-your-token-xxxx-xxxxxxxxxxxx
 +        option ip_source 'network' 
 +        option ip_network 'wan
 +        #option ​use_https ​'1' 
 +        #option cacert ​'/etc/ssl/certs/cacert.pem'
 </​code>​ </​code>​
  
-==== Trying it out ==== +Note that with the namecheap protocol, the ''​username''​ option is translated to the ''​host''​ argument in the update request. ​ Therefore, it should be the hostname on the DNS record, **not** the username that you use to log into the namecheap.com site.  In this example, the script will update the '​@'​ (full domain) DNS A-record. ​ To update a subdomain A-record, enter the name of the subdomain instead. ​ To get your password, log into the namecheap.com site, enter the management console for the domain, and click the ''​Dynamic DNS''​ menu option. ​  
-The script ​runs when hotplug ​events ​happen ​or a monitored IP address changes, so initially, you have to start it manually. ​ After setting "​enabled"​ to 1, run the following:+ 
 +Make a record for each subdomain. ​ Using Luci, enter a label for the subdomain into the Add field (near lower left of page)and click the (+), or hand edit the /​etc/​config/​ddns file and add a new stanza. ​  
 + 
 +Example /​etc/​config/​ddns records to update two subdomains at namecheap:​ 
 +<​code>​ 
 +config service '​myddns'​ 
 +        option interface '​wan'​ 
 +        option force_unit '​hours'​ 
 +        option check_interval '​20'​ 
 +        option check_unit '​minutes'​ 
 +        option retry_interval '​60'​ 
 +        option retry_unit '​seconds'​ 
 +        option password '​YourNamecheapDDNSpassword'​ 
 +        option enabled '​1'​ 
 +        option ip_source '​interface'​ 
 +        option ip_interface '​pppoe-wan'​ 
 +        option service_name '​namecheap.com'​ 
 +        option force_interval '​72'​ 
 +        option domain '​Your.Domain'​ 
 +        option username '​www'​ 
 + 
 +config service '​mail'​ 
 +        option interface '​wan'​ 
 +        option force_unit '​hours'​ 
 +        option check_interval '​20'​ 
 +        option check_unit '​minutes'​ 
 +        option retry_interval '​60'​ 
 +        option retry_unit '​seconds'​ 
 +        option password '​YourNamecheapDDNSpassword'​ 
 +        option enabled '​1'​ 
 +        option ip_source '​interface'​ 
 +        option ip_interface '​pppoe-wan'​ 
 +        option service_name '​namecheap.com'​ 
 +        option force_interval '​24'​ 
 +        option domain '​Your.Domain'​ 
 +        option username '​mail'​ 
 + 
 +</​code>​ 
 + 
 +You can hand test the records for '​www'​ and '​mail',​ labeled '​myddns'​ and '​mail'​ with: 
 +<​code>​ 
 +/​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns 
 +/​usr/​lib/​ddns/​dynamic_dns_updater.sh mail 
 +</​code>​ 
 + 
 +Look at the return XML and see that the Error Count is 0 to validate a successful update. Check each record, one at a time. Use <​Ctrl-C>​ to kill the test daemons. 
 + 
 +Example for the LUCI form : 
 +<​code>​ 
 +Enable ​<​checked>​ 
 +Hostname ​'​example.com'​ 
 +username ​'​www'​ 
 +password = '​xxx-your-specific-ddns-pass-xx'​ 
 +Source of IP address = '​URL'​ 
 +URL = '​http://​dynamicdns.park-your-domain.com/​update?'​ 
 +</​code>​ 
 + 
 +===== Manually starting ddns-scripts ​===== 
 + 
 +The ddns-scripts monitoring ​script ​starts ​when hotplug ​ifup event happens. This will happen ​automatically at system startup when the named interface comes up. The simplest way to start ddns-scripts is to reboot, but to avoid a reboot, ​it can be started ​manually ​from the command line.  After setting "​enabled"​ to 1 and configuring other settings as abovemanually generate an ifup hotplug event for the desired interface. 
 + 
 +  * This will case the the hotplug script /​etc/​hotplug.d/​25-ddns to run 
 +    * For INTERFACE, type the specified ddns-scripts interface name (the interface name from ''/​etc/​config/​network'',​ usually '​wan'​) 
 + 
 +<​code>​ 
 +root@OpenWrt:~# ACTION=ifup INTERFACE=wan /​sbin/​hotplug-call iface 
 +</​code>​ 
 + 
 +  * As an alternative,​ ddns-scripts can be called at a lower level 
 +    * type the specified ddns-scripts interface name (the interface name from ''/​etc/​config/​network'',​ usually '​wan'​)
  
 <​code>​ <​code>​
Line 165: Line 1130:
 exit exit
 </​code>​ </​code>​
-,where "​wan"​ is the name of the interface from ''/​etc/​config/​ddns'',​ which also has to match an interface from ''/​etc/​config/​network''​. At this point you can verify that the dynamic DNS updater service is running by calling '# ps' from the command line and looking for '/​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns 0' process. ​ 
  
-You can also simulate a hotplug event to trigger a DDNS update manually:+  * Beginning ddns-scripts Version 1.0.0-23 
 +    * simply enable/​disable start/​stop/​restart like every other service
  
 <​code>​ <​code>​
-root@OpenWrt:​~# ​ACTION=ifup INTERFACE=wan ​/sbin/hotplug-call iface +root@OpenWrt:​~#​ /etc/init.d/ddns enable 
-</​code>​where '​wan'​ is the interface name from ''/​etc/config/network''​.+root@OpenWrt:​~#​ /​etc/​init.d/​ddns start 
 +</​code>​ 
 + 
 +===== Verification ===== 
 + 
 +  * Verify ​the ddns-scripts ​interface ​monitor script is running 
 +  * One instance of this script should be running for each ddns-scripts configuration defined 
 + 
 +<​code>​ 
 +ps | grep dynamic_dns_updater.sh 
 +</​code>​ 
 + 
 +  * Verify the correct IP address by pinging the dynamic DNS name 
 + 
 +===== Alerting ===== 
 + 
 +  * ddns-scripts does not send any alerts when it detects or updates the DDNS IP address 
 +  * Marius Gedminas posted a two-line patch to ddns-scripts available at [[http://​patchwork.openwrt.org/​patch/​1072/​]]. This change adds syslog output when an IP change is detected. It can be manually added to /​usr/​lib/​ddns/​dynamic_dns_updater.sh. 
 +    * For ddns-scripts ver. 1.0.0-21 (the version OpenWrt Attitude Adjustment 12.09), the line numbers to look for are after original lines 294 and 325 
 +    * If OpenWrt is configured to send syslog output to a remote syslog server (see [[doc/​howto/​log.overview]]),​ that server can be configured to perform various alerting actions 
 +  * For Barrier Breaker: Since Marius Gedminas's post isn't available anymore at the link above, here is an alternative solution: 
 +    * open file /usr/lib/​ddns/​dynamic_dns_functions.sh for editing 
 +    * insert a new if condition into verbose_echo() function 
 +    * if [ -n "​$ddns_logfile"​ ]; then 
 +    *      echo $1 >> $ddns_logfile 
 +    * fi 
 +    * modify the ddns config ​file via UCI: 
 +    * uci set ddns.myddns.ddns_logfile=/var/​log/​ddns.log 
 +    * uci commit ddns 
 +    * /​etc/​init.d/​ddns restart 
 +  * For Chaos Calmer: ddns has been completely rewritten, now it supports loggig: 
 +    * the logdir variable can be specified in global section of config file, the default value is /​var/​log/​ddns/​ 
 + 
 +===== Debugging =====
  
-==== Debugging ==== +If something goes wrong, you can see a log of activity ​by calling
-If something goes wrong, you can see what is happenning ​by calling+
 <​code>​ <​code>​
 /​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns /​usr/​lib/​ddns/​dynamic_dns_updater.sh myddns
Line 190: Line 1187:
 </​code>​ </​code>​
  
-==== Tweaks ​====+===== Provider specifics =====
  
-Full API documentation available herehttps://www.dyndns.com/developers/specs/syntax.html+==== duckdns.org ==== 
 +Inside LuCI web UI select **--custom--** and fill in the other options accordingly\\ 
 +:!Be sure to install the ssl certificates in /etc/ssl/​certs/​ca-bundle.pem as stated in the instructions for openwrt on https://duckdns.org/install.jsp \\ 
 +If duckdns'​ instructions still say download ca-bundle.crt,​ replace '​crt'​ with '​pem'​. ca-bundle.crt doesn'​t exist.\\ 
 +Additional use update_url and settings from below because otherwise updates fails.\\ 
 +Last tested: 2015-03-16
  
 +<​code>​
 +# option service_name ​ ''​
 +option update_url ​   '​http://​www.duckdns.org/​update?​domains=[USERNAME]&​token=[PASSWORD]&​ip=[IP]'​
 +option domain ​       '[Your FQDN]'
 +option username ​     '[Your Host without "​.duckdns.org"​]'​
 +option password ​     '[Your token]'​
 +option use_https ​    '​1'​
 +option cacert ​       '/​etc/​ssl/​certs/​cacert.pem'​
 +</​code>​
 +
 +==== other ====
 To enable wildcard domains (*.foo.dyndns.org) on dyndns.org, replace the line in ''/​usr/​lib/​ddns/​services''​ with:<​code>​ To enable wildcard domains (*.foo.dyndns.org) on dyndns.org, replace the line in ''/​usr/​lib/​ddns/​services''​ with:<​code>​
 "​dyndns.org" ​           "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​wildcard=ON&​hostname=[DOMAIN]&​myip=[IP]"​ "​dyndns.org" ​           "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​wildcard=ON&​hostname=[DOMAIN]&​myip=[IP]"​
Line 201: Line 1214:
  ​with:<​code>​  ​with:<​code>​
 "​dyndns.org" ​           "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​wildcard=NOCHG&​hostname=[DOMAIN]&​myip=[IP]"​ "​dyndns.org" ​           "​http://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​wildcard=NOCHG&​hostname=[DOMAIN]&​myip=[IP]"​
 +</​code>​
 +
 +To add dyndns protocol compatible services like dyndns.fr, add a line in ''/​usr/​lib/​ddns/​services''​
 + ​with:<​code>​
 +"​dyndns.fr" ​           "​http://​[DOMAIN]:​[PASSWORD]@dyndns.dyndns.fr/​update.php?​hostname=[DOMAIN]&​myip=[IP]"​
 +</​code>​
 +
 +To add dyndns protocol compatible services like dyndnspro.com,​ add a line in ''/​usr/​lib/​ddns/​services''​
 + ​with:<​code>​
 +"​dyndnspro.com" ​           "​http://​[DOMAIN]:​[PASSWORD]@dyndns.dyndnspro.com/​update.php?​hostname=[DOMAIN]&​myip=[IP]"​
 +</​code>​
 +
 +To add dyndns protocol compatible services like dynamicdomain.net,​ add a line in ''/​usr/​lib/​ddns/​services''​
 + ​with:<​code>​
 +"​dynamicdomain.net" ​           "​http://​[DOMAIN]:​[PASSWORD]@dyndns.dynamicdomain.net/​update.php?​hostname=[DOMAIN]&​myip=[IP]"​
 </​code>​ </​code>​
  
Line 207: Line 1235:
 "​dyndns.it" ​           "​http://​[USERNAME]:​[PASSWORD]@dyndns.it/​nic/​update?​hostname=[DOMAIN]&​myip=[IP]"​ "​dyndns.it" ​           "​http://​[USERNAME]:​[PASSWORD]@dyndns.it/​nic/​update?​hostname=[DOMAIN]&​myip=[IP]"​
 </​code>​ </​code>​
 +
  
 To add dyndns protocol compatible services like no-ip.com, add a line in ''/​usr/​lib/​ddns/​services''​ To add dyndns protocol compatible services like no-ip.com, add a line in ''/​usr/​lib/​ddns/​services''​
Line 213: Line 1242:
 </​code>​ </​code>​
  
 +To add dyndns protocol compatible services like system-ns.com,​ add a line in ''/​usr/​lib/​ddns/​services''​
 + ​with:<​code>​
 +"​system-ns.com" ​         "​http://​system-ns.com/​api?​type=dynamic&​domain=[DOMAIN]&​command=set&​token=[PASSWORD]&​ip=[IP]"​
 +</​code>​
  
-==== SSL support ====+To add dyndns protocol compatible services like two-dns.de, add a line in ''/​usr/​lib/​ddns/​services''​ 
 + ​with:<​code>​ 
 +"​two-DNS" ​         "​http://​[USERNAME]:​[PASSWORD]@update.twodns.de/​update?​hostname=[DOMAIN]&​ip=[IP]"​ 
 +# with https Support 
 +"​two-DNS_https" ​         "​https://​[USERNAME]:​[PASSWORD]@update.twodns.de/​update?​hostname=[DOMAIN]&​ip=[IP]"​ 
 +# needs: 
 +# option use_https ​       1 
 +# option cacert ​          /​etc/​ssl/​certs/​Example_CA.pem 
 +# and install curl 
 +# as shown below 
 +</​code>​
  
-By default ''​ddns-scripts''​ uses the wget program for DNS updates. Busybox provides its own version of ''​wget'',​ which does not support SSL. In order to use SSL (https) for updating the DNS info, you can either follow the instructions at [[wget-ssl-certs|SSL and Certificates in wget]] or install ''​curl''​ and see the correct way below. You will need to add the appropriate root certificate for your ddns provider. 
  
-===Adding ddns ssl services=== 
-Edit ''/​usr/​lib/​ddns/​services''​ and add "​dnydns.org (SSL)" 
-<code bash># DDNS supporting HTTPS connections requires wget or curl with SSL/HTTPS support 
-"​dyndns.org (SSL)" ​     "​https://​[USERNAME]:​[PASSWORD]@members.dyndns.org/​nic/​update?​hostname=[DOMAIN]&​myip=[IP]"</​code>​ 
-At this point you may use either either The Correct Method using curl or Using Wget.  
  
-===The correct way=== +===== SSL support ===== 
-Install curl and add the following to /​etc/​config/​ddns (replace cacert path to the correct one, either a file or a directory):+ 
 +By default ''​ddns-scripts''​ uses BusyBox buildin ''​wget''​ for DNS updates over http, it does not support https (SSL). \\  
 +To perform DNS updates over https (SSL), you will need to install the ''​wget''​ or ''​curl''​ package, and add the appropriate root certificate for your ddns provider. \\ 
 +If both //''​wget''//​ and //''​curl''//​ packages are installed, ddns-scripts will use //''​wget''//​ for communication. 
 +You can either follow the instructions at [[wget-ssl-certs|SSL and Certificates in wget]] or install ''​curl''​ and see the correct way below. \\ \\ 
 +:!: since Barrier Breaker 14.07 you can simplify installation using: 
 +  * //''​wget''//​ - Version >= 1.16-1 **OR**  
 +  * //''​curl''//​ - Version >= 7.38.0-1 **AND**  
 +  * //''​ca-certificates''//​ - Version >= 20141019 
 +packages. Inside DDNS configuration you need (LuCI accordingly):​ \\ 
 +<​code>​ 
 +option use_https '​1'​ 
 +option cacert ​   '/​etc/​ssl/​certs'​ 
 +</​code>​ 
 + 
 + 
 +====The correct way using curl ==== 
 +(  :!: This curl section didn't work for me, I've created a description of what worked for me here:​[[https://​forum.openwrt.org/​viewtopic.php?​id=55599|Setup DDNS with GratisDNS]]) 
 + 
 +There is no need to modify ''/​usr/​lib/​ddns/​services''​. Automatic change of URI scheme from ''​http''​ to ''​https''​ is controlled by the ''​use_https''​ variable. ​Install ​''​curl'' ​and add the following to ''​/​etc/​config/​ddns'' ​(replace ​''​cacert'' ​path to the correct one, either a file or a directory):
  
 <​code>​ <​code>​
Line 231: Line 1287:
 option cacert ​          /​etc/​ssl/​certs/​Example_CA.pem option cacert ​          /​etc/​ssl/​certs/​Example_CA.pem
 </​code>​ </​code>​
-Note that you need to download a Certificate Authority bundle as curl's pre-packaged bundle is out of date. Curl does maintain a current CA bundle here: http://​curl.haxx.se/​ca/ ​+Note that you need to download a Certificate Authority bundle as curl's pre-packaged bundle is out of date. Curl does maintain a current CA bundle here: http://​curl.haxx.se/​ca/​ 
 + 
 +Use the following commands to download the Curl CA bundle: 
 + 
 +<​code>​ 
 +root@OpenWrt:​~#​ mkdir -p /​etc/​ssl/​certs/​ 
 +root@OpenWrt:​~#​ wget -P /​etc/​ssl/​certs/​ http://​curl.haxx.se/​ca/​cacert.pem 
 +</​code>​
  
 ===Curl SSLv2,3 Support=== ===Curl SSLv2,3 Support===
 If your DDNS provider is using SSLv2 or SSLv3 Curl will throw error code 35 because it can't connect unless you specify the correct SSL version. If your DDNS provider is using SSLv2 or SSLv3 Curl will throw error code 35 because it can't connect unless you specify the correct SSL version.
-To fix this, you must modify /​usr/​lib/​ddns/​dynamic_dns_updater.sh as such:+To fix this, you must modify ​''​/​usr/​lib/​ddns/​dynamic_dns_updater.sh'' ​as such:
  
 For SSLv2 replace --sslv3 with --sslv2 For SSLv2 replace --sslv3 with --sslv2
Line 259: Line 1322:
 </​code>​ </​code>​
  
-===Using wget===+If your ddns provider uses a self-signed certificate,​ or if the certificate issuer is not listed in the curl CA bundle, ''​curl''​ will throw error code 60 and not open a connection to the ddns provider. To fix this, demand your ddns provider to send you the right certificate.  
 + 
 +If you don't care, you can break curl to accept any certificate by editing ''/​usr/​lib/​ddns/​dynamic_dns_updater.sh''​. 
 + 
 +**Warning:​** This allows ''​curl''​ to connect to https sites without SSL certificates. Only do this if no other options are available, and if you ultimately trust your ddns provider and everyone else on the internet (DONT DO IT, YOU BREAK CURL and could use http without ssl just the same. COMMENT: This section on breaking curl should be deleted, it is not good advice. I edited it instead of deleting it because I just registered and don't dare to correct/​delete too much at once. Please also note the last sentence below the instructions on what breaking curl's ssl support means.) 
 + 
 +Find this string of code: 
 +<​code>​ 
 +retrieve_prog="​${retrieve_prog}--cacert $cacert " 
 +</​code>​ 
 + 
 +Replace it with the following:​ 
 +<​code>​ 
 +retrieve_prog="​${retrieve_prog}-k " 
 +</​code>​ 
 + 
 +Find this string of code: 
 +<​code>​ 
 +retrieve_prog="​${retrieve_prog}--capath $cacert " 
 +</​code>​ 
 + 
 +Replace it with the following:​ 
 +<​code>​ 
 +retrieve_prog="​${retrieve_prog}-k " 
 +</​code>​ 
 + 
 +Curl's https support is now broken and you can send your password to everyone claiming to be your ddns provider. This will also affect all other https communications from your router that use curl aside from ddns. 
 + 
 +====Using wget====
 If you want to stick to wget, then you should set SSL_CERT_DIR variable in ''/​usr/​lib/​ddns/​dynamic_dns_functions.sh''​ before calling ''/​usr/​lib/​ddns/​dynamic_dns_updater.sh''​ because ''/​etc/​profile''​ is not sourced in daemon mode.  If you want to stick to wget, then you should set SSL_CERT_DIR variable in ''/​usr/​lib/​ddns/​dynamic_dns_functions.sh''​ before calling ''/​usr/​lib/​ddns/​dynamic_dns_updater.sh''​ because ''/​etc/​profile''​ is not sourced in daemon mode. 
  
-===Self-Signed ​certificates===+=== Using wget with self-signed SSL certificates===
 //Note: this is also a workaround for the wget ssl bug mentioned on [[wget-ssl-certs#​A.Caveat|SSL and Certificates in wget#A Caveat]]// //Note: this is also a workaround for the wget ssl bug mentioned on [[wget-ssl-certs#​A.Caveat|SSL and Certificates in wget#A Caveat]]//
  
Line 276: Line 1367:
 retrieve_prog="/​usr/​bin/​curl";​ retrieve_prog="/​usr/​bin/​curl";​
 </​code>​ </​code>​
- 
  
 ===== Using webif ===== ===== Using webif =====
Line 298: Line 1388:
   * [[http://​forum.openwrt.org/​viewtopic.php?​id=14040|exobyte'​s Kamikaze dyndns.org script (based of JimWright'​s)]]   * [[http://​forum.openwrt.org/​viewtopic.php?​id=14040|exobyte'​s Kamikaze dyndns.org script (based of JimWright'​s)]]
   * run nsupdate from /​etc/​udhcpc.user to update an authoritative master configured for DDNS.   * run nsupdate from /​etc/​udhcpc.user to update an authoritative master configured for DDNS.
- 
doc/howto/ddns.client.1366664819.txt.bz2 · Last modified: 2013/04/22 23:06 by valentt