regru / php-whois Goto Github PK
View Code? Open in Web Editor NEWPHP class to retrieve WHOIS information.
PHP class to retrieve WHOIS information.
searching for a .biz-Domain always shows this domain unavailable.
It seems that the whois.servers.json has to have "No Data Found" as Failstring.
Hello. I just started using this class and it's pretty useful. However, I have noticed that it returns empty Registrant, Admin & Tech data. From what I gather, the solution is to make a second request to the registrar's WHOIS server in order to obtain it. For .com domains, this process would roughly look something like this:
Query whois.crsnic.net, find the "Registrar WHOIS Server" line in the received response and get the address of the said server (let's say it's whois.namecheap.com)
Query whois.namecheap.com
Parse & merge the data returned from the two servers as necessary and return it
Example:
thisdomain.doesnotexistatall
$domain->isAvailable() returns TRUE
must be add second-level domain (ccSLD) for Iran country, below list:
co.ir
ac.ir
sch.ir
id.ir
gov.ir
org.ir
net.ir
I tried with any .de website and I don't get any data. I tried on other websites and they seem to work when I query a .de website.
i clone it here:
/home/mrg/www/Test/php-whois
then run:
http://localhost/Test/php-whois/examples/usage-example.php
And get this error:
Fatal error: Class 'Phois\Whois\Whois' not found in /home/mrg/www/Test/php-whois/examples/usage-example.php on line 8
My os is linux mint 17.3 64bit
PHP Version 5.5.9-1ubuntu4.14
Aapache 2.4
When the domain have On-hold (generic)
status, then isAvailable()
method returns TRUE !
It would be nice to enter the version according to the Semantic Versioning.
That depending specify a version number instead dev-master.
In whois servers "mil" tld contains "whois.internic.net".
According to response from "whois.internic.net": The Registry database contains ONLY .COM, .NET, .EDU domains and Registrars.
Wrongly resolved as available domain as example: "usmc.mil".
Can you please add .swiss to your json?
whois.nic.swiss
Due to regexp here https://github.com/regru/php-whois/blob/master/src/Phois/Whois/Whois.php#L23
example.com
-> passedm.example3000.com
-> invalid $domain syntax
Here is online demonstration https://3v4l.org/KdAMn
Why there are no numbers allowed in 2nd level domain?
Не проверят на регистрацию в рф и прочих не латинистических доменах.
президент.рф
xn--d1abbgf6aiiy.xn--p1ai
Fatal error on line 27:
throw new \InvalidArgumentException("Invalid $domain syntax");
your class enters into infinite loop when fsockopen returns a error.
if you use "$whois_string = $this->info();" inside the isAvailable() function you are querying the whois server two times.
(example on the first page)
$whois_answer = $domain->info(); //FIRST QUERY
...
if ($domain->isAvailable()) { //SECOND QUERY
Some whois servers have limits of 1 host from one ip each second (for instance).
So you should only ask only one time.
You can for instance save the domain info in a class variable and use it, if already exists
.ir tld is defined in this script but i can not whois 'kashanu.ac.ir'!
please check it
If you want a quick way to format the return results
echo nl2br($whois_answer);
will convert line breaks to html breaks. Makes it easier to read :)
The json has .co.uk domains but misses .uk domains
More info: http://www.nominet.org.uk/uk-domain-names/about-domain-names/domain-lookup-whois/whois-tool
Hi,
Not work - HTTP 404.
thanks for your class but why dont you add .ir??
please add it.
whois server : whois.nic.ir
Hi,
I think the main API request function should be updated to use guzzle instead of directly going for curl!
Advantages:
It's much more modern and easier to debug
Code would be cleaner
We can use guzzle async features to make asynchronous requests:
This is important because most people use this library for checking domain availability and if you target multiple TLD's many serial requests would have to be made and the script would get really slow.
Thanks
When I use your script to search for Google.com or any popular domain, it's just listing a bunch of domains that contain that domain in it. It also has the following message:
To single out one record, look it up with "xxx", where xxx is one of the
records displayed above. If the records are the same, look them up
What needs to be done for it to actually get the whois results for any domain that's entered?
Its not returning data in JSON format.
How can I get JSON formatted data?
If not then has there any other good php class like it what returns data in JSON format.
THanks
Hi,
public function isValid()
{
if (
isset($this->servers[$this->TLDs][0])
&& strlen($this->servers[$this->TLDs][0]) > 6
) {
$tmp_domain = strtolower($this->subDomain);
if (
preg_match("/^[a-z0-9\-]{1,}$/", $tmp_domain)
&& !preg_match("/^-|-$/", $tmp_domain) //&& !preg_match("/--/", $tmp_domain)
) {
return true;
}
}
return false;
}
like jd dot com, kk dot com p dot ki.
Thank you.
Add .cr domain check ?
This Whois host has a ReCaptcha validation:
"es": [
"http:\/\/whois.virtualname.es\/whois.php?domain=",
"LIBRE"
],
how can i get specific data from returning value? for example i want to get only creation date. Is it possible to do this?
Hello,
Can you please tell me that how can I make use of this code? I mean I am completely noob, but I wanna get whois info of many domains at once.
So I found this.
What do I have to do now to get this working.
Sorry.
Thanks
Hi
I see that there are a handful of projects which do maintain their own individual whois server list. How about combining those lists into one single place and just maintain that together?
I created https://github.com/whois-server-list/whois-server-list where you can find a XML list containing domains (TLDs and SLD) with its whois servers from IANA, PSL and several whois client projects. The schema is not fix and could be changed within a new major version.
Also I'd like to use this opportunity to ask you if I may incorporate your list. I use the WTFL license.
whois.jprs.jp
Скрипт не обрабатывает кириллические домены с числами в начале домена. Например: 0404.xn--p1ai, 1500.xn--p1ai, 208777.xn--p1ai.
[18-Sep-2018 12:10:24 UTC] PHP Fatal error: Uncaught InvalidArgumentException: Invalid 0404.xn--p1ai syntax in /home/путь/Phois/Whois/Whois.php:29
Stack trace:
#0 /home/путь_к_скрипту.php(54): Phois\Whois\Whois->__construct('0404.xn--p1ai')
#1 {main}
thrown in /home/путь/Phois/Whois/Whois.php on line 29
PHP Warning: fsockopen(): unable to connect to whois.registrypro.pro:43 (Connection timed out) in /Phois/Whois/Whois.php on line 51
'bestchiflatironsale.com' - incorrectly determind as AVAILABLE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.