What's new

How to enable custom DDNS and make IP updates to DnsOMatic

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

Renzor

New Around Here
Hello,

My router is in access point mode and I cannot set it via GUI to custom DDNS.
How can I do this from terminal?

I read the wiki and I understand that I must create a ddns-start script.
I was thinking to add this lines, that I also found here : https://github.com/RMerl/asuswrt-merlin/wiki/DDNS-Sample-Scripts#dns-o-matic and modified to get the ip via wget.

Code:
#!/bin/sh
IP=$(wget -O - -q http://myip.dnsomatic.com/)
# Update the following variables:
USERNAME=dnsomatic_username
PASSWORD=dnsomatic_password
HOSTNAME=all.dnsomatic.com

# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent "https://$USERNAME:$PASSWORD@updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=$IP" > /dev/null
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi

Then add this script to wan-start in jffs scripts.

Is this the right path to enable ddns updates manually?
Thank you.
 
Last edited:
Yes, that is essentially what I did


Sent from my iPhone using Tapatalk
 
Yeah, but I realised that I have no wan interface :
ddns-start
Script called at the end of a DDNS update process. This script is also called when setting the DDNS type to "Custom". The script gets passed the WAN IP as an argument. When handling a "Custom" DDNS, this script is also responsible for reporting the success or failure of the update process. See the Custom DDNS section for more information.

So even with the ddns-start, it will do nothing because this will be called when the wan IP changes, same if I call it from wan-start, because I use a bridge interface:

Code:
admin@AC56U:/jffs/scripts# ifconfig br0
br0       Link encap:Ethernet  HWaddr BC:EE:7B:31:20:18
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:152163360 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213361439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8734719803 (8.1 GiB)  TX bytes:301630433052 (280.9 GiB)
I think the fix is to make the script run periodically to check if the IP changed.
 

Similar threads

Sign Up For SNBForums Daily Digest

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