Skip to content

This package contains a class that can fetch DNS records and whois info

Notifications You must be signed in to change notification settings

nzldev/domain-whois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

domain-whois

This package contains a class that can fetch DNS records and whois info.

composer require nzldev/domain-whois

Example of usage

<?php

$sld = 'google.com';

$domain = new NzlDev\Whois\Whois($sld);

$whois_answer = $domain->info();

echo $whois_answer;

if ($domain->isAvailable()) {
    echo "Domain is available\n";
} else {
    echo "Domain is registered\n";
}

A more complete example:

<?php
require_once __DIR__.'/vendor/autoload.php';

$sld = 'facebook.com';

try {
  $domain = new NzlDev\Whois\Whois($sld);
} catch (InvalidArgumentException $e) {
  die($e->getMessage()."\n");
}

if ($domain->isAvailable()) {
  echo "Domain is available\n";
} else {
  echo "Domain is registered\n";
}

About

This package contains a class that can fetch DNS records and whois info

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages