What's new

Need help setting up freedns.afraid.org custom 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!

the block

Occasional Visitor
I just bought a RT-AC68P and have installed Asuswrt-Merlin 380.57 and have been trying to get everything configured today. I am coming from Shibby Tomato and have always been able to update my freedns.afriad.org DDNS account right from my router, so I wanted to do the same with Asuswrt-Merlin.

I've found the right documentation concerning setting this up, and I followed the directions the best I knew how, but it's not working.

Here's what I did.
  1. Administration -> System -> Enable JFFS custom scripts and configs (YES)
  2. Connected with WinSCP, navigated to /jffs/scripts, created a file called ddns-start. In that file, I copied and pasted this:
    Code:
    ----- HTTPS -----                                                                                                          
    #!/bin/sh
    
    curl -k "https://freedns.afraid.org/dynamic/update.php?MYKEY" >/dev/null
    
    if [ $? -eq 0 ]; then
        /sbin/ddns_custom_updated 1
    else
        /sbin/ddns_custom_updated 0
    fi
  3. I set the chmod atributes with this command: chmod a+rx /jffs/scripts/*
  4. WAN -> DDNS -> I enabled the DDNS Client and set the server to Custom. I wasn't as sure what to put for hostname, so I simply put my freedns.afraid.org account name. Don't know if this matters or not. I set the forced refresh days to 1, as I want it to update everyday.
When I click Apply, an indefinite "applying settings ..." prompt comes up. When I go back to WAN -> DDNS, I am greeted with a popup error that states: "Request error! Please try again."

When I go to the system log, I get this on loop every 3o seconds:
Code:
Jan 24 13:38:27 watchdog: start ddns.
Jan 24 13:38:27 rc_service: watchdog 459:notify_rc start_ddns
Jan 24 13:38:27 custom script: Running /jffs/scripts/ddns-start (args: my.ip.add.ress)

So right now I'm kind of stuck, and don't know what else to try, so I figured I'd create an account and ask here. I'd appreciate if anyone could help me or point me in the right direction.

Thanks.
 
Last edited:
I don't know how to fix your issue, but I can tell you how I update afraid.org. I use dnsomatic.com to update both opendns and afraid.org. Then you just need to set up the WAN-DDNS page on your router to use dnsomatic.
 
I don't know how to fix your issue, but I can tell you how I update afraid.org. I use dnsomatic.com to update both opendns and afraid.org. Then you just need to set up the WAN-DDNS page on your router to use dnsomatic.

Excellent, easy workaround, thank you very much. Got an account created, configured the router to update dnsomatic, and for dnsomatic to update freedns.afraid.org in about 5 minutes. Their history tab confirms it worked. Much appreciated!
 
I have the same issue. Thought I'd provide a few more details in case it assists trouble shooting.

It appears the router is having trouble calling the script.

In addition to getting the pop-up error and the logs showing a call every 30s as you have, stated, I'm able to chmod +x the script, and run it manually, and it completes. If I set the Custom DDNS through the GUI, i get a never ending spinner while it attempts to apply. However, if i log in via ssh and manually execute the script, the spinner completes and I get the registration successful message. I have not left the custom DDNS set after that to see if it attempts to endlessly call at renewal time, but i did not see any more ddns script calls for a few minutes in log after the registration successful message.

My script is equivalent to OP's and the wiki, it has +x, runs correctly when called manually via CLI, and I'm on the latest firmware 380.57 on an AC66RT.
 
That is the problem. I did already have the key in and had changed the execute permissions, but the curl command wasn't backgrounding. The examples at https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS and in the OP's code are missing the trailing '&' after the curl command, as you highlighted. I assume as it never reports out and exits clean, so it keeps popping the retry every thirty seconds. When I ran the code manually, I was taking the whole /dev/null redirect out to watch the verbose logging, so it put everything to stdout and went along with its business.

With the & backgrounding the curl command, everything now works as expected and the log isn't filling up with ddns-start calls. I also checked for the duckdns.org example, and adding & allows the script to run there as well.

Thank you, octopus.
 
Last edited:
Sorry to revive thread but it's the exact problem I am having though I have the updated script with the correct syntax (as listed in the wiki) and I get the same error.
I've followed the steps provided and I have a ddns-start script on my router (n66) though I'm not able to run the script manually it just returns not found. Any ideas?
Thanks
 
Sorry to revive thread but it's the exact problem I am having though I have the updated script with the correct syntax (as listed in the wiki) and I get the same error.
I've followed the steps provided and I have a ddns-start script on my router (n66) though I'm not able to run the script manually it just returns not found. Any ideas?
Thanks
show me your script and link/path
 
show me your script and link/path
Thanks for the reply, scrip (my key where KEY is):
Code:
#!/bin/sh

curl -k "https://freedns.afraid.org/dynamic/update.php?KEY" >/dev/null 2>&1 &

if [ $? -eq 0 ]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
Path is /jffs/scripts/ddns-start
 
Thanks for the reply, scrip (my key where KEY is):
Code:
#!/bin/sh

curl -k "https://freedns.afraid.org/dynamic/update.php?KEY" >/dev/null 2>&1 &

if [ $? -eq 0 ]; then
    /sbin/ddns_custom_updated 1
else
    /sbin/ddns_custom_updated 0
fi
Path is /jffs/scripts/ddns-start

Looks good, do not forget to make them executable:
chmod a+rx /jffs/scripts/ddns-start

Enable: Enable JFFS custom scripts and configs
 
Looks good, do not forget to make them executable:
chmod a+rx /jffs/scripts/ddns-start

Enable: Enable JFFS custom scripts and configs

Yup both are set. When I uploaded the script to the router again after checking it I forgot to change the rights for the file (when I went to run it manually) but after I did the router couldn't find the file:

Code:
admin@N66U:/jffs/scripts# ./ddns-start
-sh: ./ddns-start: Permission denied
admin@N66U:/jffs/scripts# ./ddns-start
-sh: ./ddns-start: not found
 
Yup both are set. When I uploaded the script to the router again after checking it I forgot to change the rights for the file (when I went to run it manually) but after I did the router couldn't find the file:

Code:
admin@N66U:/jffs/scripts# ./ddns-start
-sh: ./ddns-start: Permission denied
admin@N66U:/jffs/scripts# ./ddns-start
-sh: ./ddns-start: not found

What do get if you run this:
Code:
cat /jffs/scripts/ddns-start
Do you have /jffs/scripts/ddns-start.sh at the end?
 
What do get if you run this:
Code:
cat /jffs/scripts/ddns-start
Do you have /jffs/scripts/ddns-start.sh at the end?

It returns the script minus the fi line at the end and no I couldn't find any information on whether it should or shouldn't have a .sh file extension so as the wiki didn't specify it and you generally don't use them on linux for scripts I didn't.
 
Okey then all seems right, there should NOT be any .sh at end of file.
Are you behind another modem/router, do you have "public ipaddress?
You have signed up on afraid.org and get 44-charter key?
Log in to afraid.org and se if there is any ip-update.

 
No it's connected through the WAN port to my modem with a public IP address. Yes I'm signed up with afraid and have unique key which I've gotten working temporarily with my PC by using the Direct URL link.
 
No it's connected through the WAN port to my modem with a public IP address. Yes I'm signed up with afraid and have unique key which I've gotten working temporarily with my PC by using the Direct URL link.
Okey, last thing i can think off is your script have CR/LF at end of raw.
eg use Notepad++ and EOL set to Unix-format and save script.
After that im out if ideas.

Did you remember to remove "----- HTTPS -----" at top of script ????
 
Last edited:
*Hits head on desk* Thank you that's fixed it I had UTF-8 encoding but I didn't have the EOL set to UNIX I thought it was set by default but never checked it.
Thank you for helping to solve this.
 
*Hits head on desk* Thank you that's fixed it I had UTF-8 encoding but I didn't have the EOL set to UNIX I thought it was set by default but never checked it.
Thank you for helping to solve this.
Okey nice to find it! :)
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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