Overview
RDAP supports search queries that return multiple results. The search result types wrap collections of objects along with metadata like notices and conformance information.
DomainSearchResults
Container for domain search query results.
Informational notices about the search
Array of domain objects matching the search
Language tag for textual content
Example
use rdap::{RdapClient, RdapRequest, QueryType, RdapObject};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = RdapClient::new()?;
let request = RdapRequest::new(QueryType::DomainSearch, "example*");
let result = client.query(&request).await?;
if let RdapObject::DomainSearch(search_results) = result {
println!("Found {} domains", search_results.domains.len());
for domain in &search_results.domains {
if let Some(name) = &domain.ldh_name {
println!(" - {}", name);
}
}
}
Ok(())
}
EntitySearchResults
Container for entity search query results.
Informational notices about the search
Array of entity objects matching the search
Language tag for textual content
Example
use rdap::{RdapClient, RdapRequest, QueryType, RdapObject};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = RdapClient::new()?;
let request = RdapRequest::new(QueryType::EntitySearch, "ACME*");
let result = client.query(&request).await?;
if let RdapObject::EntitySearch(search_results) = result {
println!("Found {} entities", search_results.entities.len());
for entity in &search_results.entities {
if let Some(handle) = &entity.handle {
println!(" - {}", handle);
}
}
}
Ok(())
}
NameserverSearchResults
Container for nameserver search query results.
Informational notices about the search
Array of nameserver objects matching the search
Language tag for textual content
Example
use rdap::{RdapClient, RdapRequest, QueryType, RdapObject};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = RdapClient::new()?;
let request = RdapRequest::new(QueryType::NameserverSearch, "ns*.example.com");
let result = client.query(&request).await?;
if let RdapObject::NameserverSearch(search_results) = result {
println!("Found {} nameservers", search_results.nameservers.len());
for ns in &search_results.nameservers {
if let Some(name) = &ns.ldh_name {
println!(" - {}", name);
}
}
}
Ok(())
}
Search Support
Not all RDAP servers support search queries. Check the server’s help endpoint or documentation for search capabilities.
Search queries may return partial results due to server limits. Always check the notices field for information about result truncation.