octodns-nested-zones
Nested zone source for octoDNS.
Combines records from a source zone and its configured sub-zones into a single zone. This is useful when an upstream provider (e.g. AXFR) is limited to a single zone at a time but you need to sync records from multiple zones into a target that does not support zones on subdomains.
Motivation
Providers like AXFR (zone transfer) are scoped to one zone. If you have
delegated sub-domains managed in separate zones (e.g. sub1.example.com,
sub2.example.com), a plain AXFR source for example.com will only see
records from the example.com zone itself - it would not include the
records that live in the sub-zone files.
This source wraps another source (like AXFR) and:
- Fetches records for the primary zone
- Fetches records for each configured sub-zone
- Merges everything into a single combined zone
The merged zone can then be synced to any target provider that doesn't understand or cares about zone boundaries.
Installation
pip install octodns-nested-zones
Configuration
Use a YAML anchor to share the inner source configuration:
providers:
axfr: &axfr
class: octodns.source.axfr.AxfrSource
host: ns1.example.com
key: env/AXFR_KEY
nested:
class: octodns_nested_zones.NestedSource
source: *axfr
sub_zones:
- sub1
- sub2
zones:
example.com.:
sources:
- nested
targets:
- your_dns_provider
Each entry in sub_zones is relative to the primary zone -
e.g. sub1 resolves to sub1.example.com. when populating the
example.com. zone.
How it works
On each sync cycle, the source:
- Calls the inner source's
populate()for the primary zone - For each sub-zone, creates a temporary
Zone, calls the inner source'spopulate(), then copies the records into the primary zone with their full qualified names (e.g. a recordappfrom thesub1.example.com.zone becomesapp.sub1inexample.com.) - All records (primary and sub-zone) end up in the same zone
Development
# Install dependencies
uv sync --group dev
# Run tests
uv run pytest
Releasing
- Update
CHANGELOG.md— move the new version's entry from- unreleasedto a date and add any missing items. - Commit and push to
main. - Tag the release:
git tag 0.2.0 && git push --tags.
CI will run the test suite, build the package, create a GitLab Release with the changelog section, and publish to PyPI.
Changes
See CHANGELOG.md for release history.
License
MIT
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 octodns_nested_zones-0.3.0.tar.gz.
File metadata
- Download URL: octodns_nested_zones-0.3.0.tar.gz
- Upload date:
- Size: 65.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
936eba8f435add09760d07d90bde25e5d074eb5c87516a11f964331d44f0b504
|
|
| MD5 |
fb9524da4fd8cd6d6a98a6d7d3fa098c
|
|
| BLAKE2b-256 |
8d1281b562a1b22ea020b62381f2f22b7e05425824deb3b2d141a709abf9797b
|
File details
Details for the file octodns_nested_zones-0.3.0-py3-none-any.whl.
File metadata
- Download URL: octodns_nested_zones-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f4117f65807be74f271ba975d24331a051c4eb70e81a8e74feda08462e1dd4
|
|
| MD5 |
42c29cd6731de17cbaeb1e2c72b3416c
|
|
| BLAKE2b-256 |
b49e2b935851a6caa1f0c8111180c8f31ca452762a05b22b0070d673c004c17b
|