{"id":49636545,"url":"https://github.com/libdns/unifi","last_synced_at":"2026-05-05T15:03:44.878Z","repository":{"id":336266728,"uuid":"1148261204","full_name":"libdns/unifi","owner":"libdns","description":"UniFi Network implementation for libdns","archived":false,"fork":false,"pushed_at":"2026-04-16T17:06:47.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-02T20:40:00.717Z","etag":null,"topics":["libdns","unifi"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/libdns/unifi","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libdns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-02T19:04:09.000Z","updated_at":"2026-04-16T17:04:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/libdns/unifi","commit_stats":null,"previous_names":["libdns/unifi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/libdns/unifi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdns%2Funifi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdns%2Funifi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdns%2Funifi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdns%2Funifi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libdns","download_url":"https://codeload.github.com/libdns/unifi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libdns%2Funifi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32654618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libdns","unifi"],"created_at":"2026-05-05T15:03:42.791Z","updated_at":"2026-05-05T15:03:44.874Z","avatar_url":"https://github.com/libdns.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UniFi for [`libdns`](https://github.com/libdns/libdns)\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/libdns/unifi.svg)](https://pkg.go.dev/github.com/libdns/unifi)\n\nThis package implements the [libdns interfaces](https://github.com/libdns/libdns) for [UniFi Network](https://developer.ui.com), allowing you to manage DNS records through the UniFi Network's DNS policy API.\n\n## Supported Record Types\n\nThis provider supports the following DNS record types:\n- **A** - IPv4 address records\n- **AAAA** - IPv6 address records\n- **CNAME** - Canonical name (alias) records\n- **MX** - Mail exchange records (Without TTL)\n- **TXT** - Text records (Without TTL)\n- **SRV** - Service records (Without TTL)\n\n## Configuration\n\nThe provider requires three pieces of configuration:\n\n1. **API Key** - Your UniFi API authentication key\n2. **Site ID** - The UUID of the UniFi site containing the DNS policies\n3. **Host URL** - The base URL of your UniFi controller API\n\n### Example Usage\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"net/netip\"\n\t\"time\"\n\n\t\"github.com/libdns/libdns\"\n\t\"github.com/libdns/unifi\"\n)\n\nfunc main() {\n\tprovider := unifi.Provider{\n\t\tApiKey:  \"your-api-key\",\n\t\tSiteId:  \"your-site-uuid\",\n\t\tBaseUrl: \"https://192.168.1.1/proxy/network/integration/v1\",\n\t}\n\n\t// List existing records\n\trecords, err := provider.GetRecords(context.Background(), \"example.com\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Add a new A record\n\tnewRecords, err := provider.AppendRecords(context.Background(), \"example.com\", []libdns.Record{\n\t\tlibdns.Address{\n\t\t\tName: \"www\",\n\t\t\tIP:   netip.MustParseAddr(\"192.0.2.1\"),\n\t\t\tTTL:  3600 * time.Second,\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n## Getting Your Credentials\n\n### API Key\n\n1. Log into your UniFi Network Console \n2. Navigate to **Integrations**\n3. Create a new **API Key**\n4. Set the key as your `UNIFI_API_KEY` environment variable or use it as  `ApiKey` parameter\n\n### Site ID\n\nExecute the following request to retrive the ID of your sites:\n```curl\ncurl -k -X GET 'https://YOU_UNIFI_NETWORK_CONTROLLER/proxy/network/integration/v1/sites' -H 'X-API-KEY: YOUR_API_KEY' -H 'Accept: application/json'\n```\n\n### Base URL\n\nThe base URL is the base path of your UniFi Network API endpoint:\n\n- **Default**: `https://YOU_UNIFI_NETWORK_CONTROLLER/proxy/network/integration/v1` (replace IP with your device IP)\n- **CloudKey/Controller**: `https://YOU_UNIFI_NETWORK_CONTROLLER:8443/proxy/network/integration/v1`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdns%2Funifi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibdns%2Funifi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibdns%2Funifi/lists"}