One callout: make sure you download the namecheap_ddns.sh script directly from github. I know you can copy from this page directly, but I ran into an issue where I copied the script into Notepad++, saved, and must have gotten some hidden characters included, which failed the script on the last step. It was honestly probably user error, but just in case anyone runs into the same issue in the future:
Click on the "this script" link above, when it directs to github, right click on "Raw" > Save link as > namecheap_ddns.sh (make sure you save without any file extensions!). Then copy it over from your NAS folder into the /usr/local/bin/ directory.
Otherwise, this worked perfectly on my DS920+! This was an easy to follow guide, thanks Brett! 👍
One callout: make sure you download the namecheap_ddns.sh script directly from github. I know you can copy from this page directly, but I ran into an issue where I copied the script into Notepad++, saved, and must have gotten some hidden characters included, which failed the script on the last step. It was honestly probably user error, but just in case anyone runs into the same issue in the future:
Click on the "this script" link above, when it directs to github, right click on "Raw" > Save link as > namecheap_ddns.sh (make sure you save without any file extensions!). Then copy it over from your NAS folder into the /usr/local/bin/ directory.
Otherwise, this worked perfectly on my DS920+! This was an easy to follow guide, thanks Brett! 👍
Ok so for the life of me I can't up the file into the the /usr/local/bin folder. Every time I try, I get this error returned in terminal: Could not chdir to home directory /var/services/homes/.
Using terminal ain't my strong suit, so what I'm doing is this:
scp [file/location/on/local/computer] root@ipaddress:/usr/local/bin
I tried moving the file onto the Synology and copying it from there, and was originally using my admin login but it failed there along with using root as my username.
Any ideas?
When you paste the script code it has an extra space at the beginning of every line. Remove those and it works fine. Same with the addition to ddns_provider
This doesn't seem to work now - the script returns good but in the DDNS console I just get the Failed result. Annoying as DNS-O-Matic now doesn't seem to support legacy authentication so the DNS-O-Matic DDNS entry no longer works even after it is unhidden.
## Namecheap DDNS updater for Synology
## Brett Terpstra https://brettterpstra.com
## Poorly Modified by Al Manint
## All I did was modify this script and stuck it in a cron job that runs every 5 minutes - basically what the synology is doing from what I can tell.
PASSWORD="put key here"
DOMAIN="home.almanint.com"
IP=$(dig +short myip.opendns.com @resolver4.opendns.com)
CURRENTIP=$(dig +short home.almanint.com)
echo $IP
echo $CURRENTIP
PARTS=$(echo $DOMAIN | awk 'BEGIN{FS="."} {print NF?NF-1:0}')
# If $DOMAIN has two parts (domain + tld), use wildcard for host
if [[ $PARTS == 1 ]]; then
HOST='@' DOMAIN=$DOMAIN
# If $DOMAIN has a subdomain, separate for HOST and DOMAIN variables
elif [[ $PARTS == 2 ]]; then
HOST=${DOMAIN%%.*} DOMAIN=${DOMAIN#*.}
fi
if [[ "$IP" != "$CURRENTIP" ]]; then
RES=$(curl -s "https://dynamicdns.park-your-domain.com/update?host=$HOST&domain=$DOMAIN&password=$PASSWORD&ip=$IP")
ERR=$(echo $RES | sed -n "s/.<ErrCount><\/ErrCount>./\1/p")
fi
echo $RES
if [[ $ERR -gt 0 ]]; then
echo "badauth"
else
echo "good"
fi
Hello, have some trouble to get this running, manual execution in SSH is working fine but DSM seems to reject the results without any further debug info.
Isn't there a setup error in the ddns_provider.conf?
you create a file names namecheap_ddns.sh but you link to namecheap.sh in the conf?
Thanks Brett! I followed all the steps pretty painlessly. Upon testing the Namecheap DDNS, I get this error: Unable to perform this operation. Please contact Synology Technical Support.
. Any idea why?
I'm sure there are a lot of things that could go wrong. My first instinct would be to test the script from the command line and see if it returns any errors. Run /usr/local/bin/namecheap.sh empty [PASSWORD] [DOMAIN] [IP]
, replacing the bracketed bits with the correct info and see if the script runs successfully when called directly.
I just noticed one potentially confusing part of the instructions... when you add the lines for the module to /etc.defaults/ddns_provider.conf
, be sure that you're not including the cat >>
and EOF
at the beginning and end. The code block is designed to be run as a command, but the instructions don't make it obvious that it shouldn't just be pasted into the file as is.
Thanks Brett, really appreciate you following up. Running the script returned good
, so looks like I have everything set up properly. Also the cat
part was clear to me, but thank you for looking at potential gaps.
Still no luck setting up the DDNS though. 😔
load more (1 remarks)