Skip to content

Dynamic DNS

Calin Crisan edited this page Jan 19, 2020 · 11 revisions

What's 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 (443 if you use HTTPS) to your device

Obtaining A Domain Name

If you don't already have a dynamic DNS domain name in place, you have a few options to get one.

Your ISP

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

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

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>"
NoIP

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>"
Clone this wiki locally