{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/delegating-a-subdomain-to-he-dns-for-ddns","result":{"data":{"allGhostPost":{"edges":[{"node":{"title":"Delegating a Subdomain to Hurricane Electric DNS for Dynamic DNS","html":"
    \n
  1. Register at https://dns.he.net/
  2. \n
  3. 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.
    \n
  4. \n
  5. Add the subdomain as a new domain in the HE DNS control panel.
  6. \n
  7. Create an A record that will be used as the dynamic hostname, making sure to check Enable entry for dynamic dns
    \n
  8. \n
  9. 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.
  10. \n
  11. Create a bash script that will be run periodically to update the record.
  12. \n
\n
#!/bin/sh\ncurl "https://dyn.dns.he.net/nic/update" -d "hostname=homeserver.ddns.domain.com" -d "password=KEY_FROM_STEP_5" --cacert /var/cacert-\nroot.crt\n
\n
    \n
  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. \n
  3. Add a cronjob: */30 * * * * /home/kamal/ddns/update.sh >/dev/null 2>&1
  4. \n
\n","published_at":"2018-01-05T21:30:37.000+02:00","slug":"delegating-a-subdomain-to-he-dns-for-ddns","tags":[],"plaintext":"1. Register at https://dns.he.net/\n 2. Delegate a subdomain to HE.net. Add three NS records with any subdomain (I\n used ddns) as the name and ns2-4.he.net as the targets. \n 3. Add the subdomain as a new domain in the HE DNS control panel.\n 4. Create an A record that will be used as the dynamic hostname, making sure to\n check Enable entry for dynamic dns \n 5. Click on the refresh sign under the DDNS column to generate a new key. Enter\n a preferably long random string or use the provided generator. Copy the key.\n 6. Create a bash script that will be run periodically to update the record.\n\n#!/bin/sh\ncurl \"https://dyn.dns.he.net/nic/update\" -d \"hostname=homeserver.ddns.domain.com\" -d \"password=KEY_FROM_STEP_5\" --cacert /var/cacert-\nroot.crt\n\n\n 7. The API uses a CACert certificate which most likely isn't trusted by your OS\n by default. So, you will need to grab the Root Certificate from their\n website [http://www.cacert.org/index.php?id=3] and store it in \n /var/cacert-root.crt.\n 8. Add a cronjob: */30 * * * * /home/kamal/ddns/update.sh >/dev/null 2>&1","meta_description":null}}]}},"pageContext":{"slug":"delegating-a-subdomain-to-he-dns-for-ddns","prev":"using-a-linux-server-for-windows-10-backups","next":"to-do-lists-simplicity-is-key"}},"staticQueryHashes":["3649515864"]}