0

I have this PHP script to fetch whois information of domain. It works, but when I try to connect whois server via proxy, then it doesnt work. What I do wrong? Thank you for help.

$server = "whois.nic.cz";
$domain = "ucedan.cz";

function QueryWhoisServer($server, $domain){
    $proxy = "85.111.25.189:8080";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $server);
    curl_setopt($ch, CURLOPT_PORT, 43);
    curl_setopt($ch, CURLOPT_PROXY, $proxy);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $domain . "\r\n");
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;  
}
  • What kind of proxy are you using? Are you sure you don't need any form of authentication? – Jerodev Oct 17 '14 at 11:13
  • Its random proxy from http://proxylist.hidemyass.com/ .. I tried several proxies from this website.. same result – Petr Janulík Oct 17 '14 at 11:30
  • Why are you using an HTTP library to access a TCP protocol? You should instead use the specific whois library in your programming language or at the bottom of it just open a TCP socket towards port 43. There is no concept of proxies in the whois protocol, you will not be able to try hiding yourself like that :-) – Patrick Mevzek Jan 02 '18 at 20:38

0 Answers0