What's new

DuckDNS Setup

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

hawke84

Occasional Visitor
Hi,
Just got myself a new RT-AC66U router and DD-wrt seems to be particularly flaky on this router so i found Asusmerlin.

im struggling setting up a custom DNS, I'm trying to setup Duckdns but i cant figure out how to create a custom script.

i've gone through the wiki and searched the forum and I cant really find anything that has helped, im noob-ish, ive not really used shh or telnet before but i can do it with a list of commands.

thanks
 
Must you have Duckdns? I also came to Asus after having DDWRT on my Linksys as well as Duckdns for my dynamic DNS. Setting up Duckdns would have been far too difficultl on my Asus router, so I ditched it in favour of Asus' own DDNS. Go to the WAN page and the DDNS tab and set up your asuscomm.com domain. After your experience with DDWRT and Duckdns, you won't believe how easy and quick it is. And you may well spend time looking for additional non-existent settings not realising you have already set up your Asus DDNS account. I've used it now for over 6 months without the slightest glitch.

You'll soon come to appreciate why, after Asuswrt-Merlin, you could never go back to something like DDWRT.
 
I setup the DDNS using the free asus system, and then made a CNAME record in my preferred domain name I use and pointed it to the new asus one. Was easiest that way for me.


Sent from my iPad using Tapatalk
 
Hi,
Just got myself a new RT-AC66U router and DD-wrt seems to be particularly flaky on this router so i found Asusmerlin.

im struggling setting up a custom DNS, I'm trying to setup Duckdns but i cant figure out how to create a custom script.

i've gone through the wiki and searched the forum and I cant really find anything that has helped, im noob-ish, ive not really used shh or telnet before but i can do it with a list of commands.

thanks

Hello,
if you want to stick to your specific DDNS provider, an idea would be to make use of the possibility to run a script whenever your public ip changes, i.e.the "wan-start" script, where you can make a call to the duck.sh script (the one mentioned on the duckdns website and that does the needed update).
for more info on wan-start script, see here : https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

GS
 
Thanks for the replies, I would like to try and get DuckDNS working as ive given the address to a lot of people for my FTP server and i've linked it in a lot of places. @GSpock, is there any more of a noob guide on how to create and add a script to the router, i dont know enough about telnet / ssh to create and add a script to the box :(
thanks
Hawke84
 
.... well, then it is going to be a bit diffcult .... google search for putty and notepad++ (the native editor on the router is "vi", but I would not recommend it if you are not used to it) .....
 
i'll give it a go and maybe write a little tutorial in here for anyone else in a similar situation who finds this thread... im used to android adb so im hoping it will be similar :rolleyes:
 
i'll give it a go and maybe write a little tutorial in here for anyone else in a similar situation who finds this thread... im used to android adb so im hoping it will be similar :rolleyes:

You can always keep coming back with questions when you run into something you don't understand or when you've written out a plan including the script and you want it double checked. I, for one, would be interested in seeing the eventual tutorial.
 
I setup the DDNS using the free asus system, and then made a CNAME record in my preferred domain name I use and pointed it to the new asus one. Was easiest that way for me...

I'd not come across CNAME before, so I was interested to discover that. Thanks. Exactly how, in detail, and as an example, would hawke84 go about it, given the initial requests go to, let's say, hawke84.duckdns.org and he wants them redirected to, again let's say, hawke84.asuscomm.com?
 
i'll give it a go and maybe write a little tutorial in here for anyone else in a similar situation who finds this thread... im used to android adb so im hoping it will be similar :rolleyes:

The Wiki

https://github.com/RMerl/asuswrt-merlin/wiki

examples have step by step instructions... e.g. Networking How to Guide #9 has an extremly comprehensive tutorial if you are using a Windows PC to access the router.

Extract from the Wiki tutorial:

Code:
STEP F:

Now you need to log on to your router using winSCP. You will need to have SSH enabled on your router. To enable SSH on Merlin do this:

    Under “Advanced Settings” on the left bar click “Administration”.

    Under “Miscellaneous” make sure these are set as follows:

    Enable SSH - Yes

    Allow SSH Port Forwarding - No

    SSH service port - 22

    Allow SSH access from WAN - No

    Allow SSH password login - Yes

    Enable SSH Brute Force Protection - No

    After you made the changes hit apply.

STEP G:

Please read Final Notes before copying scripts to the router.

You are now ready to copy the scripts you created to the router:

    Download winSCP
    Install WinSCP then start it up.
    To make a new connection fill in the fields as follows: File Protocol – SCP (NOTE: MAKE SURE IT IS SET TO SCP) Hostname: 192.168.xx.x replace x with values of your routers IP address Username/Password:   Whatever you use to login to the router Port 22
    Save login settings and then hit Login.
    This will log you into your router. There will be two folder trees. On the right is your routers folder tree.
    In the router folder tree, you need to go up to the root folder, where you will see the jffs folder under the root.
    double click on the JFFS Folder then double click the Scripts Folder.
    Navigate on the left folder tree and find the scripts you created. Drag the openvpn-event to the this folder (/jffs/scripts). test script and then copy firewall-start file
    Once the file is copied, right click > Properties > Change Octal to 0777
    Close WinSCP.
    Reboot Router.
 
......
Navigate on the left folder tree and find the scripts you created. Drag the openvpn-event to the this folder (/jffs/scripts). test script and then copy firewall-start file
......
[/CODE]

Hope you don't mind: 2 questions:

1. How do you "test script"?
2. I know you kindly copied this from the wiki as an example of using WinSCP to access the router and transfer a script across in general, so I take it that "then copy firewall-start file" is not relevant to the case you were illustrating (WinSCP access in general), though of course it is relevant for the specific wiki example?


(By the way, any idea why they say No to enable ssh brute force protection? I would have thought you'd want that? Indeed, I have it selected.)
 
Hope you don't mind: 2 questions:

1. How do you "test script"?
2. I know you kindly copied this from the wiki as an example of using WinSCP to access the router and transfer a script across in general, so I take it that "then copy firewall-start file" is not relevant to the case you were illustrating (WinSCP access in general), though of course it is relevant for the wiki example?


(By the way, any idea why they say No to enable ssh brute force protection? I would have thought you'd want that? Indeed, I have it selected.)

Usually the Wiki entries are appropriate for that submitter, although I too have left the default ' SSH brute Force protection=NO'

When testing simply right-click the file then select 'custom commands->execute' and the file should run..you may get a dialog box with 'error' messages although in my experience a return code of 0 can sometimes erroneously show the dialog box.
NOTE: This technique relies on using 'logger' statements in the script to provide an audit trail in the Syslog.

WinSCP does allow a simple terminal console to be opened for testing:

e.g. Click the 'Commands' menu item then select 'Open Terminal' and you should be able to test your script xxxxxxxx in the WinSCP console window

./xxxxxxxx

NOTE: There are restrictions using this WinSCP console.

Alternatively, (if you have PuTTY installed and defined to WinSCP?) click the 'Commands' menu item then select 'Open in PuTTY', then at the command prompt issue

cd /jffs/scripts

then ./xxxxxxxx

where xxxxxxx is the name of the script.
 
Last edited:
If you must use telnet, try this:

telnet 192.168.1.1
user: admin
password: admin
cat /jffs/scripts/ddns-start
cat > /jffs/scripts/ddns-start
Now copy script to clipboard and paste into the telnet window.
CTRL-D to save changes
CTRL-C to exit without saving changes
chmod a+rwx /jffs/scripts/ddns-start
exit
 
Last edited:
Hello,
if you want to stick to your specific DDNS provider, an idea would be to make use of the possibility to run a script whenever your public ip changes, i.e.the "wan-start" script, where you can make a call to the duck.sh script (the one mentioned on the duckdns website and that does the needed update).
for more info on wan-start script, see here : https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

GS

Don't use wan-start, there's a specific script for DDNS updates.

https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS
 
I'd not come across CNAME before, so I was interested to discover that. Thanks. Exactly how, in detail, and as an example, would hawke84 go about it, given the initial requests go to, let's say, hawke84.duckdns.org and he wants them redirected to, again let's say, hawke84.asuscomm.com?

I dont use DuckDNS so I dont know how to add a CNAME in thier interface specifically but here is the wikipedia aricle about CNAME records: http://en.wikipedia.org/wiki/CNAME_record

Pretty much I just setup the asuscomm.com as normal, very simple setup. Then I went to my namecheap account and added a CNAME record to a domain I own that points to the asuscomm.com domain. [ex: router.mydomain.com. CNAME myname.asuscomm.com.]
 
This is as fas as i've got so far. I stole this from somewhere else and been trying to modify it:
services-start
Code:
#!/bin/sh

/usr/sbin/cru a ScheduledReboot "0 7 * * * reboot"
/usr/sbin/cru a ScheduledDDNS "5 1,3,5,7,9,11,13,15,17,19,21,23 * * * /jffs/scripts/up.sh"

up.sh
Code:
#!/bin/sh

while [ ! -n  "`ifconfig | grep tun11`" ]; do
    sleep 1
    done

    SERVICE="duckdns"
    USER="xxxxx"
    PASS="xxxxx"
    HOST="http://www.duckdns.org/update?domains=xxxxx&token=xxxxx"
    IP=$(wget -qO - http://icanhazip.com)

    ez-ipupdate -S $SERVICE -u $USER:$PASS -h $HOST -a $IP

    exit 0

doesnt work yet but im making headway :)
 
with duck dns seems that if you enter the address in browser with username and password it just brings up the page saying "ok" so im assuming i'll just need my script to visit the page and it will get the username and password at duckdns' end?

im trying something different, this is my script:
Code:
#!/bin/sh

wget -q https://www.duckdns.org/update?domains=xxxxx&token=xxxxx -O - >/dev/null

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

this is my error:
Code:
Command '"./ddns-start"'
failed with return code 127 and error message
-sh: ./ddns-start: not found.
 
Last edited:
Did you remember to mark your script as executable?
Are you sure it's in Linux format (not DOS/Windows format)? Open the ddns-start script on the router in 'vi' and check there are no CR chars (^M).
 
Did you remember to mark your script as executable?
Are you sure it's in Linux format (not DOS/Windows format)? Open the ddns-start script on the router in 'vi' and check there are no CR chars (^M).
yep done in notepad++ i've managed to get the script to run ok but its not updating mydns, i've manually changed myip to 111.111.111.111 so i can see when it gets corrected and so far it records success but no update.

script that runs ok:

Code:
#!/bin/sh
wget -qO - http://www.duckdns.org/update?domains=xxxxxx&token=xxxxx
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi

as I say duckdns returns "ok" for success and "ko" for not, not sure if that affects things?
 

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