Skip to content

Add AD-Legacy zone fallback for --add-dns-record#2140

Open
Q2Flc2FySec wants to merge 2 commits into
fortra:masterfrom
Q2Flc2FySec:dns_legacy_zone
Open

Add AD-Legacy zone fallback for --add-dns-record#2140
Q2Flc2FySec wants to merge 2 commits into
fortra:masterfrom
Q2Flc2FySec:dns_legacy_zone

Conversation

@Q2Flc2FySec
Copy link
Copy Markdown
Contributor

Currently, --add-dns-record only attempts to create DNS records in the AD-Domain partition (DomainDnsZones). This fails on environments where DNS is stored in the AD-Legacy partition (CN=MicrosoftDNS,CN=System).

This PR adds a fallback mechanism: if creating a record in the AD-Domain partition fails, it automatically retries against the AD-Legacy partition. The duplicate-check and subsequent NS record creation (for wpad) are also aware of both partitions to ensure consistency.

Changes:

  • Define dns_base_dn_legacy alongside the existing dns_base_dn
  • Extend the existing-record check to cover both partitions
  • Wrap A record creation in a fallback: AD-Domain → AD-Legacy
  • Track which partition succeeded (active_dns_base_dn) so the NS record is placed in the same location

Signed-off-by: Thomas Caesar <thomas.caesar@sva.de>
@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Mar 19, 2026
@Q2Flc2FySec
Copy link
Copy Markdown
Contributor Author

The last commit extends the previous AD-Legacy fallback with a third fallback targeting the AD-Forest partition (ForestDnsZones).

Changes:

Extend the existing-record check to also cover the Forest partition
Add a third fallback stage: AD-Domain -> AD-Legacy -> AD-Forest
Refactor the repeated A-record creation logic into an inner helper try_add_a_record(base_dn, label) to avoid code duplication across the three partition attempts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants