Net::RDAP::Service(3p)

NAME
Net::RDAP::Service - a module which provides an interface to an RDAP server.

SYNOPSIS
    use Net::RDAP::Service;

    #
    # create a new service object:
    #

    my $svc = Net::RDAP::Service->new('https://www.example.com/rdap');

    #
    # get a domain:
    #

    my $domain = $svc->domain(Net::DNS::Domain->new('example.com'));

    #
    # do a search:
    #

    my $result = $svc->domains('name' => 'ex*mple.com');

    #
    # get help:
    #

    my $help = $svc->help;

DESCRIPTION
While Net::RDAP provides a unified interface to the universe of RIR, domain registry, and domain registrar RDAP services, Net::RDAP::Service provides an interface to a specific RDAP service.

You can do direct lookup of objects using methods of the same name that Net::RDAP provides. In addition, this module allows you to perform searches.

METHODS

  Constructor
    my $svc = Net::RDAP::Service->new($url);

Creates a new Net::RDAP::Service object. $url is a string or a URI object representing the base URL of the service.

You can also provide a second argument which should be an existing Net::RDAP instance. This is used when fetching resources from the server.

TLD Service Constructor

    my $svc = Net::RDAP::Service->new_for_tld($tld);

This method searches the IANA registry for an entry for the TLD in $tld and returns the corresponding Net::RDAP::Service object.

  Lookup Methods
You can do direct lookups of objects using the following methods:

•   domain()

•   ip()

•   autnum()

•   entity()

•   nameserver()

They all work the same way as the methods of the same name on Net::RDAP.

  Search Methods
You can perform searches using the following methods. Note that different services will support different search functions.

    $result = $svc->domains(%QUERY);

    $result = $svc->entities(%QUERY);

    $result = $svc->nameservers(%QUERY);

    $result = $svc->ips(%QUERY);

    $result = $svc->autnums(%QUERY);

In all cases, %QUERY is a set of search parameters. Here are some examples:

    $result = $svc->domains(name => 'ex*mple.com');

    $result = $svc->entities(fn => 'Ex*ample, Inc');

    $result = $svc->nameservers(ip => '192.0.2.1');

    $result = $svc->ips(handle => 'FOOBAR-RIR');

    $result = $svc->autnums(handle => 'FOOBAR-RIR');

References

•   Domain search: Section 3.2.1 of RFC 9083 <https://www.rfc-editor.org/rfc/rfc9082.html#section-3.2.1>

•   Nameserver search: Section 3.2.2 of RFC 9083 <https://www.rfc-editor.org/rfc/rfc9082.html#section-3.2.2>

•   Entity search: Section 3.2.3 of RFC 9083 <https://www.rfc-editor.org/rfc/rfc9082.html#section-3.2.3>

•   "Reverse" search: RFC 9536 <https://www.rfc-editor.org/rfc/rfc9536.html>

•   IP search (EXPERIMENTAL): Section 2.2 of draft-ietf-regext-rdap-rir-search-11 <https://www.ietf.org/archive/id/draft-ietf-regext-rdap-rir-search-11.html#section-2.2>

•   AS number search (EXPERIMENTAL): Section 2.3 of draft-ietf-regext-rdap-rir-search-11 <https://www.ietf.org/archive/id/draft-ietf-regext-rdap-rir-search-11.html#section-2.3>

Note that not all RDAP servers support all search types or parameters.

The following parameters can be specified:

•   domains: "name" (domain name), "nsLdhName" (nameserver name), "nsIp" (nameserver IP address)

•   nameservers: "name" (host name), "ip" (IP address)

•   entities: "handle", "fn" (Formatted Name)

•   ips: "handle", "name"

•   autnums: "handle", "name"

Search parameters can contain the wildcard character "*" anywhere in the string.

These methods all return Net::RDAP::SearchResult objects.

  "Reverse" Search
IMPORTANT NOTE: due to a lack of server implementations to test against, reverse search. functionality is experimental and should not be relied upon in production code.

Some RDAP servers implement "reverse search" which is specified in RFC 9536 <https://www.rfc-editor.org/rfc/rfc9536.html>. This allows you to search for objects based on their relationship to some other object: for example, to search for domains that have a relationship to a specific entity.

To perform a reverse search (on a server that supports this), pass a set of query parameters using the "entity" parameter:

    $result = $svc->domains(entity => { handle => 9999 });

RIR Relation Searches

Section 3 of draft-ietf-regext-rdap-rir-search-11 <https://www.ietf.org/archive/id/draft-ietf-regext-rdap-rir-search-11.html#section-3> describes searches and link relations for finding objects and sets of objects with respect to their position within a hierarchy.

Some examples:

    $svc->ips(up => q{2001:DB8::42});

Since this specification is in draft, this functionality may change significantly in future versions of this module.

  Help
Each RDAP server has a "help" endpoint which provides "helpful information" (command syntax, terms of service, privacy policy, rate-limiting policy, supported authentication methods, supported extensions, technical support contact, etc). This information may be obtained by performing a "help" query:

    my $help = $svc->help;

The return value is a Net::RDAP::Help object.

  Extension Implementation
You can determine if an RDAP server implements a particular RDAP extension using implements():

    $svc->implements('lunarNic');

This will return a true value if the RDAP server advertises support for the "lunarNic" extension. This methods works by checking the "help" response, and will throw an exception if the help request fails.

COPYRIGHT
Copyright 2018-2023 CentralNic Ltd, 2024-2025 Gavin Brown. For licensing information, please see the "LICENSE" file in the Net::RDAP distribution.