Repository navigation
fix(dns): drop duplicate records when building a zone - #14113
Open
HarshMN2345 wants to merge 2 commits into
Open
HarshMN2345 wants to merge 2 commits into
HarshMN2345 wants to merge 2 commits into
Conversation
A DNS RRset is a set, and RFC 2181 section 5 makes publishing the same record twice invalid. Zone keeps the first of any records identical in name, class, type, rdata, priority, weight and port, so MX and SRV records that differ only outside rdata both survive. Zones built from rows that are already duplicated are repaired without a data migration.
1 of 2 tasks
🟢 Tier S · Ready to merge
Zone construction now removes duplicate records using name, class, type, rdata, priority, weight and port, retaining the first record and its TTL. Regression tests cover duplicate removal, preservation of distinct MX/SRV records, and duplicates imported with different apex-name spellings.
📂 Walkthrough · 3
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Drop the single-use helper and build the unique list in the loop that already walks every record. Trim the tests to the cases the constructor and the zone-file import each cover on their own, using example.com.
HarshMN2345
force-pushed
the
claude/dns-zone-duplicate-records
branch
from
October 5, 2026 08:04
acf7c97 to
4ff591e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A DNS RRset is a set, and RFC 2181 §5 makes publishing the same record twice invalid. When the rows a zone is built from contained duplicates,
Zonepublished them twice.Zonenow keeps the first of any records identical in name, class, type, rdata, priority, weight and port. MX and SRV records that differ only in priority, weight or port are distinct records and both survive.It applies when a zone is built, so zones whose rows are already duplicated are repaired without a data migration.
Test Plan
ZoneTest: identical records collapse for any type, keeping the first copy's TTL and leaving other names and types alone; MX and SRV records differing only outside rdata both remain.Zone\FileTest:@and the apex FQDN import as one record.packages/dnsunit suite, Pint and Rector pass locally. ThreeLookup\RecursiveTestcases need the Swoole extension, which is not installed in my environment; they fail identically onmainthere.Related PRs and Issues
Checklist