HelgeSverre / Domain-Availability

A PHP Class used to check if a domain has been registered
MIT License
266 stars 137 forks source link

Added a positive test for more certainty #53

Open stollr opened 5 years ago

stollr commented 5 years ago

As I have suggested in #51 I have created this PR which adds an additional test to be sure that a given domain was really found.

This check is only done if the TLD entry in the servers.json has an entry for the key found.

Here's an example:

  "io": {
    "server": "whois.nic.io",
    "not_found": "NOT FOUND",
    "found": "Registry Domain ID"
  },

if the response of the whois server does not contain "NOT FOUND" the domain is not directly considered as registered, but there is done a further check for the string "Registry Domain ID". If this string is found, the domain is considered as registered or not available.

I have also added the "found" key to several tld entries. But not for all. For those entries that do not have this property, the previous behaviour is kept.