Skip to main content

Domain

Represents domain name registration information returned from RDAP queries.
object_class_name
string
required
Always “domain” for domain objects
conformance
array<string>
RDAP conformance levels (e.g., ["rdap_level_0"])
notices
array<Notice>
Server notices and terms of service. See common fields
handle
string
Registry-unique identifier for the domain
ldh_name
string
LDH (Letters, Digits, Hyphen) representation of the domain name
let domain_name = domain.ldh_name.unwrap_or_default();
unicode_name
string
Unicode representation of the domain name (for IDNs)
variants
array<Variant>
Domain name variants (IDN variations)
nameservers
array<Nameserver>
Authoritative nameservers for the domain. See Nameserver
secure_dns
SecureDNS
DNSSEC information for the domain
entities
array<Entity>
Related entities (registrant, contacts, registrar). See Entity
// Find the registrar
let registrar = domain.entities.iter()
    .find(|e| e.roles.contains(&"registrar".to_string()));
status
array<string>
Domain status values (e.g., “active”, “locked”, “client transfer prohibited”)
if domain.status.contains(&"client transfer prohibited".to_string()) {
    println!("Domain is transfer locked");
}
public_ids
array<PublicId>
Public identifiers. See common fields
remarks
array<Remark>
Informational remarks. See common fields
Related links (self, registrar RDAP, etc.). See common fields
port43
string
WHOIS server hostname for port 43 queries
events
array<Event>
Domain lifecycle events. See common fields
// Find registration date
let reg_date = domain.events.iter()
    .find(|e| e.action == "registration")
    .map(|e| &e.date);
network
IpNetwork
Associated IP network (rarely used). See IpNetwork
lang
string
Language tag (e.g., “en”, “fr”)

Common Fields

href
string
required
URL of the link
rel
string
Link relationship type (e.g., “self”, “related”)
value
string
Context-specific value
hreflang
array<string>
Language tags for the target resource
title
string
Human-readable title
media
string
Media type hint
MIME type of the linked resource

Event

action
string
required
Event type (e.g., “registration”, “expiration”, “last changed”)
date
string
required
ISO 8601 timestamp
actor
string
Entity that triggered the event
Related links

Notice

title
string
Notice title
notice_type
string
Type of notice
description
array<string>
Lines of descriptive text
Related links

Remark

Identical structure to Notice.

PublicId

id_type
string
required
Identifier type (e.g., “IANA Registrar ID”)
identifier
string
required
The actual identifier value

Example Usage

use rdap_client::RdapClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = RdapClient::new();
    let result = client.query("example.com").await?;
    
    if let Some(domain) = result.domain() {
        println!("Domain: {}", domain.ldh_name.as_deref().unwrap_or("N/A"));
        
        // Get nameservers
        for ns in &domain.nameservers {
            println!("NS: {}", ns.ldh_name.as_deref().unwrap_or("N/A"));
        }
        
        // Check DNSSEC
        if let Some(dns) = &domain.secure_dns {
            println!("DNSSEC signed: {}", dns.zone_signed.unwrap_or(false));
        }
        
        // Get registrar
        for entity in &domain.entities {
            if entity.roles.contains(&"registrar".to_string()) {
                if let Some(vcard) = &entity.vcard {
                    println!("Registrar: {}", vcard.name().unwrap_or("Unknown"));
                }
            }
        }
    }
    
    Ok(())
}

Build docs developers (and LLMs) love