How to: Configure Dynamic DNS Service on the Unifi Security Gateway via config.gateway.json

How to: Configure Dynamic DNS Service on the Unifi Security Gateway via config.gateway.json

Thankfully the latest versions of Ubiquiti’s Unifi Controller allow the user to configure dynamic DNS services via the Web UI. However, there are cases when you rather keep the configuration on the config.gateway.json file. In my case the main motivation to use the config.gateway.json method is because you can set up the Dynamic DNS service for each Ethernet port, and when you are using two WAN ports you probably need one for each of your public IPs. Whatever the reason, you can configure your Dynamic DNS service settings via the configuration json file, and we will teach you how:

The General Config file layout

Here we show you the layout/template of the configuration file to manage the Dynamic DNS service. Remember this is a json file so make sure to validate it before you commit it and abide to the schema when adding the relevant sections to avoid breaking something else.

{
        "service": {
                "dns": {
                        "dynamic": {
                                "interface": {
                                        "eth0": {
                                                "service": {
                                                        "dyndns": {
                                                                "host-name": [
                                                                        "mgmt.domain.com"
                                                                ],
                                                                "login": "login_name",
                                                                "password": "password goes here"
                                                        }
                                                }
                                        }
                                }
                        },
                    },    
        },
}

We have also published some related articles like How to: Configure a Dynamic DNS Client (DDClient) with NameCheap? and UniFi – How to further customize USG configuration with config.gateway.json which may help you if you are new to the Configuration file or need help/suggestions on what Dynamic DNS service to use. I personally have tried a few and currently my preferred choice is NameCheap. I strongly recommend them, particularly because you can use your custom domain with dynamic DNS, vs having to use third party domains that don’t have as strong business presence as using your own domain. We also have another article covering how to clone a Mac Address on the USG (How to: Clone the mac address for the WAN interface on a Ubiquiti Unifi Security Gateway), gives you an idea of how more flexible the USG can be when using the CLI or config file.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.