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!

darksamus

Senior Member
Merlin,

Since dyndns.org will no longer offer free dyndns starting may 7, 2014. Can you add duckdns.org as part of your next firmware release?
 
No, I won't be adding any additional DDNS service. Use DNS-o-matic if your favorite service isn't supported, as they support a wide range of third party services.
 
No, I won't be adding any additional DDNS service. Use DNS-o-matic if your favorite service isn't supported, as they support a wide range of third party services.

But not duckdns. :( Would be nice if there was a generic set of form fields that could be used. Is it possible to configure DDNS from a command line? Poked around, didn't see anything obvious.
 
Last edited:
But not duckdns. :( Would be nice if there was a generic set of form fields that could be used. Is it possible to configure DDNS from a command line? Poked around, didn't see anything obvious.

Check to see if your DNS provider has a way to update your IP via http request. Then, you can just hit that URL whenever the WAN interface on your router comes "up" (i.e. when your router boots or reconnects to the internet).

Create a file called wan-start in /jffs/scripts (make sure jffs is enabled) containing these 2 lines. Change the URL for the one required by your DNS provider, including authentication if needed.

Code:
#!/bin/sh
curl -k -s "https://login:password@ipv4.tunnelbroker.net/ipv4_end.php?tid=XXXXXX"

Edit: DuckDNS does support https requests for updating IPs. Refer to their FAQs.
 
Last edited:
Thanks, a start script or a cron job should work.

Create a file called wan-start in /jffs/scripts (make sure jffs is enabled) containing these 2 lines. Change the URL for the one required by your DNS provider, including authentication if needed.

Code:
#!/bin/sh
curl -k -s "https://login:password@ipv4.tunnelbroker.net/ipv4_end.php?tid=XXXXXX"

Edit: DuckDNS does support https requests for updating IPs. Refer to their FAQs.

I know this is a couple months old, but its exactly where I need help.

I put the below into a file created in Notepad++ and saved as "DuckDNS.wanup" (Minus quote). I used WinCP to transfer it into the /jffs/scripts folder. Then I changed the permission to Octal:700. I entered the Web GUI and hit the Reboot button but the script didn't run. I also unplugged the WAN cable waited 30 secs and plugged back in.

What am I missing?

#!/bin/sh
curl -k -s "https://www.duckdns.org/update/DOMAIN/tokentokentokentokentokentoken"



I know that the URL works (when filled in correctly), because I can paste it into a web browser and it updates my IP address to DuckDNS. Becasue DucksDNS's timestamp isn't extremely accurate, I changed the URL to something else to test the script. I use Zapier for some home automation, so I created a URL hook so at anytime it is visited, Zapier sends me a text message to my phone. This is almost instantaneous. Right now, my .wanup script is using a zapier URL so I know the moment it is triggered.
 
Last edited:
I know this is a couple months old, but its exactly where I need help.

I put the below into a file created in Notepad++ and saved as "DuckDNS.wanup" (Minus quote). I used WinCP to transfer it into the /jffs/scripts folder. Then I changed the permission to Octal:700. I entered the Web GUI and hit the Reboot button but the script didn't run. I also unplugged the WAN cable waited 30 secs and plugged back in.

What am I missing?

#!/bin/sh
curl -k -s "https://www.duckdns.org/update/DOMAIN/tokentokentokentokentokentoken"



I know that the URL works (when filled in correctly), because I can paste it into a web browser and it updates my IP address to DuckDNS. Becasue DucksDNS's timestamp isn't extremely accurate, I changed the URL to something else to test the script. I use Zapier for some home automation, so I created a URL hook so at anytime it is visited, Zapier sends me a text message to my phone. This is almost instantaneous. Right now, my .wanup script is using a zapier URL so I know the moment it is triggered.

https cannot be used immediately after the WAN went up because it requires the clock to be accurate (otherwise, the connection is rejected due to an invalid certificate start date).

Add a delay before the curl call:

Code:
sleep 30
 
Test it in an ssh session to see the output, don't use -s

or just use afraid.org on dnsomatic

I opened an SSH sessions and copied the script line "curl -k -s "https://zapier.com/hooks/catch/******/" and it worked.

So in an SSH session it worked with the -s .

Should I still try deleting it?

Almost seems like its not running the script at wanup.

Is there a log file I can check for any errors when it is trying to run the .wanup file????

p.s. Thanks for the Help!!
 
Did you set your script permissions? Try formatting jffs again, once I had to do an extra format

You want to test without the -s because s means silent
 
Did you set your script permissions? Try formatting jffs again, once I had to do an extra format

You want to test without the -s because s means silent

I got rid of the -s from the script. No difference.

Reformatted the jffs. No difference.

Here is a dumb question, and maybe this is my problem.

Under Wan>DDNS do I have to have DDNS Client enabled with a custom server? If so, what do I use for the Host name and refresh interval days?
 
I got rid of the -s from the script. No difference.

Reformatted the jffs. No difference.

Here is a dumb question, and maybe this is my problem.

Under Wan>DDNS do I have to have DDNS Client enabled with a custom server? If so, what do I use for the Host name and refresh interval days?

Yes, DDNS must be enabled and set to custom if you want to use a ... custom DDNS script.

Hostname is whatever is the hostname of your DDNS, so the router can use it when generating URLs for AiCloud or the OpenVPN config file.

Refresh interval can be kept to its default value.
 
After about 6 hours of messing around with it today. I finally got it.

I wanted to post my findings for anyone else that is a noob like me. :D


1. Make sure you have WinSCP installed.

2. Make sure you have JFFS enabled and format at reboot. I formatted it a few times for the heck of it. Also, enable JFFS custom scripts.

3. Using WinSCP go to the following directory <root>/jffs/scripts

4. In the scripts folder, which should be blank, right click and select New>Create a New File.

5. Enter your script. Here is what I used:

Code:
#!/bin/sh
touch /tmp/000wanstarted
sleep 30
curl -k "https://zapier.com/hooks/catch/*******/"

My URL above was a test to make sure that the router is hitting the website in "QUOTE". Take a look at Zapier if you have a chance, it could probably be used for some cool router automation.

6. Save the file as one of the following type from here:
https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

7. I named mine "wan-start" (without the quotes) hoping that anytime my public IP changes it will run the script, but I am not sure all the circumstances of when WAN-START will run.

8. Reboot the router to test. If you aren't using a URL like zapier to test, or one that logs ever time it is hit. Keeping the 000wanstarted line of code in the script will at least let you know that the file is being created and stored in <root>/tmp folder


So the next step is to replace the zapier url with the DuckDNS code:
"https://www.duckdns.org/update/EXAMPLEDOMAIN/TOKEN"

Also, I do not have DDNS custom activated and it is working fine. Actually today, I setup OpenDNS with DNS-O-Matic, so the DDNS setting are pointed to DNS-O-Matic and my script is working fine. I don't see how the router would know what the script is actually for. All its doing is wacking a HTTPS url.

Thanks all for the previous help!!

I hope my finding will help someone else in the future.

Have a good day!!
 
Last edited:
Just a tip that these services hate constant updates and usually ignore them. If it's the same ip you may think your script isn't working when it's just being ignored.
 
I left my Zapper url in the script as well to see when it updates and so far it has been only once at boot.

I wonder if there is some type of script to look at the wan ip, store it and check it the actual against the stored. If changed, hit the URL to send latest.
 
I left my Zapper url in the script as well to see when it updates and so far it has been only once at boot.

I wonder if there is some type of script to look at the wan ip, store it and check it the actual against the stored. If changed, hit the URL to send latest.

In wan-start I check to see if a true reboot is progress and send an email with relevant information...

Here is the code snippet that shows I store the current WAN I/P on a flash drive /mnt/$MYROUTER/IPADDR.txt (you could use /jffs/ etc.)

Code:
<snip>
MYROUTER=$(nvram get computer_name)

MY_WANIPADDR=$(nvram get wan0_ipaddr)
MY_WANIPADDRX=$(cat /tmp/mnt/$MYROUTER/IPADDR.txt)


logger -s -t "($(basename $0))" $$ Previous WAN IP $MY_WANIPADDRX
logger -s -t "($(basename $0))" $$ Current  WAN IP $MY_WANIPADDR

# Check if I/P address has changed
if [ "$MY_WANIPADDR" = "$MY_WANIPADDRX" ]; then
   echo "My "$ISP" t'Tinterweb IP address is: "$MY_WANIPADDR >>$TEMPFILE
   echo "" >>$TEMPFILE
   logger -s -t "($(basename $0))" $$ WAN IP unchanged
else
   echo "I just got connected t'Tinterweb." >>$TEMPFILE
   echo "" >>$TEMPFILE
   echo "My new "$ISP" IP address is: >"$MY_WANIPADDR"< was >"$MY_WANIPADDRX"<" >>$TEMPFILE
   echo "" >>$TEMPFILE
   logger -s -t "($(basename $0))" $$ WAN IP changed!!!
   
   hit URL etc.

   # Save the current WAN I/P address
   echo $MY_WANIPADDR >/tmp/mnt/$MYROUTER/IPADDR.txt
fi

So simply add the code to hit the URL if the WAN address has changed.

NOTE: In a dual-WAN configuration you may need to use the wan1_ipaddr NVRAM variable.
 
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>
 
Is that the exact URL you are usuing? or are you subing out your actual domain name and token number so it is hidden?
 

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