What's new

DDNS - duckdns.org

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

Anyone for duckdns,org to work. I am running asus-rt n66u with 378.51.

I created ddns-start and have custom jffs scripts enabled. Ddns-start is updated by the logs just fine, but when I test it out not working. I have static the dns to opendns and went to opendns.com/welcome to test whether; it was using opendns or not. It was still using the opendns. Any help be appreciated. I tried the wan-start but that didnt work either.

This is my script:

<code>
#!/bin/sh
touch /tmp/000wanstarted
sleep 45
curl -k -s "https://www.duckdns.org/update?domains=domainname&token=XXXXXXX&ip="

if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
</code>


Your URL has an "ip" argument at the end but you don't provide any IP. Maybe that's causing the problem. Try appending the IP, contained in $1 (if using within a ddns-custom script).
 
Your URL has an "ip" argument at the end but you don't provide any IP. Maybe that's causing the problem. Try appending the IP, contained in $1 (if using within a ddns-custom script).
I will try and add my IP at the end of the URL and see if that works when I get home from work. Thanks Merlin.
 
Hi,

I have just signed up and I have just bought an asus rt-ac87u.

I am interested as well in using ddns service of duckdns.

Looking at this wiki guide, at this guide on fritzbox and at the posts above, I hope that the following simple script will work:

Code:
#!/bin/sh
# Use duckdns.org service on your router
# First step: register on duckdns.org site and choose a subdomain name and note the generated token
# Second step: fill in the double quotes below the information needed
DOMAIN=""
TOKEN=""

/usr/sbin/curl --silent "https://www.duckdns.org/update?domains=$DOMAIN&token=$TOKEN&ip" > /dev/null 2>&1
if [ $? -eq 0 ];
then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
exit 0

I have not tested this script yet as I have not configured the router neither, therefore your feedback would be really appreciated.

giopas
 
Thanks hawke84, the script I have wrote above is quite similar to yours and should therefore work (still to be confirmed though, as I still need to configure the router).
 
this worked for me
Code:
#!/bin/sh

curl -k "https://www.duckdns.org/update?domains=xxxxx&token=xxxxxx

if [ $? -eq 0 ]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi


fill in the xxx with your domain and token.
save this as ddns-start

my original thread:
http://www.snbforums.com/threads/duckdns-setup.24784/

I have a slight variant of that working where it captures and tests the response from DuckDNS. Otherwise I found that the script always signaled a success, even if the update hadn't occurred:

Code:
#!/bin/sh

result=$(curl -k --url "https://www.duckdns.org/update?domains=<DOMAIN>&token=<TOKEN>&ip=")

if [[ $result == "OK" ]]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
 
@RMerlin how would i go about incorporating duckdns into your script https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-DDNS
Using a DDNS with VPN

below is the current working script

Code:
#!/bin/sh

# register a subdomain at https://www.duckdns.org/ to get your token
SUBDOMAIN="xxxxxxxxxxx.duckdns.org"  *xxxxxx = removed for security*
TOKEN="xxxxxxxxxxxxxxxxxx"   *xxxxxx = removed for security*

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

Please can you help as you're the master at these things?

Thanks
 
Last edited:
@RMerlin how would i go about incorporating duckdns into your script https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-DDNS
Using a DDNS with VPN

here is the current script and that's working

#!/bin/sh

# register a subdomain at https://www.duckdns.org/ to get your token
SUBDOMAIN="xxxxxxxxxxx.duckdns.org" *xxxxxx = removed for security*
TOKEN="xxxxxxxxxxxxxxxxxx" *xxxxxx = removed for security*

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

Please can you help as you're the master at these things?

Thanks







I haven't tried this myself, but I think should just be able to copy your script into /jffs/scripts and rename it to ddns_start.

Make sure you set the DDNS page to "Custom" and ensure you enable JFFS scripts on Admin/System page:
upload_2020-3-19_23-0-8.png



Let us know how that works.
 
I haven't tried this myself, but I think should just be able to copy your script into /jffs/scripts and rename it to ddns_start.

Make sure you set the DDNS page to "Custom" and ensure you enable JFFS scripts on Admin/System page:
View attachment 22052


Let us know how that works.

Thanks for trying to help me :)

Funnily enough that's how i did it, created script on router, made sure properties were correct and turned on custom_ddns and added hostname etc it registers sucessfully .....what i would like to know is how i link ddns to a vpn

@RMerlin can you provide some magic scripting please if it is doable?
 
Last edited:
Did you try the VPN example? You might need to change the tun11 lines if you're using a different client instance.

Code:
#!/bin/sh

if [ "$script_type" = "up" ] && [ "$vpn_interface" = "tun11" ]; then
    # OpenVPN tunnel won't open until openvpn-event script is finished, run the rest in a background shell
    (
        # Loop until VPN tunnel is established or the timeout limit is reached
        COUNTER=0
        LIMIT=10
        while [ "$COUNTER" -le "$LIMIT" ] && ! ifconfig | grep -Fq "tun11"; do
            sleep 1
            COUNTER=$((COUNTER + 1))
        done

        SUBDOMAIN="xxxxxxxxxxx.duckdns.org"
        TOKEN="xxxxxxxxxxxxxxxxxx"

        curl -fs -o /dev/null "https://www.duckdns.org/update?domains=$SUBDOMAIN&token=$TOKEN"
    ) &
fi
 
Did you try the VPN example? You might need to change the tun11 lines if you're using a different client instance.

Code:
#!/bin/sh

if [ "$script_type" = "up" ] && [ "$vpn_interface" = "tun11" ]; then
    # OpenVPN tunnel won't open until openvpn-event script is finished, run the rest in a background shell
    (
        # Loop until VPN tunnel is established or the timeout limit is reached
        COUNTER=0
        LIMIT=10
        while [ "$COUNTER" -le "$LIMIT" ] && ! ifconfig | grep -Fq "tun11"; do
            sleep 1
            COUNTER=$((COUNTER + 1))
        done

        SUBDOMAIN="xxxxxxxxxxx.duckdns.org"
        TOKEN="xxxxxxxxxxxxxxxxxx"

        curl -fs -o /dev/null "https://www.duckdns.org/update?domains=$SUBDOMAIN&token=$TOKEN"
    ) &
fi
Thanks, bomber looks like just what i was needing :) quick question would workout what tunnel is in use, like a list?
 
Last edited:
The ifconfig command should show which tunnel you're using.

Thanks :)

still working my way through setup of different things...atm xmrouting
 
Last edited:

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