The Synology DSM has a handy built-in updater for dynamic DNS (DDNS). It makes a lot of sense, given the Synology is always on and connected to the internet, keeping a custom domain pointed to the right IP at all times.
Most people who followed this headline already know these definitions, but just to recap: dynamic DNS allows a fully qualified domain name like “example.com” to point to an IP address that changes regularly, as most home ISPs do. Unless you’re paying for a static IP, your IP is changing now and then, defeating any custom domains you point to it.
Synology’s DDNS integration comes with presets for quite a few services, but most of the free ones don’t allow you to use custom domain names, just subdomains of domains like “synology.me” or “zapto.org”. I wanted to use something short and personalized (because I’m lazy and vain, I guess).
I already had some unused domains registered with Namecheap, which offers DDNS for your domains, but Synology didn’t have a preset for it. In a lot of cases you can use the DSM to create a custom DDNS, using a URL with __PLACEHOLDERS__ in it. Namecheap doesn’t offer a URL you can curl, though, and using dynamicdns.park-your-domain.com doesn’t work with that (I’m not sure why). The good news is that it’s pretty easy to add your own Namecheap service provider to your Synology.
I found a few existing solutions for this but each of them had some failing. This solution is what I distilled from multiple sources, simplified, and currently have working.
First, register the domain you want to use with Namecheap and go to the Advanced DNS configuration for the domain. Ensure that there’s a an A record for the “@” wildcard.
Namecheap Advanced DNS
If you want to use a subdomain as your dynamic host (e.g. “home.example.com”), add a record for it by clicking “Add New Record”, selecting A Record, and entering the subdomain (just “home” in the previous example). The IP address here doesn’t matter, the script we’ll set up will be updating that.
Scroll down to Dynamic DNS, toggle the switch to enable it, and note/copy the password it shows you, we’ll use that in step 6.
For this next part, you’ll need SSH access to your Synology, which you can enable with Control Panel->Terminal & SNMP.
As an aside, I highly recommend changing the default SSH port, setting up keys, and disabling password login. Also set your Control Panel->Security setting to the highest level. Especially once you have a public domain associated with your IP, you’ll get your ports scanned frequently, and there will be regular brute force login attempts.
Now, add a little script that will handle pinging an update URL with your credentials and IP. Save this script to /usr/local/bin/namecheap_ddns.sh on your Synology:
#!/bin/bash## Namecheap DDNS updater for Synology## Brett Terpstra <https://brettterpstra.com>PASSWORD="$2"DOMAIN="$3"IP="$4"PARTS=$(echo$DOMAIN | awk'BEGIN{FS="."} {print NF?NF-1:0}')# If $DOMAIN has two parts (domain + tld), use wildcard for hostif[[$PARTS== 1 ]];then
HOST='@'DOMAIN=$DOMAIN# If $DOMAIN has a subdomain, separate for HOST and DOMAIN variableselif[[$PARTS== 2 ]];then
HOST=${DOMAIN%%.*}DOMAIN=${DOMAIN#*.}fi
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")if[[$ERR-gt 0 ]];then
echo"badauth"else
echo"good"fi
Make it executable with chmod a+x /usr/local/bin/namecheap_ddns.sh.
Next, we need to add the provider to the DSM configuration. You’ll need to be root to do this, so run sudo -i and enter your admin account’s password. Now edit the file at /etc.defaults/ddns_provider.conf. I have Vim installed on my Synology, but I can’t remember if it’s included by default or I added it. Use whatever you have handy, or use cat redirection to do it (copy and paste the whole block below at once):
Go back to your Synology DSM and open Control Panel->External Access->DDNS. Click Add and you should see Namecheap in the Service Provider dropdown. Select it and enter your custom domain (including subdomain if you set that up) in the Hostname field. Username isn’t needed in our script, just paste your password from step 2 in the Password/Key field. Click “Automatic Setup” next to External Address to enter your current public IP.
Click the Test Connection button to see if everything is working. Click OK to save.
Assuming you see Normal under the Status column, you’re now updating your custom domain with your public IP. It may take a bit for it to propagate initially, but once it does, you can access Synology DSM, Synology Drive, Filestation, and all of your packages using your custom domain and the appropriate ports. If you head to Control Panel->Security->Certificate, there’s even a wizard for adding a Let’s Encrypt SSL certificate for your new domain, allowing you to use https connections for everything.
Hope that’s useful to some Synology users out there, it was definitely a fun little hack for me.
alhow.com mentioned this: The more important the online account, the more vulnerable it is to attack, such as a financial account. The trick to protecting your account is not to ignore any suspicious details until you confirm that your login environment is secure. For example: a change in the web page logo or a hint from security software. Here is the information about namecheap synology ddns az :
Set up Namecheap.com DDNS in Synology DSM | en.code-bude.net
https://en.code-bude.net/2022/02/17/set-up
Feb 17, 2022 Step 3 Add Namecheap to Synology DDNS. Now we just have to setup the call of our PHP script in the Synology DSM. To do this, we log in to the DSM, open the Control Panel and go to the External Access section and there to the DDNS tab. There we click on Customize Provider to add our PHP script as a new provider.
Add Namecheap To Synology Ddns Get 80% OFF Today
https://www.conceptwebjg.net/add-namecheap-to-synologyddns
Namecheaps head office is situated in Phoenix (Arizona, the USA) from where
([-])
alhow.com mentioned this: The more important the online account, the more vulnerable it is to attack, such as a financial account. The trick to protecting your account is not to ignore any suspicious details until you confirm that you ([+])
Elas mentioned this: Compartir la entrada "Aadir namecheap al men nativo DDNS de tu NAS Synology"
FacebookTwitterWhatsAppCorreo electrnicoBookmarkImprimirCompartirDe manera nativa no tiene muchas opciones, aunque hay maneras de usar un servicio externo con docker o aplicaciones de la comunidad para instalar en synology, esta es otra manera mas
Primero he configurado la zona DNS de namecheap, en mi caso uso un registro @ y varios subdominios con registros de tipo A, a la hora de crearlos puedes poner una ip como por ejemplo 8.8.8.8, cuando este todo funcionando se cambiara automaticamente a tu ip pblica:
Luego crearemos el script en el NAS, debemos entrar por SSH al NAS, para activarlo vamos al panel de control de nuestro NAS y en el apartado conectividad activamos el servicio SSH, cuando terminemos recuerda desactivarlo:
Entramos por ssh al NAS, puedes usar PuTTY en windows o la terminal si usas linux, yo entro con mi login de usuario de synology y luego paso a root con el comando, te pide e
([-])
Elas mentioned this: Compartir la entrada "Aadir namecheap al men nativo DDNS de tu NAS Synology" FacebookTwitterWhatsAppCorreo electrnicoBookmarkImprimirCompartirDe manera nativa no tiene muchas opciones, aunque hay maneras de usar u ([+])
Brett Terpstra
Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff on GitHub, Mastodon, and elsewhere.