Dynamic DNS

Revision as of 22:34, 6 December 2025 by Arnecc (talk | contribs) (Created page with "[https://en.wikipedia.org/wiki/Dynamic_DNS Dynamic DNS] (DDNS) is a method that automatically updates name server records with current information such as hostnames and IP addresses. This is particularly useful for users hosting services on a home network with a dynamic public IP address, which can change over time due to ISP policies or network restarts. By using DDNS, users can maintain consistent access to their services over the internet via a fixed domain name, eve...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Dynamic DNS (DDNS) is a method that automatically updates name server records with current information such as hostnames and IP addresses. This is particularly useful for users hosting services on a home network with a dynamic public IP address, which can change over time due to ISP policies or network restarts.

By using DDNS, users can maintain consistent access to their services over the internet via a fixed domain name, even as their IP address changes. The DDNS client software or service detects IP changes and promptly updates the DNS records to ensure reliable remote connectivity.

There are many options to choose from, some are provider specific.

Confiuration example

One easy to setup DNS updater is ddns-updater. It may be configured like so:

❄︎ /etc/nixos/hardware-configuration.nix
services.ddns-updater.enable = true;
      services.ddns-updater.environment = {
        SERVER_ENABLED="no";
        CONFIG_FILEPATH = "/etc/ddns-updater/config.json";
        PERIOD = "5m";
      };

Where CONFIG_FILEPATH should correspond to the location of your config.json file.

The following is an example for Porkbun. Consult the documentation of your DNS provider for proper formatting and make sure to enable API access if needed.

≡︎ config.json
{
 "settings": [
    {
      "provider": "porkbun",
      "domain": "1234567890abcdefg1234567890",
      "api_key": "pk1_1234567",
      "secret_api_key": "1234567890abcdefg1234567890"
    },
    {
      "provider": "porkbun",
      "domain": "subdomain.domain.example",
      "api_key": "pk1_1234567890abcdefg1234567890",
      "secret_api_key": "sk1_1234567890abcdefg1234567890"
    }
  ]
}

You can verify proper operation using journalctl -u ddns-updater.service. Note that previous manual DNS entries might not be overwritten using this tool and need to be deleted first.