What's new

Asus RT-AC68U (AsusWRT) DDNS problem

  • 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!

andres99

Occasional Visitor
It seems that I would need some help getting DDNS to work with AsusWRT 380.65. I am using an Asus RT-AC68U router, which is behind another router (and therefore does not get an external IP itself). I am using http://www.dynu.com as the dynamic DNS service.

Dynu.com lets the hostname be updated by just going to the following URL:

https://api.dynu.com/nic/update?hostname=xxx&myip=xxx&password=xxx

where xxx are the respective values.

In AsusWRT, I have enabled JFFS custom scripts and configs. I have copied a ddns-start script to /jffs/scripts/ddns-start (using WinSCP). In WAN -> DDNS I have enabled the DDNS Client (Server: Custom).

The ddns-start script is as follows (all done on the basis of AsusWRT Wiki examples – dnsomatic.com is used to get the actual external IP address, according to an example that I found in AsusWRT wiki):
Code:
#!/bin/sh
#
# https://www.dynu.com/en-US/DynamicDNS/IP-Update-Protocol

HOSTNAME=xxx.freeddns.org
PASSWORD=xxx
IP=$(wget -O - -q http://myip.dnsomatic.com/)

URL="https://api.dynu.com/nic/update?hostname=${HOSTNAME}&myip=${IP}&password=${PASSWORD}"

ANSWER=$(wget -q -O - "$URL")

if [ "$ANSWER" == "good" ] || [ "$ANSWER" == "nochg" ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi

However, the DDNS fails in practice and in the system log I am getting this every 30 seconds:
Code:
Jun 19 23:02:39 watchdog: start ddns.
Jun 19 23:02:39 rc_service: watchdog 444:notify_rc start_ddns
Jun 19 23:02:39 custom script: Running /jffs/scripts/ddns-start (args: 192.168.3.100)
Jun 19 23:03:09 watchdog: start ddns.
Jun 19 23:03:09 rc_service: watchdog 444:notify_rc start_ddns
Jun 19 23:03:09 custom script: Running /jffs/scripts/ddns-start (args: 192.168.3.100)

Note: 192.168.3.100 is the IP address of Asus RT-AC68U in the LAN behind the other router.

Thanks anyone who can tell me what I have been doing wrong.
 
Last edited:
It is quite surprising how relatively simple something can be in Tomato and how complicated the same thing can be in AsusWRT.

However, I did it another way.

Apparently Dynu also supports hostname updates that do not contain any IP address, like e.g.:

https://api.dynu.com/nic/update?hostname=xxx&password=xxx

So I created a script, /jffs/scripts/dynu.sh as follows:
Code:
#!/bin/sh
curl -k --silent "https://api.dynu.com/nic/update?hostname=xxx&password=xxx"

I also gave that script most access rights (0775). This script just connects to dynu.com and lets it know that the IP address from which it connects is presently used for my hostname. Apparently the DNSSEC option in LAN section of AsusWRT needs to be "Yes" for this to work.

Then I also created /jffs/scripts/init-start (also with such access rights) as follows:
Code:
#!/bin/sh
cru a dynu "*/30 * * * * /jffs/scripts/dynu.sh"

The latter script makes dynu.sh run every 30 minutes to update the IP address information if it has changed meanwhile. The interval could also be shorter.

Then I restarted the router and it works now. No updates for the AsusWRT interface but still much better than the previous situation of occurring retries every 30 secs for a reason that escaped me. It would still be interesting to know why Merlin's DDNS system, as proposed in AsusWRT wiki, did not work for me.

P.S. I think that the method I used could also work with any other dynamic DNS service that does not require the IP address explicitly in the update URL/string.

And if I got the logic correctly, this method may even be better than AsusWRT's native DDNS in the cases when the router is not directly connected to a WAN interface because when the WAN IP changes, the router might not know it and might not perform the DDNS update. But in this case it does that automatically after a certain interval.
 
Last edited:
It is quite surprising how relatively simple something can be in Tomato and how complicated the same thing can be in AsusWRT.

However, I did it another way.

Apparently Dynu also supports hostname updates that do not contain any IP address, like e.g.:

https://api.dynu.com/nic/update?hostname=xxx&password=xxx

So I created a script, /jffs/scripts/dynu.sh as follows:
Code:
#!/bin/sh
curl -k --silent "https://api.dynu.com/nic/update?hostname=xxx&password=xxx"

I also gave that script most access rights (0775). This script just connects to dynu.com and lets it know that the IP address from which it connects is presently used for my hostname. Apparently the DNSSEC option in LAN section of AsusWRT needs to be "Yes" for this to work.

Then I also created /jffs/scripts/init-start (also with such access rights) as follows:
Code:
#!/bin/sh
cru a dynu "*/30 * * * * /jffs/scripts/dynu.sh"

The latter script makes dynu.sh run every 30 minutes to update the IP address information if it has changed meanwhile. The interval could also be shorter.

Then I restarted the router and it works now. No updates for the AsusWRT interface but still much better than the previous situation of occurring retries every 30 secs for a reason that escaped me. It would still be interesting to know why Merlin's DDNS system, as proposed in AsusWRT wiki, did not work for me.

P.S. I think that the method I used could also work with any other dynamic DNS service that does not require the IP address explicitly in the update URL/string.

And if I got the logic correctly, this method may even be better than AsusWRT's native DDNS in the cases when the router is not directly connected to a WAN interface because when the WAN IP changes, the router might not know it and might not perform the DDNS update. But in this case it does that automatically after a certain interval.
Registered just to confirm that this solution works on my Asus AC86U and Dynu DDNS. One thing to note is that it takes time for it to work. I thought that once this is set up and the router rebooted, it will kick in right away. Not the case, it took half an hour to update the IP. I assume this is because of the way cron works - "*/30 * * * *" means at every 00 and 30 minute of the hour, and not dependent on the router reboots.
Thanks Andres99!
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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