Skip to content

fix(tlds): read IANA's redesigned root zone database page - #231

Merged
ralyodio merged 1 commit into
mainfrom
fix/iana-root-db-parse
Oct 21, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/iana-root-db-parse

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What broke

Every TLD sync logs [tlds] root zone database failed: root zone database parsed to 0 rows, so TLD type and manager stopped updating.

Why

IANA redesigned https://www.iana.org/domains/root/db. Links are now /domains/root/db/aaa (no .html), a status column (Active / Retired / Reserved) sits before the type, the manager cell carries class="col-manager", and types are title case (Generic, Country Code, Special Use, Test). The single regex in parseRootDb matched none of it.

Fix

parseRootDb reads row by row and handles both layouts. Types are normalised to the existing lower-case, dashed vocabulary (country-code). A retired row in the new layout (status Retired, empty manager) gets the Not assigned manager that the retired-label pass keys on. Against the live page this parses 1,603 rows: generic 1265, country-code 318, special-use 9, test 11.

Note: the new page no longer distinguishes sponsored / generic-restricted / infrastructure, so those rows will read as IANA now labels them.

Test: a fixture in the new layout, alongside the old one. bun test test/tlds.test.js: 30 pass.

🤖 Generated with Claude Code

IANA redesigned https://www.iana.org/domains/root/db: links lost their .html
suffix, a status column now sits before the type, the manager cell is
marked col-manager, and types are title case ("Country Code"). The old regex
matched nothing, so every TLD sync logged

  [tlds] root zone database failed: root zone database parsed to 0 rows

and type/manager stopped updating. Parse row by row and read both layouts;
types are normalised to the existing vocabulary (country-code), and a
retired row (status Retired, empty manager) keeps the "Not assigned" manager
the retired-label pass keys on. The live page parses to 1,603 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 1b3f787 into main Oct 21, 2026
3 checks passed
@ralyodio
ralyodio deleted the fix/iana-root-db-parse branch October 21, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant