Lightweight RDAP client for Java. Modern WHOIS alternative to check domain registration and availability across all TLDs.
See the codeA lightweight, high-performance RDAP client library for Java. A modern, structured alternative to legacy WHOIS socket queries to check domain registration status and availability.
Supports all TLDs via IANA bootstrap data, automatic RDAP server discovery, and built-in fallbacks.
HttpClient and org.json (~5 KB library overhead).repositories {
mavenCentral()
}
dependencies {
implementation("com.slxca:rdap-java:1.0.0")
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.slxca:rdap-java:1.0.0'
}
<dependency>
<groupId>com.slxca</groupId>
<artifactId>rdap-java</artifactId>
<version>1.0.0</version>
</dependency>
Grab the latest pre-built .jar from the Releases page.
import com.slxca.rdap.RDAPClient;
import com.slxca.rdap.RDAPResult;
import com.slxca.rdap.RDAPException;
public class Main {
public static void main(String[] args) {
RDAPClient client = new RDAPClient();
try {
RDAPResult result = client.checkDomain("example.com");
if (result.isRegistered()) {
System.out.println(result.getDomain() + " is already taken.");
System.out.println("RDAP Server: " + result.getServerUrl());
} else {
System.out.println(result.getDomain() + " is available for registration!");
}
} catch (RDAPException e) {
System.err.println("RDAP lookup failed: " + e.getMessage());
}
}
}
RDAPResult result = client.checkDomain("google.com");
if (result.isRegistered()) {
System.out.println("Nameservers:");
for (String ns : result.getNameservers()) {
System.out.println(" - " + ns);
}
}
If a registry is not part of the IANA bootstrap registry or uses a dedicated endpoint, register it manually:
client.registerServer("io", "[https://rdap.afilias.net/rdap/](https://rdap.afilias.net/rdap/)");
RDAPResult result = client.checkDomain("example.io");
HttpClient ConfigurationPass your own configured HttpClient (e.g., custom timeouts, proxy settings):
import java.net.http.HttpClient;
import java.time.Duration;
HttpClient customHttp = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(5))
.build();
RDAPClient client = new RDAPClient(customHttp);
Run the packaged JAR directly from your terminal:
java -jar rdap-java.jar google.com
RDAPClient| Method | Returns | Description |
|---|---|---|
RDAPClient() | Creates an instance using the default HttpClient. | |
RDAPClient(HttpClient client) | Creates an instance using a custom HttpClient. | |
checkDomain(String domain) | RDAPResult | Performs an RDAP lookup for the given domain. |
registerServer(String tld, String serverUrl) | void | Registers or overrides an RDAP server URL for a specific TLD. |
RDAPResult| Method | Returns | Description |
|---|---|---|
getDomain() | String | Returns the queried domain. |
isRegistered() | boolean | Returns true if HTTP 200 (registered), false if HTTP 404 (available). |
getServerUrl() | String | Returns the RDAP endpoint URL used for the query. |
getNameservers() | List<String> | Returns authoritative nameservers parsed from the RDAP response. |
RDAPException – Thrown on network issues, HTTP errors other than 404, or if no RDAP endpoint was discoverable.IllegalArgumentException – Thrown when passing null, empty, or malformed domain strings.sub.example.co.uk or münchen.de via IDN Punycode).Accept: application/rdap+json.| Registry Source | Count | Examples |
|---|---|---|
| IANA Bootstrap | ~1200+ | .com, .org, .net, .uk, .fr |
| Built-in Fallbacks | Curated | .de, .ch, .us, .no, .nl |
Missing a TLD? Feel free to open an issue or submit a Pull Request.
This project is licensed under the MIT License
12 commits
Java
88.2%
Shell
11.8%
Lightweight RDAP client for Java. Modern WHOIS alternative to check domain registration and availability across all TLDs.
See the codeA lightweight, high-performance RDAP client library for Java. A modern, structured alternative to legacy WHOIS socket queries to check domain registration status and availability.
Supports all TLDs via IANA bootstrap data, automatic RDAP server discovery, and built-in fallbacks.
HttpClient and org.json (~5 KB library overhead).repositories {
mavenCentral()
}
dependencies {
implementation("com.slxca:rdap-java:1.0.0")
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.slxca:rdap-java:1.0.0'
}
<dependency>
<groupId>com.slxca</groupId>
<artifactId>rdap-java</artifactId>
<version>1.0.0</version>
</dependency>
Grab the latest pre-built .jar from the Releases page.
import com.slxca.rdap.RDAPClient;
import com.slxca.rdap.RDAPResult;
import com.slxca.rdap.RDAPException;
public class Main {
public static void main(String[] args) {
RDAPClient client = new RDAPClient();
try {
RDAPResult result = client.checkDomain("example.com");
if (result.isRegistered()) {
System.out.println(result.getDomain() + " is already taken.");
System.out.println("RDAP Server: " + result.getServerUrl());
} else {
System.out.println(result.getDomain() + " is available for registration!");
}
} catch (RDAPException e) {
System.err.println("RDAP lookup failed: " + e.getMessage());
}
}
}
RDAPResult result = client.checkDomain("google.com");
if (result.isRegistered()) {
System.out.println("Nameservers:");
for (String ns : result.getNameservers()) {
System.out.println(" - " + ns);
}
}
If a registry is not part of the IANA bootstrap registry or uses a dedicated endpoint, register it manually:
client.registerServer("io", "[https://rdap.afilias.net/rdap/](https://rdap.afilias.net/rdap/)");
RDAPResult result = client.checkDomain("example.io");
HttpClient ConfigurationPass your own configured HttpClient (e.g., custom timeouts, proxy settings):
import java.net.http.HttpClient;
import java.time.Duration;
HttpClient customHttp = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(5))
.build();
RDAPClient client = new RDAPClient(customHttp);
Run the packaged JAR directly from your terminal:
java -jar rdap-java.jar google.com
RDAPClient| Method | Returns | Description |
|---|---|---|
RDAPClient() | Creates an instance using the default HttpClient. | |
RDAPClient(HttpClient client) | Creates an instance using a custom HttpClient. | |
checkDomain(String domain) | RDAPResult | Performs an RDAP lookup for the given domain. |
registerServer(String tld, String serverUrl) | void | Registers or overrides an RDAP server URL for a specific TLD. |
RDAPResult| Method | Returns | Description |
|---|---|---|
getDomain() | String | Returns the queried domain. |
isRegistered() | boolean | Returns true if HTTP 200 (registered), false if HTTP 404 (available). |
getServerUrl() | String | Returns the RDAP endpoint URL used for the query. |
getNameservers() | List<String> | Returns authoritative nameservers parsed from the RDAP response. |
RDAPException – Thrown on network issues, HTTP errors other than 404, or if no RDAP endpoint was discoverable.IllegalArgumentException – Thrown when passing null, empty, or malformed domain strings.sub.example.co.uk or münchen.de via IDN Punycode).Accept: application/rdap+json.| Registry Source | Count | Examples |
|---|---|---|
| IANA Bootstrap | ~1200+ | .com, .org, .net, .uk, .fr |
| Built-in Fallbacks | Curated | .de, .ch, .us, .no, .nl |
Missing a TLD? Feel free to open an issue or submit a Pull Request.
This project is licensed under the MIT License
12 commits
Java
88.2%
Shell
11.8%