Automatically sync DNS A records on Unifi controllers
Project description
Unifi DNS Synchronization Tool
Automatically sync DNS A records on Unifi controllers via CLI.
Installation
From PyPI (recommended)
python -m pip install --upgrade pip
python -m pip install unifi-dns-sync
From source (development)
git clone https://github.com/cswitenky/unifi-dns-sync.git
cd unifi-dns-sync
python -m pip install -e .
Usage
Create a JSON file with your hostnames and IPs:
[
{ "service1.example.com": "10.0.10.1" },
{ "service2.example.com": "10.0.20.1" },
"service3.example.com"
]
Run the sync:
python -m unifi_dns_sync config/dns-records.json \
--controller https://10.0.0.1 \
--username admin \
--password your-password \
--target-ip 10.0.0.123 # Optional for hostnames without explicit IPs
Options
--dry-run- Show what would change without making changes--show-diff- Show detailed diff of changes--target-ip- Default IP for hostnames without explicit IPs (default: 10.0.0.123)--verbose- Enable debug logging
JSON Formats
Simple hostnames (uses --target-ip):
["host1.com", "host2.com"]
Hostname to IP mapping:
[{ "host1.com": "1.2.3.4" }, { "host2.com": "5.6.7.8" }]
Explicit format:
[{ "hostname": "host1.com", "ip": "1.2.3.4" }, { "hostname": "host2.com" }]
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unifi_dns_sync-1.0.1.tar.gz.
File metadata
- Download URL: unifi_dns_sync-1.0.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e2fac9b21d5a632c02039b64272531863b1295ffaace76717a608cdb3fe3db4
|
|
| MD5 |
fa201aacbecc961d1d93fe18ab91cb22
|
|
| BLAKE2b-256 |
44304b462a7dfd11b7d561d849875d6f87161628327acee87dc18acccbfabb97
|
Provenance
The following attestation bundles were made for unifi_dns_sync-1.0.1.tar.gz:
Publisher:
python-publish.yml on cswitenky/unifi-dns-sync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unifi_dns_sync-1.0.1.tar.gz -
Subject digest:
9e2fac9b21d5a632c02039b64272531863b1295ffaace76717a608cdb3fe3db4 - Sigstore transparency entry: 517414766
- Sigstore integration time:
-
Permalink:
cswitenky/unifi-dns-sync@671be7ea9cb1ffead27605af46f884d410dd54cf -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/cswitenky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@671be7ea9cb1ffead27605af46f884d410dd54cf -
Trigger Event:
release
-
Statement type:
File details
Details for the file unifi_dns_sync-1.0.1-py3-none-any.whl.
File metadata
- Download URL: unifi_dns_sync-1.0.1-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a919c0172d93a436333b7ab562909d96d1c6c9b71c33af2bbbed5212bb1488bb
|
|
| MD5 |
fe665cccc2a715014e64907556b974a8
|
|
| BLAKE2b-256 |
747b58515769362fad365bb1dacbc53e2d88dfb1d4dbcfb8c8086b1b3bb9c83a
|
Provenance
The following attestation bundles were made for unifi_dns_sync-1.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on cswitenky/unifi-dns-sync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unifi_dns_sync-1.0.1-py3-none-any.whl -
Subject digest:
a919c0172d93a436333b7ab562909d96d1c6c9b71c33af2bbbed5212bb1488bb - Sigstore transparency entry: 517414777
- Sigstore integration time:
-
Permalink:
cswitenky/unifi-dns-sync@671be7ea9cb1ffead27605af46f884d410dd54cf -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/cswitenky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@671be7ea9cb1ffead27605af46f884d410dd54cf -
Trigger Event:
release
-
Statement type: