Skip to content

feat: whois reconcile loop for tlds not in rdap#67

Merged
zachsmith1 merged 3 commits into
feat/adjustRegistrationStatusfrom
feat/whoisreg
Oct 16, 2025
Merged

feat: whois reconcile loop for tlds not in rdap#67
zachsmith1 merged 3 commits into
feat/adjustRegistrationStatusfrom
feat/whoisreg

Conversation

@zachsmith1

Copy link
Copy Markdown
Contributor

This pull request adds WHOIS-based domain registration support as a fallback when RDAP registration information is unavailable or incomplete. It introduces new logic to discover the authoritative WHOIS server using IANA bootstrap, follows registry and registrar referrals, and parses WHOIS responses to populate domain registration details. The changes also include new helper functions for WHOIS parsing and comprehensive tests for the fallback and referral logic.

Domain registration protocol selection and fallback:

  • Updated DomainReconciler to select RDAP as the primary registration protocol and fall back to WHOIS if RDAP bootstrap reports no match, RDAP response is nil, or RDAP object is missing. The registration mapping now uses WHOIS parsing when needed.

WHOIS support and parsing:

  • Added a new dependency on github.com/domainr/whois and implemented the whoisFetchAtHost helper for performing WHOIS queries at specific hosts.
  • Implemented fetchRegistrationWhois, which discovers the authoritative WHOIS server via IANA, follows registry and registrar referrals, and parses WHOIS responses to extract registration, registrar, abuse contact, DNSSEC, statuses, and contact information.
  • Added helper functions findWhoisValue and parseTimeFlex for robust WHOIS field extraction and flexible date parsing.

Nameserver population logic:

  • Modified nameserver assignment to use RDAP nameservers when available, or resolve via DNS when using WHOIS or when RDAP data is missing. This ensures correct NS population regardless of the protocol used.
    Controller and dependency wiring:

  • Added the whoisFetch function field to DomainReconciler and wired it during controller setup for dependency injection and testing.

Testing and validation:

  • Added comprehensive tests for WHOIS bootstrap, registry and registrar referrals, and WHOIS-based registration mapping, ensuring correct extraction of all relevant domain registration fields.

@zachsmith1
zachsmith1 requested a review from joshlreese October 16, 2025 20:23

@joshlreese joshlreese left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Left a couple non-blocking questions.

Comment thread internal/controller/domain_controller.go Outdated
Comment thread internal/controller/domain_controller.go
Comment thread internal/controller/domain_controller.go Outdated
@zachsmith1
zachsmith1 merged commit 04a7e72 into feat/adjustRegistrationStatus Oct 16, 2025
9 checks passed
@scotwells
scotwells deleted the feat/whoisreg branch February 10, 2026 16:56
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.

2 participants