PHPackages                             arubacao/tld-checker - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. arubacao/tld-checker

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

arubacao/tld-checker
====================

Top Level Domain (TLD) validation library for PHP

2.0.5(6d ago)731.7M↓49.6%15[1 PRs](https://github.com/arubacao/tld-checker/pulls)2MITPHPPHP ^8.1CI passing

Since Nov 25Pushed 6d ago3 watchersCompare

[ Source](https://github.com/arubacao/tld-checker)[ Packagist](https://packagist.org/packages/arubacao/tld-checker)[ Docs](https://github.com/arubacao/tld-checker)[ RSS](/packages/arubacao-tld-checker/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (10)Versions (359)Used By (2)

Top Level Domain (TLD) validation library for PHP
=================================================

[](#top-level-domain-tld-validation-library-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/27612a5852bd06f2a8a8376b34dd9677a28ee7c39376eabed4f338ee27548731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617275626163616f2f746c642d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arubacao/tld-checker)[![CI](https://camo.githubusercontent.com/f0e061d6b7b00525d481d12f0d0225d89c0efdb23d696b338eb82b5b01a5f883/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617275626163616f2f746c642d636865636b65722f63692e796d6c3f6272616e63683d6d6173746572266c6162656c3d6369267374796c653d666c61742d737175617265)](https://github.com/arubacao/tld-checker/actions/workflows/ci.yml)[![IANA TLD Update](https://camo.githubusercontent.com/edb8c8781415799977f10439a9421387877de3c611dd33fb861f9eedd8439e30/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617275626163616f2f746c642d636865636b65722f7570646174652d746c642d64617461626173652e796d6c3f6272616e63683d6d6173746572266c6162656c3d69616e61253230757064617465267374796c653d666c61742d737175617265)](https://github.com/arubacao/tld-checker/actions/workflows/update-tld-database.yml)[![Total Downloads](https://camo.githubusercontent.com/ccf335aa44b5487d3005764cf70063dbec86e1063b9b09f1646818135dee713e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617275626163616f2f746c642d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arubacao/tld-checker)

This package allows **validation** of **top level domains** against the official [The DNS Root Zone](https://www.iana.org/domains/root) database from [iana.org](https://www.iana.org/).
Use this to validate e.g. **domains** or **email addresses**.

> [The DNS Root Zone](https://www.iana.org/domains/root) is the upper-most part of the DNS hierarchy, and involves delegating administrative responsibility of “top-level domains”, which are the last segment of a domain name, such as .com, .uk and .nz.

*The database is stored [locally](src/RootZoneDatabase.php) and automatically updated for new database versions.*

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

[](#installation)

Install this package via composer:

```
composer require arubacao/tld-checker
```

#### Laravel

[](#laravel)

Laravel auto-discovery registers the service provider for supported Laravel versions. If auto-discovery is disabled in your application, register the provider manually:

```
// config/app.php

'providers' => [
    // Other Service Providers
    Arubacao\TldChecker\TldCheckerServiceProvider::class,
],
```

Notes:

- `arubacao/tld-checker` is tested with GitHub Actions for PHP `8.1` - `8.5` &amp; Laravel `9.x` - `13.x`.

Usage
-----

[](#usage)

Check a TLD using `Validator::isTld()`:

```
use Arubacao\TldChecker\Validator;

Validator::isTld('com');        // true
Validator::isTld('CN');         // true (case insensitiv)
Validator::isTld('москва');     // true (works with internationalized domain name (IDN) | unicode)
Validator::isTld('XN--CZRS0T'); // true (works with encoded IDN | 商店)
Validator::isTld('.org');       // true (allows dot prefix)
Validator::isTld('apricot');    // false
```

Check if a string ends with a valid TLD using `Validator::endsWithTld()`:

```
use Arubacao\TldChecker\Validator;

Validator::endsWithTld('apple.com');                            // true
Validator::endsWithTld('NEWS.CN');                              // true (case insensitiv)
Validator::endsWithTld('müller.vermögensberater');              // true (works with internationalized domain name (IDN) | unicode)
Validator::endsWithTld('xn--mller-kva.xn--vermgensberater-ctb');// true (works with encoded IDN | müller.vermögensberater)
Validator::endsWithTld('farming.apricot');                      // false
```

This package extends the [Laravel Validator](https://laravel.com/docs/validation/latest) with these 2 methods:

- `is_tld`
- `ends_with_tld`

Use them as follows:

```
$request->validate([
    'tld' => 'required|is_tld',
    'email' => 'required|ends_with_tld'
]);
```

Testing
-------

[](#testing)

```
composer test
```

Maintenance
-----------

[](#maintenance)

Refresh the generated IANA database locally:

```
composer build
```

The repository also has a scheduled GitHub Actions workflow that runs every Sunday at `04:01 UTC`. If IANA has published a new root zone version, the workflow commits the refreshed `src/RootZoneDatabase.php` file and tags the next patch release so Packagist can pick it up.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Christopher Lass](https://github.com/arubacao)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance98

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.9% 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 ~8 days

Total

355

Last Release

6d ago

Major Versions

1.3.0 → 2.0.02026-05-26

PHP version history (3 changes)1.0PHP ^7.0

1.2.70PHP ^7.0|^8.0

2.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7462542?v=4)[Christopher Lass](/maintainers/arubacao)[@arubacao](https://github.com/arubacao)

---

Top Contributors

[![arubacao](https://avatars.githubusercontent.com/u/7462542?v=4)](https://github.com/arubacao "arubacao (654 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (184 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (2 commits)")[![andrewboerema](https://avatars.githubusercontent.com/u/1569403?v=4)](https://github.com/andrewboerema "andrewboerema (1 commits)")[![Webkadabra](https://avatars.githubusercontent.com/u/1168612?v=4)](https://github.com/Webkadabra "Webkadabra (1 commits)")[![daniel-farina](https://avatars.githubusercontent.com/u/13665117?v=4)](https://github.com/daniel-farina "daniel-farina (1 commits)")[![lukaszwit](https://avatars.githubusercontent.com/u/1374694?v=4)](https://github.com/lukaszwit "lukaszwit (1 commits)")[![tomvo](https://avatars.githubusercontent.com/u/1503385?v=4)](https://github.com/tomvo "tomvo (1 commits)")

---

Tags

domainianalaravelphptldvalidationemaildomaintldtld-checker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arubacao-tld-checker/health.svg)

```
[![Health](https://phpackages.com/badges/arubacao-tld-checker/health.svg)](https://phpackages.com/packages/arubacao-tld-checker)
```

###  Alternatives

[egulias/email-validator

A library for validating emails against several RFCs

11.7k734.8M443](/packages/egulias-email-validator)[dominicsayers/isemail

Checks an email address against the following RFCs: 3696, 1123, 4291, 5321, 5322

309144.3k3](/packages/dominicsayers-isemail)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

254168.5k](/packages/erag-laravel-disposable-email)[kickbox/kickbox

Official kickbox API library client for PHP

591.1M4](/packages/kickbox-kickbox)[neverbounce/neverbounce-php

This package provides convenient methods to integrate the NeverBounce API into your project.

241.2M3](/packages/neverbounce-neverbounce-php)[stymiee/email-validator

A robust PHP 7.4+ email validation library that extends beyond basic validation with MX record checks, disposable email detection, and free email provider validation. Features include strict typing, custom validator support, internationalization (i18n), and an extensible architecture. Perfect for applications requiring thorough email verification with customizable validation rules.

33487.3k1](/packages/stymiee-email-validator)

PHPackages © 2026

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