Forum Moderators: coopster

Message Too Old, No Replies

PHP and Whois

         

anshul

8:49 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Can PHP get information from some whois source?

I tried simply, copying all from '#*$!'; but that Web site is limiting 5-10 queries.

What exactly is 'whois information' and how to get it using PHP?

Thanks to all, who will reply.

Twisted Mind

9:07 am on Oct 27, 2005 (gmt 0)

10+ Year Member



you cant just copy it from a site it counts sessions mostly in databases and then prints it somewhere in the site you can find scripts everywhere i guess

anshul

9:32 am on Oct 27, 2005 (gmt 0)

10+ Year Member



No. They don't allow to query and use their information. How can we query 'Whois information' (from some 'Whois server! What is it?) using PHP..

Romeo

10:42 am on Oct 27, 2005 (gmt 0)

10+ Year Member



I tried simply, copying all from '#*$!'; but that Web site is limiting 5-10 queries.

... and they know why the have that limit.

Instead of scraping web services you could ask the whois services (whois servers) directly.
This can be done by opening a network connection on port 43 to the appropriate whois server (using fsockopen() in PHP).

Of course, you first have to know and locate the appropriate whois server (there are many, each TLD has its on whois service ( [iana.org...] and in case of a .COM address you have to make 2 queries, one to a central server (crsnic.net/verisign, if I recall correctly), who knows which registry service holds the data for a specific domain and then another additional query to that registrar's whois service to get more specific data.).

To prevent abuse by automatic bots, some whois servers have implemented access restrictions on their services on port 43, too.

Good luck and regards,
R.

anshul

11:26 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Actually, I wanted to know 'age of Web site' (any Web site). Is there any alternative easier approach?

Network connection on port 43: It's frightening as I know nothing of sockets..

Romeo

11:45 am on Oct 27, 2005 (gmt 0)

10+ Year Member



well, I am not aware of any other source for the age of a domain registration than the whois data.

You don't need to know much about sockets. If you read the documentation at
[php.net...]
you may perhaps start with one of the examples presented there.

Regards,
R.

vincevincevince

11:46 am on Oct 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have *nix, try installing jwhois, calling it via exec() and then parsing the results.

anshul

8:17 am on Oct 28, 2005 (gmt 0)

10+ Year Member



Thank you all. PHP Whois is already in SourceForge. My problem is solved very easily. And it is fast.

anshul

11:18 am on Oct 28, 2005 (gmt 0)

10+ Year Member



I got that tool ready (thanks to SourceForge!).
However, it's slow. I'm reading file using file_get_contents().

Can some one tell, what's a faster method to read file. Also, I need read only few lines, not the total Web page.