Buy Sell Discuss UK Domain Names at AcornDomains.co.uk Price Freeze on Business Hosting frm £4.95/month

Today's Drop Dates are: 18-02-2012 or 25-02-2012   All times are GMT. The time now is 11:36:52 PM.
Domain Name Sales Domain Software Calculate UK Domain Drop Dates Domain Registration NameDrive Domain Parking Subscribe to our Domains For Sale newsletter
Go Back   Domain Forum Acorn Domains Buy Sell Auction UK Domains > Domain Name Tools and Resources > Domain Tools
Connect with Facebook

Domain Tools Discuss and evaluate domainer tools and resources

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-04-2008, 09:41:50 PM     #1 (permalink)

 
Join Date: Sep 2006
Posts: 406
purg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond repute

whois2 php script

Im hoping someone can help

Ive written a script that should work but doesnt. Taking a whois lookup on port 43 and changed to 1043 and included host & IP. Using port 43 works fine so cant see what ive missed.

Code:
<?php
$fp = fsockopen('whois.nic.uk', 1043, $errno, $errstr);
if (!$fp) {
   echo "ERROR: $errno - $errstr<br />\n";
} else {
   fwrite($fp, "myhome.hostname myhome.ip.address yahoo.co.uk\r\n");
   while (!feof($fp)) {
      echo str_replace("\n", '<br />', fread($fp, 100));
   }
   fclose($fp);
}
?>
Ive got the email which accept I now have access to WHOIS2 from the IP address 65.99.[remove].233.85. The domain is on a VPS so have given the domain its own IP address but the script still times out.

Code:
Warning: fsockopen() [function.fsockopen]: unable to connect to whois.nic.uk:1043 in /home/daily/public_html/who.php on line 3
ERROR: 110 - Connection timed out
Please help.

Last edited by purg; 04-04-2008 at 09:59:44 PM.
purg is offline  
Old 04-04-2008, 10:02:46 PM     #2 (permalink)

 
tifosi's Avatar
 
Join Date: Oct 2004
Location: Lancashire
Posts: 1,907
tifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond reputetifosi has a reputation beyond repute

Is the IP you're trying to connect to whois2 from allowed?

"The service will be available on a subscription only basis. At the point of subscription you will need to provide Nominet with the IP address of your gateway."

S
tifosi is offline  
Old 04-04-2008, 11:00:09 PM     #3 (permalink)

 
aquanuke's Avatar
 
Join Date: May 2005
Location: Surrey
Posts: 1,993
aquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond repute

Looks ok, I just use something like this with np

PHP Code:
$whois 'whois.nic.uk';
$hostname gethostbyaddr($_SERVER['REMOTE_ADDR']);
$ip $_SERVER["REMOTE_ADDR"];
$domain 'internet.co.uk';

$fs fsockopen("$whois"1043$errno$errstr60);
if (!
$fs) {
   
fclose($fs);
} else {

        
fputs($fs"$hostname $ip $domain\r\n");
        
$contents stream_get_contents($fs);
        
fclose($fs); 
aquanuke is offline  
Old 04-04-2008, 11:05:52 PM     #4 (permalink)

 
aquanuke's Avatar
 
Join Date: May 2005
Location: Surrey
Posts: 1,993
aquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond repute

Quote:
Originally Posted by purg View Post
Ive got the email which accept I now have access to WHOIS2 from the IP address 65.99.[remove].233.85. The domain is on a VPS so have given the domain its own IP address but the script still times out.
Maybe make sure your connecting from the domains IP not the servers main IP. Most likely connections would come from the servers IP unless you use bind to bind a specific IP to your script. You should be able to see what outgoing connections are running using netstat.
aquanuke is offline  
Old 05-04-2008, 11:59:07 AM     #5 (permalink)

 
Join Date: Sep 2006
Posts: 406
purg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond repute

tifosi... yes ive been accepted and the IP being shown from the domain/script is the IP whois2 has granted access. I put this towards the bottom of my first post.

aquanuke...
Thanks i'll give that a try. From shell im getting the correct address also phpinfo shows the correct IP
SERVER_ADDR 65.99.233.85
SERVER_NAME dailydomain.co.uk

The message from both our scripts seems to suggest im not even getting to nic.uk? let alone not being granted access or not.

Warning: fsockopen() [function.fsockopen]: unable to connect to whois.nic.uk:1043 in /home/daily/public_html/who2.php on line 7

Last edited by purg; 05-04-2008 at 12:01:23 PM.
purg is offline  
Old 05-04-2008, 01:27:12 PM     #6 (permalink)

 
grantw's Avatar
 
Join Date: Mar 2005
Posts: 3,624
grantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond reputegrantw has a reputation beyond repute

Can you telnet to whois2 from the server? If so it will either let you in or close the connection if its an ip registration problem. Either way it will prove whether your script/server is at fault or not.

Grant
grantw is offline  
Old 05-04-2008, 03:32:42 PM     #7 (permalink)

 
aquanuke's Avatar
 
Join Date: May 2005
Location: Surrey
Posts: 1,993
aquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond reputeaquanuke has a reputation beyond repute

Probs easier just to bind the IP through the script, try this through a web browser.

PHP Code:

<?
$sourceip 
'xx.xxx.xx.xx'// ip you want to bind to
$whois 'whois.nic.uk';
$hostname gethostbyaddr($_SERVER['REMOTE_ADDR']);
$ip $_SERVER["REMOTE_ADDR"];
$domain 'internet.co.uk';

$sock socket_create(AF_INETSOCK_STREAMSOL_TCP);
socket_bind($sock$sourceip);
socket_connect($sock"$whois"1043);

socket_write ($sock"$hostname $ip $domain\r\n");
$line socket_read($sock1024);

echo 
$line;
?>
aquanuke is offline  
Old 06-04-2008, 11:15:15 AM     #8 (permalink)

 
Join Date: Sep 2006
Posts: 406
purg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond reputepurg has a reputation beyond repute

Thanks guys but still nothing.... this is getting annoying so will try phoning Nominet Monday for ideas. Im starting to think they sent the email telling me I have access without really granting access to the IP.

Ive posted a site im working on (dailydomain.co.uk), but until this is working the public wont be able to update or lookup whois info which is a shame.
purg is offline  
Closed Thread



Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Domain Name Community Replies Last Post
PHP script and adsense ID's golddiggerguy Scripts and Coding 3 02-03-2008 10:35:27 PM
PHP script wanted for memories website golddiggerguy Website Design 9 29-12-2007 04:45:19 PM
PHP script pendragon Services Wanted 5 11-11-2007 12:42:45 PM

Web Hosting from UK2 from just 99p


All times are GMT. The time now is 11:36:52 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 RC 2
All content on Acorn Domains is member generated and is not moderated before posting. All content is viewed and used by you at your own risk and AD does not warrant the accuracy or reliability of any of the information. The views expressed are those of the individual contributors and not necessarily those of AD. Please contact us to report any issues or send a PM to "Admin".