UniFi gateways do not accept a custom DNS-over-HTTPS or DNS-over-TLS
server with a path or server name, so the gateway uses plain DNS: the
profile’s own IPv6 addresses, and the shared IPv4 addresses with your WAN
address linked to the profile.
In the dashboard, on the profile’s Setup page, link your network’s IPv4
address (Link this network when you are at home), or create a DDNS
link if your ISP changes it. See Linked IP.
In UniFi Network, open Settings → Internet, select the WAN, and set
DNS Server to manual: the IPv4 resolver addresses from the Setup page.
Under IPv6, set the DNS servers to the profile’s IPv6 addresses.
Screenshot to comeUniFi Network WAN settings with manual IPv4 and IPv6 DNS servers set to the opdns addresses.UniFi Network 9
In Settings → Networks, for each LAN, leave DHCP DNS Server on
Auto (the gateway) so clients ask the gateway, which asks opdns.
UniFi’s Dynamic DNS only supports its listed providers. Run the DDNS
update from any always-on machine on the network instead, as shown on the
Linked IP page.