domain search through Linux command and PHP

tutorial for PHP, domain search through Linux command and PHP. Searching the domain information through command line. You can search the domain using the Linux command.

domain search through Linux command and PHP

#whois google.com

using the following command you can find the all domain information.

If you want check when domain created then use following command.

#whois google.com | grep “Created | Creation”

If you want to create PHP script for domain search then use following code


$domain_info = exec("whois google.com | grep 'Created |Creation'");

if($domain_info =''){

echo "Domain is not yet registered";

} else {

echo $domain_info = exec("whois google.com");

}

Above script will only work in Linux server.