Skip to main content

Quickstart Guide

This guide will get you from zero to querying RDAP data in under 5 minutes. We’ll cover the most common use cases and show you how to get the information you need.

Your First Query

The simplest way to use RDAP is to just pass a domain name, IP address, or AS number:
rdap example.com
That’s it! The tool will:
  1. Auto-detect that you’re querying a domain
  2. Find the authoritative RDAP server using IANA bootstrap
  3. Query both the registry (Verisign for .com) and registrar
  4. Display formatted, colorized results
RDAP automatically detects what you’re querying - domain, IP, AS number, or TLD. No need to specify the type!

Common Query Types

Domain Names

Query registration information for any domain:
rdap google.com
What you’ll see:
  • Abuse contact email (displayed first for easy access)
  • Domain status (locked, active, etc.)
  • Nameservers
  • Registration and expiration dates
  • Registrar information
  • DNSSEC status
rdap example.com

Top-Level Domains (TLDs)

Query TLD information directly from IANA:
# Query a brand TLD
rdap google

# Query a country code TLD
rdap uk

# Query a generic TLD
rdap com
What you’ll see:
  • Administrative contact
  • Technical contact
  • Nameservers with IP addresses
  • DNSSEC DS records
  • Registration and update dates
When querying a single word like “google”, RDAP checks if it’s a valid TLD. If so, it queries the TLD; otherwise, it treats it as a domain name.

IP Addresses

Query both IPv4 and IPv6 addresses:
rdap 8.8.8.8
What you’ll see:
  • Abuse contact (displayed first)
  • IP range allocation
  • Network name and type
  • Country
  • Registration organization
  • Status and dates
RDAP supports IP shorthand like 1.1 which automatically expands to 1.0.0.1. This is perfect for quick lookups!

AS Numbers

Query autonomous system information:
rdap AS15169
What you’ll see:
  • Abuse contact (displayed first)
  • AS number and name
  • AS type
  • Country
  • Contact information
  • Status and registration dates

Output Formats

RDAP supports three output formats:
Beautiful, colorized terminal output:
rdap example.com
Perfect for human reading with:
  • Color-coded information
  • Hierarchical display
  • Abuse contacts highlighted

Working with JSON Output

Combine RDAP with jq for powerful data extraction:
# Get just the nameservers
rdap -f json example.com | jq '.nameservers[].ldh_name'

# Extract expiration date
rdap -f json example.com | jq '.events[] | select(.action=="expiration") | .date'

# Get abuse contact email
rdap -f json 8.8.8.8 | jq '.entities[] | select(.roles[] | contains("abuse")) | .vcard[1][][1]'

Advanced Options

Specify Query Type

Override automatic detection:
rdap -t domain example.com
rdap -t ip 8.8.8.8
rdap -t autnum 15169
Available types: domain, tld, ip, autnum, entity, nameserver

Use Custom RDAP Server

Query a specific RDAP server directly:
rdap -s https://rdap.verisign.com/com/v1 example.com
When using a custom server, make sure the server is authoritative for the resource you’re querying.

Adjust Timeout

Set a custom timeout for slow servers:
# 60 second timeout
rdap --timeout 60 example.com

Disable Registrar Referral

For domains, skip the registrar query and only show registry data:
rdap --no-referral example.com

Control JSON Source

For domain queries with JSON output, choose which data to return:
# Return registrar data (default)
rdap -f json --json-source registrar example.com

# Return only registry data
rdap -f json --json-source registry example.com

Using as a Library

RDAP isn’t just a CLI tool - it’s also a powerful Rust library.

Basic Example

examples/basic_query.rs
use rdap::{QueryType, RdapClient, RdapRequest, display::RdapDisplay};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a client
    let client = RdapClient::new()?;

    // Create a domain query
    let request = RdapRequest::new(QueryType::Domain, "example.com");

    // Execute the query
    let result = client.query(&request).await?;

    // Display the result with colors
    result.display(false);

    Ok(())
}

Auto-Detection

examples/auto_detect.rs
use rdap::{RdapClient, RdapRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;

    // Auto-detect query type
    let query = "8.8.8.8";
    let query_type = RdapRequest::detect_type(query)?;
    
    let request = RdapRequest::new(query_type, query);
    let result = client.query(&request).await?;
    
    // Display result
    use rdap::display::RdapDisplay;
    result.display(false);
    
    Ok(())
}

Extract Domain Information

examples/domain_info.rs
use rdap::{QueryType, RdapClient, RdapObject, RdapRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;
    let request = RdapRequest::new(QueryType::Domain, "example.com");
    let result = client.query(&request).await?;

    if let RdapObject::Domain(domain) = result {
        // Access domain properties
        println!("Domain: {}", domain.ldh_name.unwrap_or_default());
        
        // Check status
        for status in &domain.status {
            println!("Status: {}", status);
        }
        
        // List nameservers
        for ns in &domain.nameservers {
            if let Some(name) = &ns.ldh_name {
                println!("Nameserver: {}", name);
            }
        }
        
        // Check DNSSEC
        if let Some(dnssec) = &domain.secure_dns {
            if let Some(signed) = dnssec.delegation_signed {
                println!("DNSSEC: {}", if signed { "Signed" } else { "Not signed" });
            }
        }
    }
    
    Ok(())
}

Query AS Numbers

examples/asn_lookup.rs
use rdap::{QueryType, RdapClient, RdapObject, RdapRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;
    let request = RdapRequest::new(QueryType::Autnum, "AS15169");
    let result = client.query(&request).await?;

    if let RdapObject::Autnum(autnum) = result {
        if let Some(start) = autnum.start_autnum {
            println!("AS Number: AS{}", start);
        }
        if let Some(name) = &autnum.name {
            println!("Name: {}", name);
        }
        if let Some(country) = &autnum.country {
            println!("Country: {}", country);
        }
    }
    
    Ok(())
}

Use Custom Server

examples/custom_server.rs
use rdap::{QueryType, RdapClient, RdapRequest, display::RdapDisplay};
use url::Url;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;

    // Query with a specific RDAP server
    let server = Url::parse("https://rdap.nic.cz")?;
    let request = RdapRequest::new(QueryType::Domain, "nic.cz")
        .with_server(server);

    let result = client.query(&request).await?;
    result.display(false);

    Ok(())
}

JSON Output

examples/json_output.rs
use rdap::{QueryType, RdapClient, RdapRequest};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new()?;
    let request = RdapRequest::new(QueryType::Domain, "example.com");
    let result = client.query(&request).await?;

    // Output as pretty JSON
    let json = serde_json::to_string_pretty(&result)?;
    println!("{}", json);

    Ok(())
}
All examples are available in the examples/ directory of the source repository. Run them with cargo run --example basic_query.

Configuration Management

Update Configuration Files

Download the latest bootstrap configuration from GitHub:
rdap --update
This updates:
  • config.json - Bootstrap URLs
  • tlds.json - TLD overrides
  • tlds.txt - IANA TLD list
Your local override files (*.local.json) are never touched by updates.

Configuration Priority

RDAP loads configuration in this order (highest priority first):
1

Local Overrides

~/.config/rdap/*.local.json - Your custom settings (never overwritten)
2

User Config

~/.config/rdap/*.json - Downloaded via --update
3

System Config

/etc/rdap/*.json - System-wide configuration
4

Built-in Defaults

Embedded in the binary - always available

Custom TLD Overrides

Create ~/.config/rdap/tlds.local.json to add your own TLD overrides:
~/.config/rdap/tlds.local.json
{
  "example": "https://rdap.example.com/",
  "co.example": "https://rdap.co.example.com/"
}

Common Patterns

Check Domain Expiration

rdap -f json example.com | jq '.events[] | select(.action=="expiration") | .date'

Find Abuse Contact

# For IP addresses (shown at top of output)
rdap 8.8.8.8 | head -n 3

# For AS numbers
rdap AS15169 | head -n 3

# Extract from JSON
rdap -f json 8.8.8.8 | jq '.entities[] | select(.roles[] | contains("abuse"))'

Batch Queries

Query multiple resources:
# Simple loop
for domain in example.com google.com github.com; do
  echo "=== $domain ==="
  rdap $domain
  echo
done

# From a file
while read -r query; do
  rdap -f json "$query" >> results.json
done < queries.txt

Monitor Domain Status

# Check if domain is locked
rdap -f json example.com | jq '.status[] | select(contains("lock"))'

# Get all status values
rdap -f json example.com | jq '.status[]'

Next Steps

CLI Reference

Complete reference for all command-line options and flags

Library API

Full API documentation for using RDAP as a Rust library

Configuration

Learn about configuration files, overrides, and customization

Examples

More examples and use cases for common tasks

Build docs developers (and LLMs) love