Topic: https://brettterpstra.com/2021/08/26/custom-urls-for-your-synology-with-namecheap/
hide preview

What's next? verify your email address for reply notifications!

unverified 1y, 337d ago

Thank you. This worked for me on DSM 7.1

hide preview

What's next? verify your email address for reply notifications!

unverified 2y, 168d ago

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

hide preview

What's next? verify your email address for reply notifications!

unverified 2y, 168d ago

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

hide preview

What's next? verify your email address for reply notifications!

unverified 2y, 227d ago

Thanks Brett Used your suggestion. Used my own domain name. Worked great.

hide preview

What's next? verify your email address for reply notifications!

unverified 2y, 319d ago

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?

hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 29d ago

You say to copy script to /usr/local , then execute it from /usr/local/bin in the ddns config file.

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 27d ago

At no point does it say /usr/local and not /usr/local/bin. The line may be breaking, but the path appears to be correct all the way through.

hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 91d ago

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

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 90d ago

Wow, I never noticed Jekyll was doing that. Only seems to be happening to fenced code blocks within nested lists, but I hacked together a fix to outdent all code fully before publishing. Hopefully saves a few headaches for readers.

hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 100d ago

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.

remark link
hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 93d ago

## 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

hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 145d ago

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?

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 145d ago

Ooh, yeah, my mistake. The conf should link to namecheap_ddns.sh.

hide preview

What's next? verify your email address for reply notifications!

unverified 3y, 185d ago

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?

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 185d ago

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.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 185d ago

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.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Jonathan 3y, 184d ago

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. 😔

remark link parent

load more (1 remarks)
hide preview

What's next? verify your email address for reply notifications!

Brett 3y, 183d ago

I assume Synology keeps logs of these errors, but I'm not sure where to look. Is it giving you that error as soon as you hit the test button?

hide preview

What's next? verify your email address for reply notifications!