OpenWrt Forum Archive

Topic: ddns-scripts: asking for feedback

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,
I want continue to optimize ddns-scripts. I'm asking here for feedback for ddns-scripts 2.x available since CC.
I also want to update the WIKI at http://wiki.openwrt.org/doc/howto/ddns.client.
There are written some specials for various providers. Most of them should be fixes or no longer necessary in ddns-scripts 2.x.

Are all the offered services in /usr/lib/ddns/services working with the given url's or are there updates needed.
Are the scripts for CloudFlare.com, No-IP.com and nsupdate working without problems ?
Are the providers also supporting IPv6 address updates ? so they can be added to the /usr/lib/ddns/services_ipv6 file.
.....

So please give me feedback if something does not work as expected.
Christian

I can conform Namecheap and No-IP.com work without problems (but i'm on IPv4 only so no clue about IPv6).

However, since e.g. Namecheap requires @ as its 'username', and i'm sure other services have their own peculiarities, it might be useful to provide some sample configurations in the wiki (and maybe refer to it in the LuCI frontend and the ddns config file)?

I'm willing to help update the wiki page.

(Last edited by Borromini on 24 Jun 2015, 21:48)

Thanks for feedback, but I'm confused why namecheap.com is working:

following link
https://www.namecheap.com/support/knowl … wrt-router

    Username: yourdomain.com
    Password: Dynamic DNS password for your domain (Manage Domains > click on the domain > Dynamic DNS)
    Hostname: Your sub-domain (@ for yourdomain.com, www for www.yourdomain.com, etc.)

the update url should look like (no IP transfered to namecheap ?)
https://dynamicdns.park-your-domain.com/update?domain=[USERNAME]&password=[PASSWORD]&host=[NO COMPLEMENT IN DDNS-SCRIPTS]

following link
https://www.namecheap.com/support/knowl … e-hosts-ip

the update url should look like
https://dynamicdns.park-your-domain.com/update?host=[DOMAIN]&domain=[USERNAME]&password=[PASSWORD]&ip=[IP]

inside /usr/lib/ddns/services the url is
http(s)://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]

from ddns-scripts
[USERNAME] taken from option username (url encoded)
[PASSWORD] taken from option password (url encoded)
[DOMAIN] taken from option domain (this is checked via nslookup to get current ip from internet) FQDN to update

what is the correct url ?
I found nothing that the an @ is needed for username only for Hostname (see above)

Could you please clarify ?
Thanks
Christian

Christian, this is how the Namecheap snippet looks (the hash has been altered):

config service 'Namecheap'
    option ip_source 'network'
    option ip_network 'wan'
    option interface 'wan'
    option check_interval '10'
    option check_unit 'minutes'
    option force_interval '72'
    option force_unit 'hours'
    option enabled '1'
    option use_syslog '2'
    option use_logfile '1'
    option service_name 'namecheap.com'
    option domain 'mydomain.com'
    option username '@'
    option password '1af5c0c74f4a4bb4bda16e0ffa96bc77'

I based the config off old wiki entry's info on Namecheap to cobble the config together. It also contains explanations on what the @ represents. For the hash, Namecheap has a knowledgebase entry on how to obtain it.

Christian, a question - does enabling HTTPS merely encrypt the IP checks? Or the whole update process?

@Borromini
HTTPS is used by wget or curl to send the update to the ddns provider. Here your username and password is used.
If ddns-scripts check the net if update has happen the commands nslookup or BIND host are used. They do not support security (for what if you request your IP via DNS). If you want to secure your DNS requests you should secure dnsmasq package.
If ddns-scripts try to detect your local IP via web it's also not secured. Simply calling http://checkip.dyndns.com or what ever you configured.

A bit late to the party here but I can confirm that it wont work a subdomain on namecheap.

Namecheap uses the following URL pattern.
https://dynamicdns.park-your-domain.com/update?host=[host_name]&domain=[domain.com]&password=[domain_password]&ip=[your_ip]

https://www.namecheap.com/support/knowl … e-hosts-ip

You can cobble together something that will work for a level 2 domain (example.com) but the problem is when you try and use a subdomain such as (awesome.example.com). The script wont know where to look to check if a url needs updating as the full domain is split between parent and host.

Using 15.05 and attempting to configure via the luci-ddns config panel.

I noticed a weird problem with ddns-scripts 2.4.3-1 under CC 15.05 (the release version). While the initial update of the IP seems to be correct after a while it keeps sending an old IP to the no-ip provider.

Let me give you an example:
The interface I set in the config as the source for the IP has IP A. Starting the ddns daemon will send this IP to the ddns provider and wait for an hour (my check interval). If in the meantime the IP changed to B it will still think the old IP A is the current one and not update the IP of the ddns provider. According to the log it would still detect the same IP A for the interface despite the interface page in LuCI or ifconfig reporting a different IP B. When I would use another computer to update the IP of the ddns provider (say using ddclient), the script would detect the IP on the ddns service differs from the one it THINKS is the public IP on the next check and overwrites it with the old IP A again too.
According to the log nothing was done during the time the IP of the interface changed. Shouldn't there be an ifdown/ifup event to be detected? I am aware this could be an issue in other parts of OpenWRT, but the resending of the old IP is odd still.

I then stopped the ddns daemon and started it manually as described in the wiki. Then it seems to send the correct CURRENT IP to the service. However I assume once the interface would change IP it would suffer from the same issue again.

If you need further info to debug, please let me know.

Another thing I noticed that happens but is unnecessary, is that the script seems to send a dummy IP to no-ip even if the registered and current IP differ. I understand the role of the dummy IP for no-ip.com but in this case it would be sufficient to skip this step and simply send the new IP to the service.

How did you detect your local ip (option ip_source) ?
please try a different method, i.e. ip_url
Christian

option ip_source 'network'

I haven't tried your suggestion but I guess it will help. Regardless I think the other behavior is some kind of odd bug, no?

(Last edited by SCF on 17 Sep 2015, 11:17)

I also ran afoul of the Namecheap subdomain issue.

If you have only one subdomain to update with Namecheap, such as the FQDN of your router, you can simply edit /usr/lib/ddns/services and replace [DOMAIN] with the domain name to pass in the namecheap.com service definition.

Then, edit /etc/config/ddns and update the domain option to pass the FQDN--which is what the script expects.

Restart the DDNS service (/etc/init.d/ddns restart) to make the change take effect.

@BambooVsCacti
As you discribe this works fine.

The documented way is to use Service "--custom--" and copy the modified URL to the "Custom URL" shown in LuCI UI, if you select "Custom Service".
All files inside /usr/lib/ddns Directory including "Services" and "services_ipv6" might change with the next patch or version without notice.
A "Custom Url" is saved in /etc/config/ddns configuration file.

Without LuCI UI you need to remove "option service_name" and add "option update_url" with your custom URL directly in /etc/config/ddns.

Christian

I'm having trouble with namecheap.com for subdomains also

Note: I've replaced my actual hostname and domain with "host" and "example.com".

Looking at the log file, it appears nslookup is trying to resolve an IP address for the domain name ("example.com" which doesn't have one), instead of the FQDN ("host.example.com"), and then failing, and not updating the IP address.

122421       : Detect registered/public IP
122421       : #> /usr/bin/nslookup example.com  >/var/run/ddns/host.dat 2>/var/run/ddns/example.com.err
122421 ERROR : BusyBox nslookup error: '1'
122421       : nslookup: can't resolve 'example.com': Name or service not known
122422  WARN : Get registered/public IP for 'example.com' failed - retry 1/0 in 60 seconds
122522       : #> /usr/bin/nslookup example.com  >/var/run/ddns/host.dat 2>/var/run/ddns/host.err

Taken from /usr/lib/ddns/services

"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"

So in LuCi,

- Hostname/Domain = [DOMAIN] Domain name (eg. "example.com")
- Username = [USERNAME] Hostname (eg. "host".example.com)
- Password = Dynamic DNS password [PASSWORD]

Why does nslookup need to check if your FQDN has an IP address, and then fail if it doesn't, if the whole purpose is to update the IP with a new one.

For the time being, I've used "-- custom --" as the DDNS Service provider, with "http://dynamicdns.park-your-domain.com/update?host=host&domain=example.com&password=[PASSWORD]" (obviously replacing host, and example.com with my real ones).

Then under Hostname/Domain - "host.example.com" (FQDN)
Username - " " (Space)
Password - "xxxxxx"

This seems to work fine, and also keeps LuCi nice and pretty with the correct IP displayed for the FQDN under Status, Overview.

Simon

Why does nslookup need to check if your FQDN has an IP address, and then fail if it doesn't, if the whole purpose is to update the IP with a new one.

Your FQDN (host.domain) needs to have an IP, your domain does not. nslookup is used to verify if your routers IP changed and if update was successful.

ddns-scripts was designed for dyndns-api which is used by most ddns providers and to update only ONE host per service definition.
Other ddns providers use their own api and there start the problem. "Custom URL" is the solution for the moment.

I'm currently working on separating [DOMAIN] as parameter of update-url and the "lookup-host" to be used to verify if routers IP has changed.
Additional there will be two more optional parameters for use inside update-url.

Please give me some more weeks to finish, because I also need to adapt luci-app-ddns and asap update wiki but be currently rare on time.
Christian

The discussion might have continued from here.