unifi_console_doh
Preview and apply DNS over HTTPS (DoH) settings on a UniFi gateway with fingerprint confirmation, DNS safety checks, and automatic rollback if resolution fails.
Instructions
Preview, then apply, a change to the gateway's DNS over HTTPS (DoH) setting. Tier C: it can stop DNS for the whole network.
Two steps, always: call with confirm=false to get a read-only preview (before, after, diff, warnings, the safety probe result, a fingerprint); call again with the same fields plus confirm=true, that fingerprint and an approval_note to apply. Fields: state (off, auto, manual or custom), server_names (manual) and custom_servers (custom); the list that does not apply is cleared, as the UI does. Before applying, DNS is tested through the gateway; if it is already failing, the change is refused. After applying, DNS is tested again and, if it fails, the previous values are put back automatically (once) and the result says applied=false with auto_restored=true. Applying also needs UNIFI_CONSOLE_ENABLE_WRITES=true and 'doh' in UNIFI_CONSOLE_WRITE_ENTITIES. SSL inspection is a separate setting and is not changed here. Every write is journalled; scripts/doh_restore.py can put the last values back from the journal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |