-
Notifications
You must be signed in to change notification settings - Fork 488
NEW PROVIDER: UniFi Network DNS provider #4013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hi @tlimoncelli, Unifi is launching a new API to manage DNS records in v10.1. |
Either is fine. If you want to skip v1 and only support v2, that's fine too. (edited for clarity) |
Right now v2 is Early Access. And v1 would support all Unifi versions back to 8.x. That could be immediately useful for more users. I'll go with a flag that defaults to "auto" for version detection, best of both. |
|
Thank you for contributing this new provider, @zupolgec ! Some notes:
My home internet router doesn't have an API. Maybe I should check out UniFi! Thanks again! |
tlimoncelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
Add support for managing static DNS records on UniFi Network controllers via the v2 API (Network 8.2+). Supports both local access and remote cloud access via api.ui.com. Features: - Supported record types: A, AAAA, CNAME, MX, TXT, SRV, NS - Local access with optional TLS verification skip for self-signed certs - Cloud access via UniFi Cloud Connector (requires UniFi OS 5.0.3+) - Automatic record filtering by domain suffix Configuration options: - host: Local controller URL (e.g., https://192.168.1.1) - console_id: Cloud console ID for remote access - api_key: UniFi API key - site: Site name (defaults to 'default') - skip_tls_verify: Skip TLS verification for self-signed certs
Support both UniFi Network APIs:
- Legacy API (v2/api/site/{site}/static-dns) for Network 8.2+
- New API (integration/v1/sites/{siteId}/dns/policies) for Network 10.1+
The new 'api_version' config parameter accepts:
- 'auto' (default): probes both APIs, prefers new, falls back to legacy
- 'new': forces new API only
- 'legacy': forces legacy API only
The new API supports native PUT for updates (no delete+create needed).
054902c to
a6c2c60
Compare
- Add UNIFI profile to profiles.json with known failures (26, 43) - Improve AuditRecords to properly return nil when no errors - Add audit rules for: TXT > 255 chars, null MX, null SRV target - Remove NS from supported types (requires IP, not hostname)
Docs added. This is the result of the integration tests:
I love Ubiquiti and their products, huge fan. I like to think of them as the Apple of networking equipment (the old Apple at least). |
Summary
Add support for managing static DNS records on UniFi Network controllers via the v2 API (Network 8.2+).
Features
api.ui.com) - requires UniFi OS 5.0.3+Configuration
Local Access
{ "unifi": { "TYPE": "UNIFI", "host": "https://192.168.1.1", "api_key": "your-api-key", "site": "default", "skip_tls_verify": "true" } }Cloud Access
{ "unifi_cloud": { "TYPE": "UNIFI", "console_id": "your-console-id", "api_key": "cloud-api-key", "site": "default" } }Usage Example
Testing
Tested using the OLD API (
/v2/api/site/{site}/static-dns) via:api.ui.com(Network 10.1.78)All CRUD operations verified working on both access methods.
References