Skip to main content

Automatically sync DNS A records on Unifi controllers

Project description

Unifi DNS Synchronization Tool

Automatically sync DNS A records on Unifi controllers via CLI.

Demo Screenshot

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unifi_dns_sync-1.0.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unifi_dns_sync-1.0.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

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

Hashes for unifi_dns_sync-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9e2fac9b21d5a632c02039b64272531863b1295ffaace76717a608cdb3fe3db4
MD5 fa201aacbecc961d1d93fe18ab91cb22
BLAKE2b-256 44304b462a7dfd11b7d561d849875d6f87161628327acee87dc18acccbfabb97

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for unifi_dns_sync-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a919c0172d93a436333b7ab562909d96d1c6c9b71c33af2bbbed5212bb1488bb
MD5 fe665cccc2a715014e64907556b974a8
BLAKE2b-256 747b58515769362fad365bb1dacbc53e2d88dfb1d4dbcfb8c8086b1b3bb9c83a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page