How aminulbd/ds works
Purpose and entry point
ds is a Rust command-line domain-availability scanner. It expands input names and TLD selections into domain lookups, streams classified results, and exits for shell automation. The executable entry point and CLI/report orchestration are in src/main.rs; shared result/domain data structures are in src/model.rs.
Input expansion and lookup planning
CLI arguments support bare names, complete domains, files, TLD presets/lists, and TLD filters. The planner builds the name × suffix lookup set while preserving explicitly supplied full domains. Known TLD cataloguing and selection/filtering are centered in src/tlds.rs, with command parsing/control in src/main.rs.
Bootstrap and authoritative metadata
RDAP endpoint discovery uses IANA’s DNS bootstrap, cached locally for a week and refreshable on demand. Custom RDAP bootstrap files may override or replace IANA mappings. Bootstrap download, cache lifecycle, parsing, and IANA registry metadata used by --where belong in src/bootstrap.rs; RDAP endpoint resolution and requests are in src/rdap.rs.
Availability resolution pipeline
Each domain follows a source-policy boundary:
1. RDAP first when allowed; an authoritative HTTP 404 means available.
2. Configured/bundled WHOIS mapping when RDAP is unavailable or inconclusive.
3. IANA WHOIS referral in automatic mode, unless disabled.
Failures and ambiguous responses remain UNKNOWN, never available. The coordinator is src/main.rs; RDAP semantics are in src/rdap.rs; WHOIS fallback, custom overlays, response matching, and registry quirks are in src/whois.rs.
Network protocols and enrichment
RDAP uses HTTP(S) JSON and parses registration metadata/raw responses. WHOIS supports TCP port 43 plus configured HTTP(S)-style endpoints, with text needle matching designed to reject negated availability phrases. Optional DNS enrichment queries A, AAAA, NS, MX, TXT, CNAME, and SOA records. Relevant protocol boundaries are src/rdap.rs, src/whois.rs, and src/dns.rs.
Concurrency, pacing, and resilience
Large scans execute lookups concurrently but enforce global concurrency, per-host limits, request timeouts, backoff for 403/429 responses, and temporary host suppression after repeated refusals. This protects registry endpoints—especially shared RDAP hosts—and makes rate-limited results explicit. Scheduling/rate-limit state is implemented in src/limit.rs, invoked by lookup orchestration in src/main.rs.
Runtime assets and distribution
The bundled WHOIS server/availability table is compile-time embedded from whois.json, allowing a standalone binary. Runtime state is limited to optional user override files and IANA bootstrap cache under user config/cache locations. Releases build a cross-platform Rust binary and package Linux, macOS, and Windows installers via .github/workflows/release.yml, packaging/macos-install.sh, and wix/main.wxs.
Main entry points: whois.rs WHOIS fallback · rdap.rs RDAP resolver · main.rs CLI coordinator · model.rs Domain results
Components 17
CLI & Planning
- CLI coordinator · Parses commands, plans scans, and orchestrates result reporting.
src/main.rs - Domain results
src/model.rs - TLD selection
src/tlds.rs - Lookup plan · Preserves explicitly supplied full domains.
src/main.rs
Metadata
- IANA bootstrap · Downloads, caches, parses, and applies bootstrap overrides.
src/bootstrap.rs - IANA DNS bootstrap
Lookup Pipeline
- RDAP resolver · Resolves endpoints and classifies authoritative 404 availability.
src/rdap.rs - WHOIS fallback · Applies mappings, referrals, response matching, and registry quirks.
src/whois.rs - DNS enrichment · Optionally queries A, AAAA, NS, MX, TXT, CNAME, and SOA.
src/dns.rs - Pacing & resilience · Enforces global/per-host limits, timeouts, backoff, and host suppression.
src/limit.rs - Registry endpoints
Runtime State & Distribution
- Bootstrap cache & overrides · Weekly cache plus optional custom bootstrap mappings.
- Bundled WHOIS table · Compile-time embedded server and availability data.
whois.json - User WHOIS overrides
- Release packaging · Builds binaries and Linux, macOS, and Windows installers.
.github/workflows/release.yml - macOS installer
packaging/macos-install.sh - Windows installer
wix/main.wxs
Connections 23
- CLI coordinator → TLD selection: selects suffixes
- CLI coordinator → Lookup plan: builds
- Lookup plan → RDAP resolver: planned domains
- Lookup plan → WHOIS fallback: fallback candidates
- CLI coordinator → Pacing & resilience: schedules through
- Pacing & resilience → RDAP resolver: paces
- Pacing & resilience → WHOIS fallback: paces
- IANA bootstrap → IANA DNS bootstrap: downloads
- IANA bootstrap → Bootstrap cache & overrides: reads and refreshes
- IANA bootstrap → RDAP resolver: endpoint mappings
- RDAP resolver → WHOIS fallback: unavailable or inconclusive
- Bundled WHOIS table → WHOIS fallback: embedded mappings
- User WHOIS overrides → WHOIS fallback: custom overlays
- RDAP resolver → Registry endpoints: HTTP(S) requests
- WHOIS fallback → Registry endpoints: TCP/HTTP requests
- DNS enrichment → Registry endpoints: DNS queries
- CLI coordinator → DNS enrichment: optional enrichment
- RDAP resolver → Domain results: classification and metadata
- WHOIS fallback → Domain results: classification
- DNS enrichment → Domain results: enrichment
- Domain results → CLI coordinator: streamed results and exit status
- Release packaging → macOS installer: packages
- Release packaging → Windows installer: packages