ICANN RDAP Server

This server was created to aid in the development of the ICANN RDAP Command Line Interface client. It can be used as a library or as a server started within its own process. It currently has in-memory storage, though its storage layer is architected to accomodate a PostgreSQL backend if that is needed in the future.

RDAP core support is as follows:

Compiling from Source

If you have Rust installed on your system, then compiling from source is very straightforward. If you do not have Rust installed on your system, it is usually very easy to do: see Rustup.

If you are on a Linux system, you will need OpenSSL development files. For Debian and Ubuntu, this is usually done via apt install pkg-config libssl-dev. For other Linux systems, consult your packaging documentation.

For macOS and Windows, the native TLS libraries are used, and there are no steps needed to install them.

Run the tests: cargo test

Then build the software: cargo build --release. The 'rdap-srv' executable binary will be available in the target/release directory.

Quick Start

Create a .env file in the directory where you intend to run the commands, and put the following in that file:

RDAP_SRV_LOG=debug
RDAP_SRV_DATA_DIR=/tmp/rdap-srv/data
RDAP_BASE_URL=http://localhost:3000/rdap

Create directory in /tmp to hold server data files:

mkdir -p /tmp/rdap-srv/data

Create some data:

./target/release/rdap-srv-data entity --handle foo1234 --email joe@example.com --full-name "Joe User"
./target/release/rdap-srv-data nameserver --ldh ns1.example.com --registrant foo1234

Start the server:

./target/release/rdap-srv

Query the server with the client in another terminal:

./target/release/rdap -B http://localhost:3000/rdap ns1.example.com

While the server is running, do the following in a separate terminal to add some more data:

./target/release/rdap-srv-data domain --ldh example.com --registrant foo1234 --ns ns1.example.com
./target/release/rdap-srv-store --update

Query the server for the new data:

./target/release/rdap -B http://localhost:3000/rdap example.com

For more information on the options available, use the --help option.

Running the Server

The server is configured via environment variables. These variables can be configured in a shell script or whatever normal means are used to set environment variables. Additionally, they may be placed in a .env in the current directory.

Memory Storage

The data for the memory storage is specified by the "RDAPSRVDATA_DIR" environment variable. Files in this directory are either valid RDAP JSON files, or template files containing valid RDAP JSON. Files ending in .json are considered to be RDAP JSON, and files ending in .template are considered to be template files.

Template files are also JSON, however they allow the creation of multiple RDAP objects using one RDAP template. The basic structure is as follows:

json { "domain": { "objectClassName":"domain", "ldhName":"example" }, "ids": [ {"ldhName":"bar.example"}, {"ldhName":"foo.example"} ] }

The IDs array differs for every object class:

Memory storage supports hot reloading. This can be done by "touching" either the file named "update" or "reload" in the data directory. The "update" file triggers an update but does not remove any previous data unless that data exists in the data directory files. The "reload" file triggers a full reload, removing all previous data and replacing it with the data from the files in the data directory.

Alternatively, you can use the rdap-srv-store command to touch the files to trigger reloads and updates: rdap-srv-store --update or rdap-srv-store --reload.

Create Data

RDAP data can often be tricky to create, but the rdap-srv-data command makes it easier. This command does not cover all possible RDAP expressions, but it does cover the common scenarios and can be used as a starting point for those who require more complex RDAP data.

This command has 5 sub-commands, each with its own specific set of command line arguments. Use the --help option to see the arguments for each sub-command.

rdap-srv-data entity --help
rdap-srv-data nameserver --help
rdap-srv-data domain --help
rdap-srv-data autnum --help    
rdap-srv-data network --help

Use Your Data

As mentioned above, the rdap-srv-store command can be used to signal a reload or update of the server. This command can also be used to copy your own data into the data directory by specifiing a directory:

rdap-srv-store --update /my_data/rdap

This command will perform checks on your data while copying them to ensure the data is RDAP compliant.