Overview
The configuration system manages RDAP client settings with a priority-based loading mechanism. Configuration files are loaded from multiple locations with user overrides taking precedence over system defaults.Configuration Priority
Configuration files are loaded in the following order (highest to lowest priority):~/.config/rdap/*.local.json- User local overrides (never updated automatically)~/.config/rdap/*.json- Downloaded configurations/etc/rdap/*.json- System-wide configurations- Built-in defaults - Embedded in the binary
Config
The main configuration structure for the RDAP client.Bootstrap URLs configuration for IANA RDAP services
Cache settings for bootstrap files
BootstrapConfig
Bootstrap URL for DNS (domain) queries. Default:
https://data.iana.org/rdap/dns.jsonBootstrap URL for AS number queries. Default:
https://data.iana.org/rdap/asn.jsonBootstrap URL for IPv4 address queries. Default:
https://data.iana.org/rdap/ipv4.jsonBootstrap URL for IPv6 address queries. Default:
https://data.iana.org/rdap/ipv6.jsonCacheConfig
Time-to-live for cached bootstrap files in seconds. Default:
86400 (24 hours)Functions
load()
Loads configuration with priority: local > user > system > builtin.~/.config/rdap/config.local.json~/.config/rdap/config.json/etc/rdap/config.json- Built-in default configuration
save()
Saves the configuration to the user config directory.~/.config/rdap/config.json in pretty-printed JSON format.
user_config_dir()
Returns the user configuration directory path.~/.config/rdap/ on all platforms (determined by $HOME environment variable)
update_configs()
Updates configuration files from GitHub and IANA sources.config.jsonfrom GitHub repositorytlds.jsonfrom GitHub repositorytlds.txtfrom IANA (official TLD list)
~/.config/rdap/*.json files, never touches *.local.json overrides.
Returns: UpdateResult with status of each update operation
Whether config.json was successfully updated
Error message if config.json update failed
Whether tlds.json was successfully updated
Error message if tlds.json update failed
Whether tlds.txt was successfully updated
Error message if tlds.txt update failed
TLD Overrides
TldOverrides
A type alias forHashMap<String, String> mapping TLD/SLD to RDAP server URLs.
load_tld_overrides()
Loads TLD overrides with priority: local merged on top of base.- Load base overrides (user > system > builtin)
- Merge local overrides from
tlds.local.jsonon top
save_tld_overrides()
Saves TLD overrides to the user config directory.~/.config/rdap/tlds.json.
lookup_tld_override()
Looks up RDAP server URL for a domain from TLD overrides.TLD override mappings
Domain name to look up (e.g., “example.com.af”)
- “foo.com.af”
- “com.af”
- “af”
None if no match found.
TLD List
TldList
IANA TLD list containing all valid top-level domains.load()
Loads the IANA TLD list with priority: user > system > builtin.tlds.txt in:
~/.config/rdap/tlds.txt/etc/rdap/tlds.txt- Built-in TLD list (embedded)
is_tld()
Checks if a string is a valid TLD.Query string to check (case-insensitive)
true if the query matches a valid TLD
len()
Returns the number of TLDs in the list.Configuration File Format
config.json
tlds.json
Maps TLD/SLD to RDAP server URLs:tlds.txt
IANA TLD list (plain text, one TLD per line):Constants
GitHub URL for config.json updates:
https://raw.githubusercontent.com/xtomcom/rdap/main/config/config.jsonGitHub URL for tlds.json updates:
https://raw.githubusercontent.com/xtomcom/rdap/main/config/tlds.jsonIANA URL for TLD list updates:
https://data.iana.org/TLD/tlds-alpha-by-domain.txtIANA RDAP server for TLD queries:
https://rdap.iana.org/