A domain name problem

DDNS: Part 1 – Dynamic Domain Name System (DDNS) Services

April 13, 2023 by

Sam Houston

Overview

Dynamic Domain Name System (DDNS) services support devices that operate as part of the Internet of Things (IoT). IoT devices include sensors, actuators, controllers, and embedded computers that operate on your private (home) network.

Typically, your home network is connected to the public Internet using a peripheral such as a cable modem that provides you with a single, unique Internet (IP) address. Your cable modem is then connected to your home (wireless) router that uses its own set of private IP addresses for IoT devices connected to it. Your home network is protected, at least in part, from the outside world by your router. What this means, however, is that you cannot normally access IoT devices on your home network from the outside world because your router’s private IP addresses are not meant for public use (see the figure below). In addition, the public IP address of your cable modem can change basically at any time, unless you have paid for what is known as a static IP address that does not change.

Public/private network addressing
Figure 1. Public/private network addressing

DDNS allows you to access IoT devices on your home network from across the Internet by establishing a public (subdomain) name that is associated with your public IP address, and then updates the IP address associated with that name as the IP address changes. You can then use your public name in a web browser (e.g., https://mypublicname.samedayrules.com) to access devices on your home network. Sometimes you’ll need to append a port number to the your public name to facilitate routing within your home network (e.g., https://homecamera.samedayrules.com:49555).

In the diagram above, your home network is known to the outside world (i.e., Internet) as the number 68.10.44.12; that is the IP address of your gateway to the Internet. That IP address can change unless you have paid for service that provides you with a static IP address (most people don’t do this).

Without DDNS, when accessing devices on your home network from across the Internet, you would have to remember the IP address of your home network, and you would have to make sure you knew when the IP address changes so that you could use the new number. Most people may not be able to remember what that number is especially if it changes periodically.

Get Started using Same Day Rules DDNS Services

Each of the numbered headings below is a link to performing that step, just click on the links to get started.

1. Register for an account on the Same Day Rules website

You have to be a registered user in order to use the DDNS service. It takes less than a minute to register, which lets you choose a username that is needed when accessing the DDNS service.

2. Subscribe to the DDNS service

With a subscription you can add several subdomain names of your choosing. Subscribing costs $1/month and that includes up to three (3) subdomain names.

3. Create your DDNS subdomain names

Decide on your subdomain names and simply add them to your account. Add a subdomain for your front door IP security camera, your new game server, or your favorite remotely controlled IoT device.

4. Watch your names spread across the Internet

Once you’ve created your new name(s), you can verify that they are active by using DNS propagation tools. Your new subdomain names are distributed across the Internet automatically, and that takes times. Use one of these tools to see your name travel around the world.

5a. Install the DDNS update client (DUC)

Download and install one of our available automatic update clients to keep your subdomains current. The update client is installed on a computer that is operating on the private (home) network that you want connected to the Internet.

5b. Implement your own DDNS update client using the DDNS API

You can implement your own DDNS update client by issuing commands to our DDNS API. The API is compatible with the Dyn DDNS API, and is easily accessed via curl or your custom HTTP network application.

6. Configure Your Home Router to Port Forward

All home network routers are different, so the exact procedure for setting up port forwarding are different. However, the steps involved are similar:

  1. Login to your home router.
  2. Find the page or section on your router where you can configure port forwarding (not port triggering).
  3. Add a new port forwarding service; you usually have to give the service a name (e.g., HTTPS to Camera).
  4. Specify the external port number where incoming requests will be received (e.g., 49555).
  5. Specify the internal port number where incoming requests will be forwarded (e.g., 59555).
  6. Specify the internal IP address where incoming requests will be forwarded (e.g., 192.168.1.5).
  7. Save your new service and/or apply the new service.

The port numbers above are somewhat arbitrary, but they must not overlap with existing, well-known port numbers. Numbers in the range 49152–65535 are private and are generally available for your use. Sometimes port numbers are specified as a port range with a starting port number and an ending port number, where any request within a range of requests will be forwarded to the given internal IP address.

How It All Works

Once you have subscribed to the DDNS service and you have the service configured, here’s what happens:

  1. The update program on your IoT device recognizes that it is time to act.
  2. The update program sends an update message to the DDNS service that contains your public IP address.
  3. The DDNS service looks to make sure that you are an authorized user of the service (denying unauthorized updates).
  4. The DDNS service then updates the IP address of the subdomain specified in the update message.
  5. Requests that are sent over the Internet to your DDNS subdomain name are looked up by the DDNS service and forwarded to the IP address that was last submitted by the update program. So, when/if your public IP address changes, requests made to your DDNS subdomain will be sent to the correct address.

Modern Home Routers

Some modern home routers have DDNS capabilities built-in such that they can automatically update your public IP address with well-known or customized DDNS service providers. This essentially takes the place of the DDNS IP address update utility program. If your router does offer this capability, then you would likely skip the steps involved in installing and configuring the update program.

Leave a Reply