定制 naminghive/rdap-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

naminghive/rdap-client

Composer 安装命令:

composer require naminghive/rdap-client

包简介

A PHP client to query RDAP (formerly WHOIS) services

README 文档

README

A modern, robust PHP 8.1+ client to query RDAP (Registration Data Access Protocol) services.

It seamlessly abstracts IANA bootstrap discovery, automatically fetching the correct registry base URLs and performing searches. The library caches bootstrap documents intelligently to prevent redundantly querying IANA limits.

Requirements

Features

  • Backed by Protocol Enums: Strictly typed Protocol configurations.
  • Built-in File Caching: Automatically caches IANA bootstrap mappings for 24-hours using BootstrapCache.
  • Guzzle HTTP Client Integration: Uses robust standard guzzlehttp/guzzle wrappers under the hood, gracefully resolving timeout and protocol issues.

Installation

Install the library via Composer:

composer require naminghive/rdap-client

Usage

Basic Search (Domain)

Use the NamingHive\RDAP\Rdap client instance and the NamingHive\RDAP\Protocol enum to search for domains, IPs, or ASN numbers.

use NamingHive\RDAP\Rdap;
use NamingHive\RDAP\Protocol;

// Initialize an RDAP Client targeting Domain registries
$rdap = new Rdap(Protocol::Domain);

try {
    $response = $rdap->search('google.com');

    if ($response !== null) {
        // Output basic entity information
        echo 'Handle: ' . $response->getHandle() . PHP_EOL;
        echo 'LDH Name: ' . $response->getLDHName() . PHP_EOL;
        
        // Output Name Servers
        foreach ($response->getNameservers() as $nameserver) {
            echo 'Nameserver: ' . $nameserver->getLdhName() . PHP_EOL;
        }
    } else {
        echo "Domain could not be found on any RDAP service.\n";
    }
} catch (NamingHive\RDAP\RdapException $e) {
    echo "Query failed: " . $e->getMessage() . "\n";
}

Searching by IP Address

The flow is identical for IP queries configurations; directly supply the IPv4 or IPv6 protocols.

use NamingHive\RDAP\Rdap;
use NamingHive\RDAP\Protocol;

$rdap = new Rdap(Protocol::Ipv4);
$response = $rdap->search('8.8.4.4');

if ($response !== null) {
    echo 'Notice: ' . $response->getNotices()[0]->getTitle() . "\n";
}

Supporting Standards

This client adheres closely to modern RFC standards. Note that RDAP adoption differs by regional registry.

  • RFC 7480 - HTTP Usage in the Registration Data Access Protocol (RDAP)
  • RFC 7481 - Security Services for the Registration Data Access Protocol (RDAP)
  • RFC 7482 - Registration Data Access Protocol (RDAP) Query Format
  • RFC 7483 - JSON Responses for the Registration Data Access Protocol (RDAP)
  • RFC 7484 - Finding the Authoritative Registration Data (RDAP) Service
  • RFC 9083 - JSON Responses for the Registration Data Access Protocol (RDAP)

Customization

The library allows overrides to both caching methods and Guzzle HTTP wrappers natively.

// Modifying cache durations
use NamingHive\RDAP\Data\Cache\BootstrapCache;

// Changes cache directory & reduces timeout
$customCache = new BootstrapCache(ttl: 3600, cacheDir: __DIR__ . '/var/cache');
$rdap = new Rdap(Protocol::Domain, cache: $customCache);

naminghive/rdap-client 适用场景与选型建议

naminghive/rdap-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 naminghive/rdap-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 naminghive/rdap-client 我们能提供哪些服务?
定制开发 / 二次开发

基于 naminghive/rdap-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 23
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-03-31