rdapify
A fast, secure, production-ready RDAP client library for Rust.
RDAP (Registration Data Access Protocol) is the modern replacement for WHOIS, defined in RFC 9083 and RFC 9224.
rdapify ecosystem
Library Language Package rdapify-rs ← you are here Rust rdapifyon crates.ioRDAPify TypeScript / Node.js rdapifyon npmrdapify-nd Node.js (Rust native) rdapify-ndon npmrdapify-py Python (Rust native) rdapify-pyon PyPI
Features
- 5 query types — domain, IP, ASN, nameserver, entity
- IANA Bootstrap (RFC 9224) — automatic server discovery, no manual configuration needed
- SSRF protection — blocks requests to private, loopback, and link-local addresses
- In-memory cache — configurable TTL and capacity, lock-free via
DashMap - IDN support — accepts Unicode domain names, normalises to Punycode automatically
- Retry with back-off — exponential back-off on network errors and 5xx/429 responses
- Zero OpenSSL — uses
rustls(pure Rust TLS) - Async-first — built on
tokio
Installation
[]
= "0.2"
Quick Start
use RdapClient;
async
Usage
Domain Query
let res = client.domain.await?;
println!;
println!;
println!;
if let Some = &res.registrar
IP Address Query
// IPv4
let res = client.ip.await?;
// IPv6
let res = client.ip.await?;
println!;
println!;
ASN Query
// Both formats accepted
let res = client.asn.await?;
let res = client.asn.await?;
println!;
Nameserver Query
let res = client.nameserver.await?;
println!;
Entity Query
let res = client.entity.await?;
println!;
println!;
Configuration
use ;
use Duration;
let client = with_config?;
CLI
Enable the cli feature to build the rdapify binary:
= { = "0.1", = ["cli"] }
Or install it directly:
# Machine-readable JSON output
Performance
All figures are measured with cargo bench (Criterion) on a Linux x86-64 machine.
The query benchmarks use a local mock HTTP server (mockito) so results reflect
pure Rust overhead — no real network latency is included.
Cache
| Benchmark | Time |
|---|---|
| Cache hit (DashMap read, fresh TTL) | ~124 ns |
| Cache miss (key absent) | ~24 ns |
| Cache insert (single write) | ~780 ns |
| Cache eviction (insert at max capacity) | ~8.8 µs |
| Bulk insert — 100 entries | ~35 µs |
| Bulk insert — 1 000 entries | ~444 µs |
Query pipeline (mock HTTP server)
| Benchmark | Time | Notes |
|---|---|---|
domain() — no cache |
~183 µs | bootstrap lookup + HTTP fetch + normalise |
domain() — cache hit |
~2.3 µs | ~80× faster than uncached |
ip() — no cache |
~176 µs | |
asn() — no cache |
~176 µs |
Cache brings query latency from ~180 µs → ~2 µs — an 80× speedup for repeated queries within the TTL window.
SSRF validation
| Benchmark | Time |
|---|---|
| Public domain URL (allowed) | ~141 ns |
| Public IPv4 URL (allowed) | ~220 ns |
| Private IPv4 URL (blocked at RFC-1918) | ~295 ns |
| Non-HTTPS scheme (blocked immediately) | ~145 ns |
| SSRF disabled (boolean bypass) | ~3 ns |
Run the benchmarks yourself:
# HTML reports → target/criterion/report/index.html
Language Bindings
Node.js — rdapify-nd
A prebuilt native binding for Node.js. No compiler required — binaries ship for Linux x64, macOS x64/arm64, and Windows x64.
const = require;
// Domain
const d = await ;
console.log; // "Example Registrar, Inc."
console.log; // "example.com"
console.log; // "2026-03-21T00:00:00Z"
// IP address
const i = await ;
console.log; // "GOOGLE"
console.log; // "US"
// ASN
const a = await ;
console.log; // "GOOGLE"
// Nameserver
const ns = await ;
console.log; // ["216.239.32.10"]
// Entity (requires explicit server URL — no global bootstrap for entities)
const e = await ;
console.log; // "ARIN-HN-1"
Use with the TypeScript rdapify library for automatic native acceleration:
import { RDAPClient } from 'rdapify';
// backend: 'auto' (default) uses rdapify-nd if installed, falls back to TypeScript
const client = new RDAPClient({ backend: 'auto' });
// Or require it — throws at startup if rdapify-nd is not installed
const client2 = new RDAPClient({ backend: 'native' });
const result = await client.domain('example.com');
console.log(result.metadata.source); // RDAP server URL that served the response
Python — rdapify-py
A prebuilt native extension for Python 3.8+. Ships as abi3 wheels for
Linux x64, macOS x64/arm64, and Windows x64.
# Domain
=
# "Example Registrar, Inc."
# "example.com"
# RFC 3339 timestamp
# IP address
=
# "GOOGLE"
# "US"
# ASN
=
# "GOOGLE"
# Nameserver
=
# ["216.239.32.10"]
# Entity (requires explicit server URL)
=
# "ARIN-HN-1"
All five functions are synchronous and backed by a tokio runtime under the hood.
MSRV
Minimum supported Rust version: 1.75
License
MIT — see LICENSE