Port 43 Whois Via Proxy Connection – Php

Hello,

I am looking to hire someone for a project. The server is LAMP based running the latest PHP and MySQL.

This project requires a programmer with good networking skills.

What I am trying to do is tunnel URL’s from the server utilizing various private proxies. The proxies are basically a big pool of IP’s that must be rotated, make the connection and retrieve the data.

The problem is that my current programmer is using PHP Curl. It seems this cannot be completed with CURL. He recommended fsock()open, but he doesn’t know how to write the code to get the job done.

The purpose of this code is to connect to a whois server via port 43 and retrieve whois data for domain names.

Here is a snippet of the code we were using with CURL:

curl_setopt($cUrl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);

$use_proxy=$_GET[“proxy”];
$domain=”domain google.com”;
$whois_server = “whois.internic.net”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $whois_server.”:43″); // Whois Server
if($use_proxy)
curl_setopt($ch, CURLOPT_PROXY, ‘xxx.xx.xxx.xxx:1239’); //Proxy IP
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $domain.”\r\n”); // Query
$whois = curl_exec ($ch);
curl_close($ch);
echo nl2br($whois);

The above code will not retrieve the whois info. It either grabs a blank page or asks you to visit the sponsor registrar’s whois server.

I hope the above can be converted to fsockopen.

Leave a Reply

Your email address will not be published. Required fields are marked *