Unifi
Custom/static DNS records on a local UniFi Network controller.
The @mccormick/unifi/dns model reads, upserts, and deletes the custom DNS records a UniFi OS console serves on its LAN. list_records writes one dns_record resource per entry; upsert_record creates or updates a single record in place (find by key+type, PUT when it exists, else POST); delete_record removes one (idempotent). The mutating methods are gated by a live pre-flight check that confirms the controller is reachable before any write. This turns a cutover DNS flip — repointing a hostname at a new host — into a composable, reusable model method.
Targets the local controller's internal v2 API (/proxy/network/v2/api/site/<site>/static-dns) with an X-API-KEY header. The cloud Site Manager API (api.ui.com) cannot edit DNS — use a key issued on the local UniFi OS console (Settings → Control Plane → Integrations). The api key is supplied through a vault, marked sensitive, and redacted from logs and error text.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| controllerUrl | string | Local UniFi OS controller base URL, e.g. https://192.0.2.1 |
| apiKey | string | Local controller API key (X-API-KEY); supply via |
| site | string | UniFi Network site name (usually 'default') |
| caCert? | string | PEM CA certificate to trust the controller's self-signed cert |
| insecureSkipTlsVerify | boolean | Best-effort skip of TLS verification (limited; prefer caCert) |
| Argument | Type | Description |
|---|---|---|
| key | string | Record name/host, e.g. omni.example.net |
| recordType | string | DNS record type, e.g. A, AAAA, CNAME, TXT |
| value | string | Record value, e.g. the target IP |
| enabled | boolean | Whether the controller should serve the record |
| Argument | Type | Description |
|---|---|---|
| key | string | Record name/host to delete, e.g. omni.example.net |
| recordType | string | DNS record type, e.g. A, AAAA, CNAME, TXT |
Resources
Modified 1 models
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned