Skip to content

Configuring DuckDNS dynamic DNS on the Ubiquiti USG

Last updated on August 31, 2024

I have a remote USG deployed at a relative’s house and need to have a way to access the UniFi Security Gateway’s WAN IP if the ISP changes it.

Steps to implement

  1. Create a user account on www.duckdns.org. This will generate a new user token. Save this as you will need it later and don’t share this.
  2. Create a subdomain on www.duckdns.org
  3. Go to your UniFi controller and set up a config.gateway.json file, instructions here.
  4.  Add the below configuration to this file. Replace SUBDOMAIN with just the subdomain of your duckdns site and replace TOKEN from your account token.
  5. Go to your UniFi Controller and reprovision your USG. Your dynamic DNS should now be working
{
  "service": {
    "dns": {
      "dynamic": {
        "interface": {
          "eth0": {
            "service": {
              "dyndns": {
                "host-name": [
                  "SUBDOMAIN"
                ],
                "login": "nouser",
                "password": "TOKEN",
                "server": "www.duckdns.org"
              }
            },
            "web": "dyndns"
          }
        }
      }
    }
  }
}

Check to make sure it works

To check and confirm the USG is updating the DNS correctly, you can SSH into the USG and run show dns dynamic status.

show dns dynamic status
interface    : eth0
ip address   : 123.123.123.123
host-name    : SUBDOMAIN
last update  : Wed Jun 10 12:08:20 2020
update-status: good

You can also force an update by running update dns dynamic interface eth0

Published inHomeLABNetworkingSoftware

Be First to Comment

Leave a Reply

Discover more from D Khaz

Subscribe now to keep reading and get access to the full archive.

Continue reading