Skip to content

Repository files navigation

rdap-java

CIJava 11+MIT LicenseMaven Central

Lightweight RDAP client library to check if a domain is registered.

Supports all TLDs via IANA bootstrap data + built-in fallback for TLDs not yet registered with IANA.

Features

  • Check domain registration status (registered / available)
  • Supports all TLDs (including IDN TLDs) via IANA bootstrap + curated fallback
  • Automatic RDAP server discovery per TLD
  • Fallback across multiple RDAP servers per TLD
  • Custom server registration for unsupported TLDs
  • IDN/Punycode support
  • Nameserver extraction from RDAP responses
  • Thread-safe, cached IANA bootstrap
  • Zero heavy frameworks – just Java 11+ and org.json
  • ~5 KB library code

Requirements

  • Java 11+

Installation

Gradle

repositories {
mavenCentral()
}
dependencies {
implementation 'com.slxca:rdap-java:1.0.0'
}

Maven

<dependency>
<groupId>com.slxca</groupId>
<artifactId>rdap-java</artifactId>
<version>1.0.0</version>
</dependency>

Manual

Download the JAR from Releases.

Usage

Basic check

importcom.slxca.rdap.RDAPClient;
importcom.slxca.rdap.RDAPResult;
RDAPClientclient = newRDAPClient();
RDAPResultresult = client.checkDomain("google.com");
if (result.isRegistered()) {
System.out.println(result.getDomain() + " is registered");
} else {
System.out.println(result.getDomain() + " is available");
}

Output:

google.com is registered

Nameservers

RDAPResultresult = client.checkDomain("google.com");
for (Stringns : result.getNameservers()) {
System.out.println("NS: " + ns);
}

Custom RDAP server

client.registerServer("io", "https://rdap.afilias.net/rdap/");
RDAPResultresult = client.checkDomain("example.io");

Command line

java -jar rdap-java.jar google.com

API

RDAPClient

MethodReturnsDescription
RDAPClient()Creates client with default HttpClient
RDAPClient(HttpClient)Creates client with custom HttpClient
checkDomain(String domain)RDAPResultQueries RDAP for the domain
registerServer(String tld, String serverUrl)voidRegisters a custom RDAP server for a TLD

RDAPResult

MethodReturnsDescription
getDomain()StringThe queried domain
isRegistered()booleantrue if HTTP 200, false if 404
getServerUrl()StringRDAP server used
getNameservers()List<String>Nameservers from the RDAP response

Exceptions

  • RDAPException – network errors or no RDAP server found for TLD
  • IllegalArgumentException – null/blank/invalid domain

How it works

  1. TLD extraction – Extracts the top-level domain from the input (e.g. example.comcom)
  2. Server lookup – Checks custom servers → IANA bootstrap → built-in fallback
  3. RDAP query – Sends GET {serverUrl}/domain/{domain} with Accept: application/rdap+json
  4. Result – HTTP 200 → registered, HTTP 404 → not registered

Supported TLDs

SourceCountExamples
IANA bootstrap~1200.com, .org, .net, .uk, .fr
Built-in fallback5.de, .ch, .us, .no, .nl

Missing a TLD? Open an issue or use registerServer() to add it yourself.

About

Lightweight RDAP client for Java – check domain registration for all TLDs

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Contributors

Languages