Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 1.75 KB

20180911-bonusEn-2+DNS.md

File metadata and controls

47 lines (39 loc) · 1.75 KB

Bonus: two (or more) DynDNS domains

Some months after I wrote this tutorial, I needed to add another DynDNS domain to my router. With a quick search, I found that the best solution for me was to use DNS-O-Matic. To make this work, simply add your DynDNS providers in the web interface.

Interface DNS-O-Matic

And then modify the script given in point 4.2. with this command:

vi /jffs/scripts/ddns-start

Replace every line by:

#!/bin/sh
# Update the following variables:
USERNAME=dnsomatic_username
PASSWORD=dnsomatic_password
HOSTNAME=all.dnsomatic.com

# Should be no need to modify anything beyond this point
/usr/sbin/curl -k --silent -u "$USERNAME:$PASSWORD" "https://updates.dnsomatic.com/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=" > /dev/null
if [ $? -eq 0 ]; then
  /sbin/ddns_custom_updated 1
else
  /sbin/ddns_custom_updated 0
fi

Now, to get the certificate with this particular situation, you just have to modify the acme.sh commands like this:

  • Issue the cert:
./acme.sh  --server letsencrypt --issue  \
-d domain1.ovh  --dns dns_ovh \
-d *.domain1.ovh  --dns dns_ovh \
-d *.domain2.duckdns.org --insecure --dns dns_duckdns
  • Install the cert in nginx:
./acme.sh --install-cert \
-d domain1.ovh -d domain2.duckdns.org \
--key-file  /opt/etc/nginx/cert.key \
--fullchain-file  /opt/etc/nginx/cert.crt \
--reloadcmd "nginx -s reload"