Kamal Nasser

Delegating a Subdomain to Hurricane Electric DNS for Dynamic DNS

January 01 2018 post

  1. Register at https://dns.he.net/
  2. Delegate a subdomain to HE.net. Add three NS records with any subdomain (I used ddns) as the name and ns2-4.he.net as the targets.
  3. Add the subdomain as a new domain in the HE DNS control panel.
  4. Create an A record that will be used as the dynamic hostname, making sure to check Enable entry for dynamic dns
  5. Click on the refresh sign under the DDNS column to generate a new key. Enter a preferably long random string or use the provided generator. Copy the key.
  6. Create a bash script that will be run periodically to update the record.
#!/bin/sh
curl "https://dyn.dns.he.net/nic/update" -d "hostname=homeserver.ddns.domain.com" -d "password=KEY_FROM_STEP_5" --cacert /var/cacert-
root.crt
  1. The API uses a CACert certificate which most likely isn't trusted by your OS by default. So, you will need to grab the Root Certificate from their website and store it in /var/cacert-root.crt.
  2. Add a cronjob: */30 * * * * /home/kamal/ddns/update.sh >/dev/null 2>&1