Mobile app version of vmapp.org
Login or Join
Hamaas447

: Fsockopen() error : Network is unreachable port 43 in php i've writed some Php code that lookup for domain (whois) but it fails !! this is some of my code : function checkdomain($server,$domain){

@Hamaas447

Posted in: #Php

i've writed some Php code that lookup for domain (whois) but it fails !!

this is some of my code :


function checkdomain($server,$domain){
global $response;
$connection = fsockopen($server,43);
fputs($connection, "domain " . $domain . "rn");
while(!feof($connection)){
$response .= fgets($connection, 4096);
}
fclose($connection);
}
checkdomain("whois.crsnic.net","www.example.com");


the code work on my localhost ( apache,php,mysql, OS -> Win XP ) but when i uploaded it to my host (Linux) it failed. and i always see the Below Error/message :

Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43 (Network is unreachable) in /home/hamid0011/public_html/whois/whois.php on line 37

what should i do ? is this my host's problem or whois server ( but it work in localhost ) or my code ?

TNX

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gretchen104

Your host probably has a firewall which blocks port 43. I would contact them to check if this is the case.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme