Synology usage series 20 – Using your own domain name with

Step 5 – Setup dynamic DNS client on NAS

Now both registrar and dynamic DNS provider is setup probably.

The final step is to install DDNS client so that our DNS record is updated for every IP address changes.

There are lots of ddns client provided on

Following types of client is provided

  • DD-WRT router client
  • Tomato router client
  • Windows client
  • Unix client
  • etc

If none of them works for you (hmmm… ) , you may want to try the simple client written by me below.

  1. SSH to the NAS as root
  2. Install wget and bash shell
    # ipkg update
    # ipkg install bash
    # ipkg install wget
    # ipkg install dos2unix
  3. Copy the script below and paste to notepad. Modify your own code and verify all the path highlighted in red. Save it to a share folder on the NAS, i.e. public. Save the file as
    # simple script to update for ip changes
    # version 0.21
    # Copyrighted by Ray Chan 2011
    # pre-requistics
    # - wget
    # - bash
    # If you want a simple log file, assign 1 to log_enabled, otherwise set it to 0
    log_enabled=1; #0=disable, 1=enable
    # date format used by log file
    datestamp=`date '+%Y-%m-%d %H:%M:%S'`
    #input the freedns dynamic domain code here
    # the actual command getting the public IP, change the URL to your php hosting
    myipnow=`wget --timeout=10 --tries=1 -qO -`
    # path of the log file, ignore if log_enabled=0
    # path of the temporary file storing prevoius ip address
    if [ -f $iplog ]; then
    	previp=`cat $iplog`
    if [ $myipnow != $previp ]; then
    	# update to
    	wget --read-timeout=0.0 --waitretry=5 --tries=400 -qO -$freednscode > /dev/null
    	#write the new ip to log file
    	echo $myipnow > $iplog
    	#write to log if enabled
    	if [ $log_enabled = 1 ]; then
    		echo "$datestamp IP changed, updating ddns. [ $previp | $myipnow ]" >> $logfile
  4. Move the script to /usr/local/bin

    # mv /volume1/public/ /usr/local/bin

  5. convert the script to unix format

    # cd /usr/local/bin
    # dos2unix

  6. Make the script executable, and read only by root
    # chmod  700 /usr/local/bin/
  7. Add a scheduled job (cron) to the NAS so that the script will be executed per 5 minutes in order to detect IP changes
    # vi /etc/crontab

    Add follow entries to the end of the crontab file

    #minute hour    mday    month   wday    who     command
    */5       *       *       *       *       root    /opt/bin/bash /usr/local/bin/
  8. Restart crontab
    # /usr/syno/etc/rc.d/ stop
    # /usr/syno/etc/rc.d/ start

Step 6 – Add port forwarding from broadband router for external access.

In order to access different NAS services from external network, you need to setup port forwarding in your broadband router. Most of the other articles here have description about setup port forwarding for linksys router. I will not repeat here again.

Following is some common ports you might want to forward to your NAS.

80 – web station, web mail (mail station), photo station
443 – web station with ssl encryption
7001 – file station
22 – ssh
5000, 5001 – control panel (DSM)
21, 55536-56559 – ftp

Now your own domain name (i.e. is attached to your dynamic IP! You can always access your diskstation using your domain name: (access the web station) (access the control panel) (ftp to your nas)

** If you are using as described above, and you are satisfied with their services, please consider make a donation to show your appreciation of their services. Indeed, free services rely on donation to cover the daily operation cost. Please consider being a paid member 🙂

** DNS changes can take up to 48 hours to propagate. New domain name changes, however, may effect almost instantly. Please be patient if you DNS is not working yet.

3 thoughts

    • It’s working on my 207+ and 101j. Double verify your setup, even a single little typo can break things. Or you may want to try other ddns client which you find on the

Leave a Reply

Your email address will not be published. Required fields are marked *