在PHP中检查域名的可用性

在PHP中检查域名的可用性,php,dns,Php,Dns,我编写了自己的脚本,用于从文本文件中包含的单词列表中检查域名的可用性(在PHP中),但我得到了很高的假结果分数 我使用checkdnsrr()函数检查是否有DNS记录 有没有更有效的方法来检查域名的可用性 多谢各位 <?php $file = fopen("list-words.txt", "r"); if ( $file) { while ( ( $line = fgets( $file) ) !== false ) { $words[] .

我编写了自己的脚本,用于从文本文件中包含的单词列表中检查域名的可用性(在PHP中),但我得到了很高的假结果分数

我使用checkdnsrr()函数检查是否有DNS记录

有没有更有效的方法来检查域名的可用性

多谢各位

<?php
$file = fopen("list-words.txt", "r"); 

if ( $file)
{
     while ( ( $line = fgets( $file) ) !== false )
     { 
          $words[] .= cleanWord( trim( $line ) );
     }
     fclose( $file);
}

$nb = 5;
$ltd = '.com';
$list = '<ul>';
for( $i = 0; $i < count( $words); $i++ )
{ 
     if( strlen( $words[$i] ) == $nb_nb )
     { 
          if( !checkdnsrr( $words[$i].$ltd, 'ANY' ) )
          { 
              $list.= '<li>'.$words[$i].$ltd.'</li>';
          }
     }
}
$list.= '</ul>';
echo $list;
?>

我想避免使用WHOIS api。。