-
Notifications
You must be signed in to change notification settings - Fork 1
Dynamic DNS
In a nutshell, dynamic DNS allows you to access your device from the Internet even if your IP address changes from time to time.
A DNS domain name refers to (in this context) the dotted address that you type in your browser to access websites. A dynamic DNS service allocates you a unique (fully qualified) domain name for your IP address.
Unfortunately, a DNS domain name is not enough for you to access the device that lives inside your local network from the Internet. You'll also need to make sure you have:
- a public (aka routable) IP address, whether static or dynamic
- a port forwarding rule set up on your router that forwards incoming traffic on port
80
(and also443
if you use HTTPS) to your device
If you don't already have a dynamic DNS domain name in place, you have a few options to get one.
Some Internet service providers offer dynamic DNS services for their customers. It may be worth contacting your ISP and asking for the availability of such a service.
DuckDNS is a free, simple and straight forward dynamic DNS service. Once your account is registered, it will give you up to 5 domain names of the following form: <subdomain>.duckdns.org
. You'll also need the token that is shown on their homepage.
In order to keep your dynamic DNS up-to-date, create the /data/etc/dyndns-update.sh
file and place the following DNS command inside:
curl -Ssf "https://www.duckdns.org/update?domains=<subdomain>.duckdns.org&token=<token>"
Afraid.org is a fully fledged DNS service that also offers free dynamic DNS.
The update URL can be found under Dynamic DNS > Direct URL. Just copy the link and add it to /data/etc/dyndns-update.sh
:
curl -Ssf "http://freedns.afraid.org/dynamic/update.php?<yourtoken>"
For NoIP, you'll need your username, password and full domain name to form the following command and add it to /data/etc/dyndns-update.sh
:
curl -Ssf "http://<yourusername>:<yourpassword>@dynupdate.no-ip.com/nic/update?hostname=<yourdomain>"
To use your dynamic DNS domain name, simply point your browser to the given domain name, using http
or https
, depending on whether you have configured HTTPS or not.
For example, when using a DuckDNS
with a subdomain called john-home
and HTTPS enabled, your URL would be:
https://john-home.duckdns.org
You may also want to check out the thingOS wiki page on Dynamic DNS.