Skip to main content

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:

  1. Fetches records for the primary zone
  2. Fetches records for each configured sub-zone
  3. 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:

  1. Calls the inner source's populate() for the primary zone
  2. For each sub-zone, creates a temporary Zone, calls the inner source's populate(), then copies the records into the primary zone with their full qualified names (e.g. a record app from the sub1.example.com. zone becomes app.sub1 in example.com.)
  3. 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

  1. Update CHANGELOG.md — move the new version's entry from - unreleased to a date and add any missing items.
  2. Commit and push to main.
  3. 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

octodns_nested_zones-0.3.0.tar.gz (65.0 kB view details)

Uploaded Source

Built Distribution

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

octodns_nested_zones-0.3.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for octodns_nested_zones-0.3.0.tar.gz
Algorithm Hash digest
SHA256 936eba8f435add09760d07d90bde25e5d074eb5c87516a11f964331d44f0b504
MD5 fb9524da4fd8cd6d6a98a6d7d3fa098c
BLAKE2b-256 8d1281b562a1b22ea020b62381f2f22b7e05425824deb3b2d141a709abf9797b

See more details on using hashes here.

File details

Details for the file octodns_nested_zones-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for octodns_nested_zones-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9f4117f65807be74f271ba975d24331a051c4eb70e81a8e74feda08462e1dd4
MD5 42c29cd6731de17cbaeb1e2c72b3416c
BLAKE2b-256 b49e2b935851a6caa1f0c8111180c8f31ca452762a05b22b0070d673c004c17b

See more details on using hashes here.

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