PHPackages                             xandco/whoisparser - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xandco/whoisparser

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

xandco/whoisparser
==================

Whois Parser, parses and formats raw whois query data.

v1.0.0(5y ago)113MITPHP

Since Nov 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xandco/whoisparser)[ Packagist](https://packagist.org/packages/xandco/whoisparser)[ Docs](https://github.com/xandco/whoisparser)[ RSS](/packages/xandco-whoisparser/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (3)Used By (0)

Whois Parser
============

[](#whois-parser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/35bdcb2d740f9679b1e75d604bc9c7a361fc6ae2a642d9f79a51876dcff7d824/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78616e64636f2f77686f69737061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xandco/whoisparser)[![Total Downloads](https://camo.githubusercontent.com/6f2c7ba1b61cfa4de190c9fccac909c08b8c57a33578fe0551756b8db64d9373/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f78616e64636f2f77686f69737061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xandco/whoisparser)[![License](https://camo.githubusercontent.com/0bf00829cd4026fc9d967d28fd6923ac56025718acb38751640314a8723b2582/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f78616e64636f2f77686f69737061727365723f7374796c653d666c61742d737175617265)](https://github.com/xandco/whoisparser/blob/master/license.md)

Whois Parser simply parses raw root or whois data that you supply.

During the parsing process, the package will do a few checks via regular expressions, to determine that the input data is workable as well as determine if the input contains errors or if you've been rate limited. Then the package will clean the input data and format each line into key value pairs. Once that has been completed it will start to iterate through and parse the data into a more readable form and into a reliable output based on your output format preference.

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

[](#installation)

Install this package via composer:

```
$ composer require xandco/whoisparser
```

This service provider must be installed (if using anything below Laravel 5.5)

```
// config/app.php

'providers' => [
    WhoisParser\WhoisParserServiceProvider::class,
];
```

Publish and customize configuration file with:

```
$ php artisan vendor:publish --provider="WhoisParser\WhoisParserServiceProvider"
```

Usage
-----

[](#usage)

Create new `WhoisParser` object:

```
use WhoisParser\WhoisParser;
...
$whoisParser = new WhoisParser( $options = [] );
```

You will need to get the whois data for whatever domain you'd like with an external method, WhoisParser just parses said data. Once you have your raw whois data you can call the `parse()` method to parse the data:

```
$whoisParser->parse( '% IANA WHOIS server\n...' ); // root data
$whoisParser->parse( 'Domain Name: EXAMPLE.COM\n...' ); // whois data
```

Based on whether you provide root data or whois data, the package will return differently structured objects. You will be able to check the type of object returned based on the `type` key containing either the value `root` or `whois`.

Here is an example of both outputs:

```
/*
 * Example of the `root` type output
 */
[
    'domain' => 'com',
    'is_valid' => true,
    'type' => 'root',
    'data' => [
        'status' => 'active',
        'whois' => 'whois.example.com',
        'contacts' => [
            'sponsor' => [
                'organisation' => 'Example Global Registry Services',
                'address' => [
                    '12345 Example Way',
                    'San Francisco California 94112',
                    'United States'
                ]
            ],
            'administrative' => [...],
            'technical' => [...],
        ],
        'nameservers' => [
            [
                'host' => 'ns.example.com',
                'ipv4' => '127.0.0.0',
                'ipv6' => '::1'
            ],
            ...
        ],
        'dates' => [
            'created' => '1985-01-01 00:00:00',
            'updated' => '2017-10-05 00:00:00',
        ]
    ],
    'raw' => '% IANA WHOIS server\n...' // depending on options
]

/*
 * Example of the `whois` type output
 */
[
    'domain' => 'example.com',
    'is_valid' => true,
    'is_reserved' => false,
    'is_available' => false,
    'type' => 'whois',
    'data' => [
        '_id' => '0897654321_DOMAIN_COM-EXPL',
        'status' => [
            [
                'code' => 'clientUpdateProhibited',
                'url' => 'https:\/\/www.icann.org\/epp#clientUpdateProhibited'
            ],
            ...
        ],
        'whois' => 'whois.example.com',
        'registrar' => [
            '_id' => '123',
            'name' => 'Example, Inc.',
            'whois' => 'whois.example.com',
            'abuse_contact' => [
                'email' => 'abuse@example.com',
                'phone' => '+1.4003219876',
            ],
        ],
        'contacts' => [
            'registrant' => [
                'name' => 'Domain Administrator',
                'organization' => 'Example Corporation',
                'address' => {
                   'street' => '12345 Example Way',
                   'city' => 'San Francisco',
                   'state_province' => 'CA',
                   'postal_code' => '94112',
                   'country' => 'US'
                 },
                'phone' => '+1.0981237645',
                'phone_ext' => null,
                'fax' => '+1.1230984567',
                'fax_ext' => null,
                'email' => 'admin@example.com',
            ],
            'administrative' => [...],
            'technical' => [...],
            'billing' => [...], // depending on options
        ],
        'nameservers' => [
            [
                'host' => 'ns.example.com',
                'ipv4' => null, // depending on options
                'ipv6' => null // depending on options
            ],
            ...
        ],
        'dnssec' => 'unsigned',
        'dates' => [
            'created' => '1991-05-01 21:00:00',
            'updated' => '2020-06-03 13:24:15',
            'expiration' => '2021-05-02 21:00:00',
        ]
    ],
    'raw' => 'Domain Name: EXAMPLE.COM\n...' // depending on options
]
```

### Options

[](#options)

When creating the `WhoisParser` object, there is only one `array` parameter that can be passed, which is *optional*.

Options array parameters:

OptionNotesTypeDefault`output_format`options (`object`, `array`, `json`, `serialize`)`string``object``get_nserver_ip`try getting nameserver ips (using `gethostbyname()`)`bool``false``parse_billing`try parsing billing contact (not always available)`bool``false``return_raw_data`debug option, return raw input`bool``false`Instead of setting these options when creating the object, you can alternatively set these globally in the configuration file, as well as modify the regex patterns used to determine things like: invalid, rate limited whois responses and reserved, taken, available domains. You can publish the configuration and customize it as shown in the [Installation](#installation) section.

Changelog
---------

[](#changelog)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [X&amp;Co](https://github.com/xandco)
- [Miguel Batres](https://github.com/btrsco)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT - Please see the [license file](license.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

2043d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63671917?v=4)[X&amp;Co](/maintainers/xandco)[@xandco](https://github.com/xandco)

---

Top Contributors

[![btrsco](https://avatars.githubusercontent.com/u/1373528?v=4)](https://github.com/btrsco "btrsco (9 commits)")

---

Tags

laravelwhoisparser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xandco-whoisparser/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40146.5k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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