PHPackages                             redbox/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. redbox/whois

ActiveLibrary

redbox/whois
============

v0.10(3y ago)018[1 PRs](https://github.com/johnnymast/redbox-whois/pulls)MITPHPPHP &gt;=8.1

Since Apr 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/johnnymast/redbox-whois)[ Packagist](https://packagist.org/packages/redbox/whois)[ GitHub Sponsors](https://github.com/johnnymast)[ RSS](/packages/redbox-whois/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Redbox-whois
============

[](#redbox-whois)

[![Packagist](https://camo.githubusercontent.com/c005efc5c2aa93bcb96856a2a03ac5731445080cdc763a4c99765ad437e248bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726564626f782f77686f69732e737667)](https://packagist.org/packages/redbox/whois)[![Unit Tests](https://github.com/johnnymast/redbox-whois/actions/workflows/Tests.yml/badge.svg)](https://github.com/johnnymast/redbox-whois/actions/workflows/Tests.yml)[![PhpCS](https://github.com/johnnymast/redbox-whois/actions/workflows/Phpcs.yaml/badge.svg)](https://github.com/johnnymast/redbox-whois/actions/workflows/Phpcs.yaml)[![Test Coverage PHP Package](https://github.com/johnnymast/redbox-whois/raw/master/badges/coverage-badge.svg)](https://github.com/johnnymast/redbox-whois/actions/workflows/pest-coverage.yaml)

This is a Whois library I wrote to use for reconnaissance missions for my pen testing efforts. You could use it yourself because I made it easy to use.

Installation
------------

[](#installation)

```
$ composer require redbox/whois
```

Usage
-----

[](#usage)

The package is flexible and easy to use. Here are a few examples of how you could use the package.

### Simple static call

[](#simple-static-call)

```
use Redbox\Whois\Exceptions\WhoisException;
use Redbox\Whois\WhoisClient;

try {
    $whois = WhoisClient::domain('google.com')
        ->getOutput();

    echo $whois;

} catch (WhoisException $e) {
    echo $e->getMessage();
}
```

### Use it without the static call

[](#use-it-without-the-static-call)

The static call mentioned above is just a clever wrapper around the lookup function. You can instantiate the WhoisClient yourself and call the lookup function. Note as well we are using the getOutput() function to get the output of the lookup.

```
use Redbox\Whois\Exceptions\WhoisException;
use Redbox\Whois\WhoisClient;

try {

    $whois = new WhoisClient();
    $result = $whois->lookup('google.nl')
        ->getOutput();

    echo $result;

} catch (WhoisException $e) {
    echo $e->getMessage();
}
```

### Save the output to a file

[](#save-the-output-to-a-file)

The saveOutput function has an optional parameter: the path to the file. If you do not specify a path the output will be stored as whois.txt. The saveOutput function will return the WhoisClient object so you can chain it with getOutput() if you wish.

```
use Redbox\Whois\Exceptions\WhoisException;
use Redbox\Whois\WhoisClient;

try {

    $whois = new WhoisClient();
    $output = $whois->lookup('google.fr')
        ->saveOutput('output.txt')
        ->getOutput();

    echo $output;;

} catch (WhoisException $e) {
    echo $e->getMessage();
}
```

Special thanks
--------------

[](#special-thanks)

I needed a [list](https://github.com/johnnymast/redbox-whois/blob/master/src/Servers.php) of TLDs and their whois servers. This list of servers I found in the [PHP WHOIS](https://github.com/io-developer/php-whois) project. If you are looking for even more options to configure, check out that project. Besides more options, it will also support php versions ranging from 5.6 to the latest and current PHP version.

The MIT License (MIT)
=====================

[](#the-mit-license-mit)

Copyright (c) 2023 Johnny Mast

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~0 days

Total

2

Last Release

1137d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5a228d3118e6b9e3c3c189ea1c8d3a13ed4c9ac312b9217654c81f6d4214cc8?d=identicon)[johnnymast](/maintainers/johnnymast)

---

Top Contributors

[![johnnymast](https://avatars.githubusercontent.com/u/121194?v=4)](https://github.com/johnnymast "johnnymast (23 commits)")

---

Tags

reconreconnaissanceserviceswhoiswhois-lookup

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

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

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

PHPackages © 2026

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