User Tools

Site Tools


ubiquiti:cli:static_dns_entry

This is an old revision of the document!


Ubiquiti - CLI - Static DNS entry

ssh into your Controller (NOT the USG!)

For controller on

Windows: C:\Users\<user>\Ubiquiti UniFi\data\sites\default
Mac: /Users/<user>/Library/Application Support/UniFi/data/sites/<site-name>/config.gateway.json
Ubuntu: /usr/lib/unifi/data/sites/default
CloudKey: /srv/unifi/data/sites/default

(or to the site-name you had configured instead of "default" if you did)

Create/Edit the file config.gateway.json in your site directory:

config.gateway.json
{
    "system": {
         "static-host-mapping": {
             "host-name": {
                  "test1.localdomain": {
                         "alias": [
                                "test1"
                         ],
                         "inet": [
                           "192.168.99.99"
                       ]
                   }
              }
         }
    }
}

NOTE: It is a good habit to run a sanity check on your .json file before pushing it to the device.

Simply copy & paste it to JSON Formatter & Validator. There are many of them available such as https://jsonformatter.curiousconcept.com/


Once the file is on the UniFi-Controller:

  • Navigate to Devices.
  • Click your USG.
  • Click the “Config”-icon
  • Click “Manage Device” and pick “Provision” under Force Provisioning.
ubiquiti/cli/static_dns_entry.1600157532.txt.gz · Last modified: 2020/09/15 08:12 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki