PHPackages                             wrossmann/whois - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wrossmann/whois

ActiveLibrary

wrossmann/whois
===============

1.0.0(10y ago)117MITPHPPHP &gt;=5.4.0

Since Mar 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/wrossmann/php-whois)[ Packagist](https://packagist.org/packages/wrossmann/whois)[ RSS](/packages/wrossmann-whois/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

wrossmann/whois - WHOIS Client object for PHP
=============================================

[](#wrossmannwhois---whois-client-object-for-php)

Features:
---------

[](#features)

- Simplified resolution of domains names and IP addresses
- Does not rely on distributed lists of WHOIS servers, uses IANA/ARIN 'root' server referrals.
- Includes optional, simple, PDO-driven caching functionality to improve response times and mediate load on WHOIS roots.
- Requires only PHP &gt;= 5.4, no external binaries or libraries.
- PHP7 compatible.

Classes
-------

[](#classes)

All classes take an optional final parameter that is an array containing key =&gt; value pairs that can be used to override certain protected properties. Overrideable parameters set in each class' private `$overrides` parameter, and are detailed below.

### \\wrossmann\\whois\\Whois - Base WHOIS class.

[](#wrossmannwhoiswhois---base-whois-class)

Public Methods:

- `void __construct(array $params = [])`
- `string query(string $domain)`
- `static string stripComments(string $input, bool $strip_blank = true, string $regex = '/^(?:#|%).*$/')`
    - Strips comments from WHOIS responses, generally formatted as lines beginning with either `#` or `%`.
    - Second parameter controls stripping of blank lines
    - Third parameted allows the comment matching regex to be overridden.

Overrideable Parameters:

- `max_response_size` - The maximum amount of data, in bytes, to accept from a WHOIS response. \[Default: `20480`\]
- `normalize_line_breaks` - If true replaces all instances of `\r\n` with `\n`. \[Default: `true`\]

### \\wrossmann\\whois\\CachedWhois - WHOIS class with simple caching to a PDO database

[](#wrossmannwhoiscachedwhois---whois-class-with-simple-caching-to-a-pdo-database)

Public Methods:

- Public methods inherited from parent class `Whois`.
- `void __construct(\PDO $dbh, array $params = [])`
- `static boolean initDB(\PDO $dbh)`
    - Issues `CREATE TABLE IF NOT EXISTS` statement to create table, see `src/CachedWhois.php`.

Overrideable Parameters:

- `cache_lifetime` - Length of time, is seconds, to cache a TLD WHOIS server referral. \[Default `604800` aka 7 days\]

### \\wrossmann\\whois\\IPWhois - Class for performing IPWHOIS queries

[](#wrossmannwhoisipwhois---class-for-performing-ipwhois-queries)

Public Methods:

- Public methods inherited from parent class `Whois`.
- `void __construct(array $params=[])`
- `string function query(string $ipaddr)`
- `static bool validateIP(string $ipaddr)`

Overrideable Parameters: None

Interfaces
----------

[](#interfaces)

### WhoisInterface

[](#whoisinterface)

- `string query(string $domain)`
- `static string stripComments(string $input, bool $strip_blank = true, string $regex = '/^(?:#|%).*$/') `

TODO
----

[](#todo)

- `CachedIPWhois` Class
- Make `IPWhois::validate()` check for reserved addresses.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3711d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07eeb654c6e5293a620e4eb42138f331bc966fe0c26e54b7581aee28ee5c03c7?d=identicon)[wrossmann](/maintainers/wrossmann)

---

Top Contributors

[![wrossmann](https://avatars.githubusercontent.com/u/4967671?v=4)](https://github.com/wrossmann "wrossmann (6 commits)")

### Embed Badge

![Health badge](/badges/wrossmann-whois/health.svg)

```
[![Health](https://phpackages.com/badges/wrossmann-whois/health.svg)](https://phpackages.com/packages/wrossmann-whois)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
