我需要测试whois服务,以使用PHP测试域名和具有身份验证的代理连接。它对于.com的whois.verisign-grs.com或.fr的whois.nic.fr都非常有效,但是对于.org,我得到以下结果,并且我不知道它正在等待什么命令对于? 我找不到文档来推荐我。
谢谢!
结果:string(57)“未找到对象或解释控制关键字
$server='whois.pir.org';
$domain='archive.org';
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$server);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_PROXYPORT, $port);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYTYPE, 'CURLPROXY_SOCKS5');
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $userpass);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "$domain \r\n");
//curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "-T dn $domain\r\n");
$result = curl_exec($ch);
var_dump($result);
curl_close($ch);