• Stars
    star
    264
  • Rank 154,665 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PHP Class used to check if a domain has been registered

Domain Availability

Latest Version on Packagist Software License Total Downloads

A PHP library used to check domain name availability.

#f03c15 READ THIS, SERIOUSLY:

This is not a reliable way to check for domain availability on a large or even a medium scale, this will not handle your "webhosting business" or anything that requires a high level of data accuracy, if you need something like that, please use WhoAPI or Namecheap's API.

And no, I did not build nor do i support the WordPress plugin that is being sold on CodeCanyon which uses this package under the hood.

Install

$ composer require --dev helgesverre/domain-availability

or

{
    "require": {
        "helgesverre/domain-availability": "~1.5.0"
    }
}

Usage

<?php

require './vendor/autoload.php';

use Helge\Loader\JsonLoader;
use Helge\Client\SimpleWhoisClient;
use Helge\Service\DomainAvailability;

$whoisClient = new SimpleWhoisClient();
$dataLoader = new JsonLoader("path/to/servers.json");

$service = new DomainAvailability($whoisClient, $dataLoader);

if ($service->isAvailable("helgesverre.com")) {
    echo "Domain is available";
} else {
    echo "Domain is already taken!";
}

or look at example.php for a more real world example.

Notes

The WHOIS server list is incomplete and some data is missing. The most popular TLDs are working, though, and I will update these as I can. I suggest making your own list of whois servers and their "not found"-responses so you know which TLD is available. For a full list of TLDs and WHOIS servers please go to the IANA website.

To check what they return when a domain is not found, you simply have to manually query the servers and check.

Supported Domain Extensions

These are the domain extensions that are supported by this script.

.com, .net, .org, .co.uk, .io, .computer, .ac, .academy, .actor, .ae, .aero, .af, .ag, 
.agency, .ai, .am, .archi, .arpa, .as, .asia, .associates, .at, .au, .aw, .ax, .az, .bar, 
.bargains, .bayern, .be, .berlin, .bg, .bi, .bike, .biz, .bj, .blackfriday, .bn, .boutique, .build, 
.builders, .bw, .by, .ca, .cab, .camera, .camp, .capital, .cards, .careers, .cat, .catering, 
.cc, .center, .ceo, .cf, .ch, .cheap, .christmas, .ci, .cl, .cleaning, .clothing, .club, 
.cn, .co, .codes, .coffee, .college, .cologne, .community, .company, .construction, 
.contractors, .cooking, .cool, .coop, .country, .cruises, .cx, .cz, .dating, .de, 
.democrat, .desi, .diamonds, .directory, .dk, .dm, .domains, .dz, .ec, .edu, .education,
.ee, .email, .engineering, .enterprises, .equipment, .es, .estate, .eu, .eus, .events,
.expert, .exposed, .farm, .feedback, .fi, .fish, .fishing, .flights, .florist, .fo, 
.foo, .foundation, .fr, .frogans, .futbol, .ga, .gal, .gd, .gg, .gi, .gift, .gl, .glass,
.gop, .gov, .gq, .graphics, .gripe, .gs, .guitars, .guru, .gy, .haus, .hk, .hn, .holiday, 
.horse, .house, .hr, .ht, .hu, .id, .ie, .il, .im, .immobilien, .in, .industries, 
.institute, .int, .international, .iq, .ir, .is, .it, .je, .jobs, .jp, .kaufen, .ke, 
.kg, .ki, .kitchen, .kiwi, .koeln, .kr, .kz, .la, .land, .lease, .li, .lighting, .limo, 
.link, .london, .lt, .lu, .luxury, .lv, .ly, .ma, .management, .mango, .marketing, .md,
.me, .media, .menu, .mg, .miami, .mk, .ml, .mn, .mo, .mobi, .moda, .monash, .mp, .ms,
.mu, .museum, .mx, .my, .na, .name, .nc, .nf, .ng, .ninja, .nl, .no, .nu, .nz, .om, 
.onl, .paris, .partners, .parts, .pe, .pf, .photo, .photography, .photos, .pics, 
.pictures, .pl, .plumbing, .pm, .post, .pr, .pro, .productions, .properties, .pt, 
.pub, .pw, .qa, .quebec, .re, .recipes, .reisen, .rentals, .repair, .report, .rest, 
.reviews, .rich, .ro, .rocks, .rodeo, .rs, .ru, .ruhr, .sa, .saarland, .sb, .sc, .se,
.services, .sexy, .sg, .sh, .shoes, .si, .singles, .sk, .sm, .sn, .so, .social, .solar, 
.solutions, .soy, .st, .su, .supplies, .supply, .support, .sx, .sy, .systems, .tattoo, 
.tc, .technology, .tel, .tf, .th, .tienda, .tips, .tk, .tl, .tm, .tn, .to, .today, 
.tools, .town, .toys, .tr, .training, .travel, .tv, .tw, .tz, .ua, .ug, .uk, .university, 
.us, .uy, .black, .blue, .info, .kim, .pink, .red, .shiksha, .uz, .vacations, .vc, .ve,
.vegas, .ventures, .vg, .viajes, .villas, .vision, .vodka, .voting, .voyage, .vu, .wang,
.watch, .wed, .wf, .wien, .wiki, .works, .ws, .xxx, .xyz, .yt, .za, .zm, .zone, 

Unsupported Domain Extensions

Due to the fact that a lot of the domain extensions listed on the IANA website do not contain any information on which WHOIS server to use when querying for the domain information, the following domain extensions are not available (yet):

.dj, .do, .eg, .eh, .er, .et, .fj, .fk, .fm, .gallery, .gb, .ge, .gf, .gh, .gm, .gn, .gp,
.gr, .gt, .gu, .gw, .hm, .jetzt, .jm, .jo, .kh, .km, .kn, .kp, .kred, .kw, .ky, .lb, 
.lk, .lr, .ls, .mc, .mf, .mh, .mil, .mm, .moe, .mq, .mr, .mt, .mv, .mw, .mz, .nagoya, .ne, 
.neustar, .ni, .np, .nr, .nyc, .okinawa, .pa, .pg, .ph, .pk, .pn, .ps, .py, .qpon, .ren, 
.rw, .sd, .sj, .sl, .sohu, .sr, .ss, .sv, .sz, .td, .tg, .tj, .tokyo, .tp, .trade, .tt, 
.um, .uno, .va, .vi, .vi, .vn, .webcam, .ye, .yokohoma, .ryukyu, .meet, .vote, .lc, 
.voto, .wed, .zw

If you know the whois server for any of these please feel free to create an issue with an update.

Credits

Notes

If you are getting the error:

Fatal error: Call to undefined function Pdp\idn_to_ascii()

Be sure to enable the php extension called intl as the domain parsing extension requires it!

If certain domain extensions are always or very often returning an unexpected value, please create an issue instead of emailing me in broken english. In your issue provide me with the following:

  • Your webhost
  • Link to your website where the error is happening
  • The extension and domain you are trying to check availability for

Keep in mind that this library queries the WHOIS servers directly and if you "spam" them with requests, you will get temporary banned and that will cause the library to say the domain always is taken.

License

The MIT License (MIT). Please see License File for more information.

More Repositories

1

ollama-gui

A Web Interface for chatting with your local LLMs via the ollama API
Vue
474
star
2

extractor

Extractor: AI-Powered Data Extraction for your Laravel application.
HTML
135
star
3

receipt-scanner

๐Ÿงพโœจ AI-Powered Receipt and Invoice Scanner for Laravel, with support for images, documents and text
Rich Text Format
105
star
4

mindwave

[WIP] ๐Ÿง  Toolkit for building AI features into your Laravel app.
PHP
67
star
5

supersaw

Open Source Web Based DAW written in Svelte
Svelte
48
star
6

mistral

PHP Client for the Mistral.ai API
PHP
34
star
7

SpamProtection

A Spam Protection class for use in contact forms and comment fields, uses the StopForumSpam API.
PHP
24
star
8

brain

Simple productivity wrapper for the OpenAI API
PHP
24
star
9

blade-heroicons-upgrader

Package to upgrade all icons in your project using blade-heroicons from v1.0.6 to v2.1.1.
PHP
19
star
10

chromadb

PHP SDK for ChromaDB
PHP
16
star
11

milvus

A PHP Client for the Milvus Vector Database Rest API
PHP
10
star
12

slim-twig-i18n-example

i18n with Slim, Twig and Symfony Translate
PHP
9
star
13

brandfetch-sdk

Laravel SDK for Brandfetch
PHP
7
star
14

telefonkatalog

Query public Norwegian phone numbers to retrieve structured personal data.
PHP
7
star
15

mindwave-demo

๐Ÿ“Š Custom Chatbot application using Mindwave, with Document Upload and Tools
PHP
7
star
16

dart-toribash-bot

Toribash Bot Library in Dart
Dart
3
star
17

Brreg

Laravel Service for querying the Brreg API
PHP
3
star
18

SlimAppSkeleton

Slim Framework Skeleton Application w/Translation, Database, Sessions and Authentication
PHP
3
star
19

Marquee.js

Marquee-like scrolling text via Canvas
JavaScript
2
star
20

password-protect

Plugin for GetSimple CMS, allows users to password protect pages from the admin area.
PHP
2
star
21

gs-plugin-installer

A Plugin Installer for GetSimple CMS
PHP
2
star
22

ToriLobby

Toribash Server Explorer and Bot Manager
C#
2
star
23

HelgeCurl

Simple Wrapper around cURL
PHP
1
star
24

payloads

Rubber Ducky Payloads
1
star
25

WPPostCacher

A class for displaying and caching wordpress rss feeds on non-wordpress pages
PHP
1
star
26

midi-router

Utility webapp to map MIDI Input to an Output
JavaScript
1
star
27

laravel-podscan

Laravel Client for the Podscan.fm API
PHP
1
star
28

snov-io

PHP API Client for Snov.io
PHP
1
star
29

helgesverre

Profile
1
star