DDNS auto start not working

Hello Community,

I am making my first steps in learning OpenWRT and Linux and decided to start with setting up Open VPN which in turn requires DDNS service. It seems DDNS works well but I can not find a way to start it automatically every time when the router reboots. For now it always needs to be started manually.

What could be the problem?

Thank you

service ddns enable
ls -l /etc/rc.d/*ddns*
uci show ddns
1 Like
root@OpenWrt:~# service ddns enable
root@OpenWrt:~# ls -l /etc/rc.d/*ddns*
lrwxrwxrwx    1 root     root            14 Feb  7 05:35 /etc/rc.d/K10ddns -> ../init.d/ddns
lrwxrwxrwx    1 root     root            14 Feb  7 05:35 /etc/rc.d/S95ddns -> ../init.d/ddns
root@OpenWrt:~# uci show ddns
ddns.global=ddns
ddns.global.ddns_dateformat='%F %R'
ddns.global.ddns_loglines='250'
ddns.global.upd_privateip='0'
ddns.k_villec9=service
ddns.k_villec9.service_name='no-ip.com'
ddns.k_villec9.username='XXXXXXX'
ddns.k_villec9.password='YYYYYYY'
ddns.k_villec9.enabled='1'
ddns.k_villec9.lookup_host='villec9.ddns.net'
ddns.k_villec9.domain='villec9.ddns.net'
ddns.k_villec9.ip_source='web'
ddns.k_villec9.use_https='1'
root@OpenWrt:~# Connection to 192.168.60.1 closed by remote host.
Connection to 192.168.60.1 closed.

After reboot DDNS stays stopped. Also not sure why I have two entries of ddns in the list above?

what do the logs say?

1 Like

Thank you for looking into this, Psherman.
No new records in the log after reboot, but if I start the process manually (from web interface), I get the records below. Is it possible to add a startup command somewhere for starting this service?

123945 note : PID '8158' started at 2019-02-07 12:39
123945 : ddns version : 2.7.8-1
123945 : uci configuration:
ddns.villec9.domain='villec9.ddns.net'
ddns.villec9.enabled='1'
ddns.villec9.ip_source='web'
ddns.villec9.lookup_host='villec9.ddns.net'
ddns.villec9.password='PW'
ddns.villec9.service_name='no-ip.com'
ddns.villec9.use_https='1'
ddns.villec9.username='alkon'
ddns.villec9=service
123946 : verbose mode : 0 - run normal, NO console output
123946 : check interval: 600 seconds
123947 : force interval: 259200 seconds
123947 : retry interval: 60 seconds
123947 : retry counter : 0 times
123947 : No old process
123947 : last update: never
123947 : Detect registered/public IP
123947 : #> /usr/bin/nslookup villec9.ddns.net >/var/run/ddns/villec9.dat 2>/var/run/ddns/villec9.err
123948 : Registered IP '108.168.28.165' detected
123948 info : Starting main loop at 2019-02-07 12:39
123948 : Detect local IP on 'web'
123948 : #> /usr/bin/wget-ssl -nv -t 1 -O /var/run/ddns/villec9.dat -o /var/run/ddns/villec9.err --no-proxy 'http://checkip.dyndns.com'
123949 : Local IP '108.168.28.165' detected on web at 'http://checkip.dyndns.com'
123950 : Forced Update - L: '108.168.28.165' == R: '108.168.28.165'
123950 : parsing script '/usr/lib/ddns/update_no-ip_com.sh'
123950 : sending dummy IP to 'no-ip.com'
123950 : #> /usr/bin/wget-ssl -nv -t 1 -O /var/run/ddns/villec9.dat -o /var/run/ddns/villec9.err --no-proxy 'https://alkon:PW@dynupdate.no-ip.com/nic/update?hostname=villec9.ddns.net&myip=127.0.0.1'
123952 : 'no-ip.com' answered:
good 127.0.0.1
123953 : sending real IP to 'no-ip.com'
123953 : #> /usr/bin/wget-ssl -nv -t 1 -O /var/run/ddns/villec9.dat -o /var/run/ddns/villec9.err --no-proxy 'https://alkon:PW@dynupdate.no-ip.com/nic/update?hostname=villec9.ddns.net&myip=108.168.28.165'
123955 : 'no-ip.com' answered:
good 108.168.28.165
123955 info : Forced update successful - IP: '108.168.28.165' send
123955 : Waiting 600 seconds (Check Interval)

The log looks fine ("Forced update successful..."). If you log into no-ip's web interface, does it show the correct IP and latest update time?

Check to make sure the general ddns script is enabled in /etc/init.d. The quick way to do this is:
System > Startup > ddns
or
/etc/init.d/ddns enable

Aside form that, I think everything appears to be normal.

reboot
# wait 5 mins
logread -e ddns

I have no idea why, but according to OpenWrt's guide to setting up DDNS clients, in the Operation section, I had to run the commands

. /usr/lib/ddns/dynamic_dns_functions.sh
start_daemon_for_all_ddns_sections "wan"

in order to get my DDNS to work.

Gentlemen, thank you All,

You helped me to understand the system better by pointing to the key elements. The problem was that I did not know some controls and setup it incorrectly. I had Event Network set to Wan while my device is connected to the main router via LAN port. Switching this parameter to Lan fixed the problem

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.