What's new

DDNS

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

maghuro

Very Senior Member
Right now I'm facing some issues regarding DDNS service on router.
Attached is my current configuration.

The problem is - my wan IP address changed very often (most of times during night), and the DDNS update doesn't start automatically. I have to go and force the update - which isn't the purpose of a DDNS service.
I have set to check it every 30 minutes (minimum allowed) but it simply doesn't update. I saw the logs to check if any error ocurred, but no it simply doesn't trigger a check nor an update.
Maybe it's because I'm behind a double NAT? Is there any way to force an update (or a check) every X minutes using the router's DDNS service?

Thanks in advance.

https://ibb.co/k6P1tXG
 
No. My problem isn't failing to update. My problem is it doesn't trigger any update from time to time.
So if my ip is changed during night, I have to guess in the morning and go to router and trigger a manual update.
Maybe is based in a cron job, how can I check if cron job is ok?
 
It looks like it is triggered by watchdog daemon, but only if the method is internal. External method may only trigger during the forced interval. I’m not 100% positive, but seems to be a problem.

Edit: no, I think I’m wrong. So I don’t know. o_O
 
Last edited:
It looks like it is triggered by watchdog daemon, but only if the method is internal. External method may only trigger during the forced interval. I’m not 100% positive, but seems to be a problem.

Edit: no, I think I’m wrong. So I don’t know. o_O
I just confirmed even external is triggered by watchdog.


Code:
Mar 12 13:24:09 watchdog: Forced DDNS update (after 1 days)
Mar 12 13:24:09 rc_service: watchdog 998:notify_rc restart_ddns
Mar 12 13:24:09 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Mar 12 13:24:09 start_ddns: update WWW.DNSOMATIC.COM default@dnsomatic.com, wan_unit 0
Mar 12 13:24:09 inadyn[3088]: In-a-dyn version 2.6 -- Dynamic DNS update client.
Mar 12 13:24:10 inadyn[3088]: Update forced for alias all.dnsomatic.com, new IP# XX.XX.XX.XX
Mar 12 13:24:12 inadyn[3088]: Updating cache for all.dnsomatic.com

However, it's only triggering each 1 day.

So how can I force it to be triggered each 30 minutes as I defined on the interface?
 
@dave14305
I just confirmed even external is triggered by watchdog.


Code:
Mar 12 13:24:09 watchdog: Forced DDNS update (after 1 days)
Mar 12 13:24:09 rc_service: watchdog 998:notify_rc restart_ddns
Mar 12 13:24:09 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Mar 12 13:24:09 start_ddns: update WWW.DNSOMATIC.COM default@dnsomatic.com, wan_unit 0
Mar 12 13:24:09 inadyn[3088]: In-a-dyn version 2.6 -- Dynamic DNS update client.
Mar 12 13:24:10 inadyn[3088]: Update forced for alias all.dnsomatic.com, new IP# XX.XX.XX.XX
Mar 12 13:24:12 inadyn[3088]: Updating cache for all.dnsomatic.com

However, it's only triggering each 1 day.

So how can I force it to be triggered each 30 minutes as I defined on the interface?
 
I think it fails because it tries to resolve all.dnsomatic.com as part of the update and it fails, so the update check is aborted. What if you disable the WAN IP and Hostname verification?
 
I think it fails because it tries to resolve all.dnsomatic.com as part of the update and it fails, so the update check is aborted. What if you disable the WAN IP and Hostname verification?
Dave, it doesn't fail!
It simply doesn't run. Only daily and manually.
Not fro 30 to 30 minutes...
 
I'm saying it runs but fails internally and leaves no output.

I might be wrong but dnsomatic is not like the rest of the DDNS services.

https://github.com/RMerl/asuswrt-merlin.ng/blob/mainline/release/src/router/rc/watchdog.c#L5632
Oh I see...
Well, i disabled WAN IP and Hostname verification just to test.
Right now, the IP on dnsomatic is different from my actual IP. I'll wait a couple of minutes to see if it is updated.

Edit: does watchdog runs from time to time?
 
Oh I see...
Well, i disabled WAN IP and Hostname verification just to test.
Right now, the IP on dnsomatic is different from my actual IP. I'll wait a couple of minutes to see if it is updated.

Edit: does watchdog runs from time to time?
The more I’ve looked at the code, the more I think it won’t work in the double NAT situation. Hopefully others will chime in.
 
The more I’ve looked at the code, the more I think it won’t work in the double NAT situation. Hopefully others will chime in.
My understanding is that with custom DDNS selected in GUI you need to create ddns-start script. In that config whenever WAN IP changes the firmware will call ddns-start script. Check out Merlin wiki pages. I just finish implementing it and so far it works. However my ISP does not change my IP that often so I cannot verify 100%.
 
The more I’ve looked at the code, the more I think it won’t work in the double NAT situation. Hopefully others will chime in.
Waited couple of minutes, no success... :(

I have the same feeling as you. Let's wait someone pronounces.

If dnsomatic supported updating IP via url (with autentication on URL), i'd use another way to update IPs.
But as it only allows with http authentication, my router is the only way I have to update my external IP...
 
Waited couple of minutes, no success... :(

I have the same feeling as you. Let's wait someone pronounces.

If dnsomatic supported updating IP via url (with autentication on URL), i'd use another way to update IPs.
But as it only allows with http authentication, my router is the only way I have to update my external IP...
The doc claims you can use https.

https://www.dnsomatic.com/docs/api
 
Waited couple of minutes, no success... :(

I have the same feeling as you. Let's wait someone pronounces.

If dnsomatic supported updating IP via url (with autentication on URL), i'd use another way to update IPs.
But as it only allows with http authentication, my router is the only way I have to update my external IP...

I run double NAT and use duckdns with DDNS-start script. Connecting using https remotely to my Synology NAS. No issues.
 
I run double NAT and use duckdns with DDNS-start script. Connecting using https remotely to my Synology NAS. No issues.
As im a zero at ssh, and installing scripts by myself (despite on amtm), can you please teach me how to do it? Or at least force an update at ddns-start script.

Thanks!
 
Here is what I would do.

1. First in /jffs/scripts directory create ddns-start script -> touch /jffs/scripts/ddns-start
2. chmod /jffs/scripts/ddns-start
3. Edit ddns-start - see below. I use DUCKDNS.
Merlin provides different scripts for many DDNS providers. See this link (this is where I got mine).
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-DDNS
4. Login to the router and under WAN/DDNS tab select custom method and provide your ddns host name.

#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
SUBDOMAIN="xxxxx"
TOKEN="cxxxxxx"
IP="$(curl -fs4 https://myip.dnsomatic.com/)"

# no modification below needed
curl --silent "https://www.duckdns.org/update?domains=$SUBDOMAIN&token=$TOKEN&ip=$IP" >/dev/null 2>&1
if [ $? -eq 0 ];
then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi

Note.
1. If you need any port forwarding you also need to do that. Since I have a double NAT I had to port forward on both the ISP cable modem and asus router. This was so I can access my apps on Synology NAS. You may have a different case so it depends. But forwarding the ports is important.


Hope this helps you out.
 
Here is what I would do.

1. First in /jffs/scripts directory create ddns-start script -> touch /jffs/scripts/ddns-start
2. chmod /jffs/scripts/ddns-start
3. Edit ddns-start - see below. I use DUCKDNS.
Merlin provides different scripts for many DDNS providers. See this link (this is where I got mine).
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-DDNS
4. Login to the router and under WAN/DDNS tab select custom method and provide your ddns host name.

#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
SUBDOMAIN="xxxxx"
TOKEN="cxxxxxx"
IP="$(curl -fs4 https://myip.dnsomatic.com/)"

# no modification below needed
curl --silent "https://www.duckdns.org/update?domains=$SUBDOMAIN&token=$TOKEN&ip=$IP" >/dev/null 2>&1
if [ $? -eq 0 ];
then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi

Note.
1. If you need any port forwarding you also need to do that. Since I have a double NAT I had to port forward on both the ISP cable modem and asus router. This was so I can access my apps on Synology NAS. You may have a different case so it depends. But forwarding the ports is important.


Hope this helps you out.

And let's supose I want to call the force update command from internal ddns, and append it to a start script? how
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Members online

Top