Table of Contents

Ubiquiti - CLI - DNS forwarding

ssh into your Controller

ssh into your Controller (NOT the USG!).

For controller on:

NOTE: Use 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
{
	"service": {
		"dns": {
			"forwarding": {
				"options": [
					"host-record=AP-EG-WZ.WORKGROUP,192.168.1.3",
					"host-record=AP-OG-SZ.WORKGROUP,192.168.1.5"
				]
			}
		}
	}
}

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/


Finalize

Once the file is on the UniFi-Controller:


Verify

Verify the setting by ssh'ing into your USG, enter “configure” and “show system”.


References

https://help.ui.com/hc/en-us/articles/115004872967-UniFi-Where-is-unifi-base-