https://github.com/gemorroj/whordap
https://github.com/gemorroj/whordap
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/gemorroj/whordap
- Owner: Gemorroj
- License: lgpl-3.0
- Created: 2025-03-31T16:15:06.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-05-04T19:40:34.000Z (about 1 month ago)
- Last Synced: 2025-05-04T20:35:59.497Z (about 1 month ago)
- Language: PHP
- Size: 233 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhoRdap
[](https://packagist.org/packages/gemorroj/whordap)
[](https://packagist.org/packages/gemorroj/whordap)
[](https://github.com/Gemorroj/whordap/actions?query=workflow%3A%22Continuous+Integration%22)### Features:
- WHOIS/RDAP info for domains, IPv4/IPv6, CIDR, ASN
- Support national domains (президент.рф for example)
- Follow to registrar WHOIS/RDAP servers (whois.crsnic.net -> whois.nic.ru for example)
- Force custom WHOIS/RDAP server### Requirements:
- PHP >= 8.4
- ext-curl### Installation:
```bash
composer require gemorroj/whordap
```### Example:
```php
processWhois('ru');
// $data = $whois->processRdap('ru');
// $data = $whois->processWhois('127.0.0.1');
// $data = $whois->processWhois('192.168.0.0/24'); // CIDR
// $data = $whois->processWhois('2001:0db8:85a3:0000:0000:8a2e:0370:7334');
// $data = $whois->processWhois('AS220');
// $data = $whois->processWhois('sirus.su', 'whois.tcinet.ru'); // custom WHOIS server
// $data = $whois->processRdap('sirus.su', 'https://www.nic.ru/rdap'); // custom RDAP server
$data = $whois->processWhois('vk.com');
$actualResponse = $data instanceof WhoisDomainResponse && $data->registrarResponse instanceof WhoisDomainRegistrarResponse ? $data->registrarResponse : $data;
// echo $actualResponse->response;print_r($data);
/*
WhoRdap\Response\WhoisDomainResponse Object
(
[response] => Domain Name: VK.COM
Registry Domain ID: 3206186_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.nic.ru
...
[server] => whois.verisign-grs.com
[registrarResponse] => WhoRdap\Response\WhoisDomainRegistrarResponse Object
(
[response] => Domain Name: VK.COM
Registry Domain ID: 3206186_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.nic.ru
...
[server] => whois.nic.ru
)
)
*/
```### Notes:
- update WHOIS/RDAP servers:
- ```shell
php bin/rdap-asn-servers-updater.php
php bin/rdap-ip-servers-updater.php
php bin/rdap-tld-servers-updater.php
php bin/whois-asn-servers-updater.php
php bin/whois-ip-servers-updater.php
php bin/whois-tld-servers-updater.php
```
- https://github.com/weppos/whois/tree/main/data
- https://habr.com/ru/articles/165869/
- https://lookup.icann.org/ru/lookup research:
- domain: 1 request to https://data.iana.org/rdap/dns.json, 2 request to rdap server, 3 request to registrar rdap server
- if registrar rdap server fails (vk.com for example), if shows notice and info from prev rdap server
- ipv4: 1 request https://data.iana.org/rdap/ipv4.json, 2 request to rdap server
- ipv6: 1 request https://data.iana.org/rdap/ipv6.json, 2 request to rdap server
- asn: 1 request https://data.iana.org/rdap/asn.json, 2 request to rdap server