Skip to content

Instantly share code, notes, and snippets.

@galehrizky
Created June 16, 2020 17:06
Show Gist options
  • Save galehrizky/3e36ee863fce2b8a1297ab2590d1ba66 to your computer and use it in GitHub Desktop.
Save galehrizky/3e36ee863fce2b8a1297ab2590d1ba66 to your computer and use it in GitHub Desktop.
Domain Generator
<?php
// Generate list Domain Names
error_reporting(0);
function save($sites, $filename)
{
$file = fopen($filename,"a");
fwrite($file, "\n". $sites);
fclose($file);
}
for ($i=0; $i < 100000; $i++) {
$url = file_get_contents("https://api.namefake.com/");
$json_decode = json_decode($url, TRUE);
if ( gethostbyname($json_decode['domain']) != $json_decode['domain'] ) {
save($json_decode['domain'], 'list-domain.txt');
echo "Valid domain {$json_decode['domain']}".PHP_EOL;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment