Jump to content

DomainWhois returns status = error for some tlds


Luxaaa

Recommended Posts

Hello,

i am trying to use the DomainWhois endpoint of the WHMCS internal API to check if a domain is available for registration. This is my code:

$res = localAPI('DomainWhois', array(
                'domain' => $domain
            ));

 

My problem now is, that this is returning 

{
      "result": "success",
      "status": "error",
      "whois": null
}

 

for some tlds, for example .lol, .xyz (i did not tested all). it does not matter if the checked domain is registered or not. The tld pricing and registrar module are configured for the tlds in WHMCS.

I am using the latest WHMCS 8.8.

 

Is this a known issue? Is there a solution or any other way to check domain availability in my own addon module?

 

best regards
Luca

Link to comment
Share on other sites

2 hours ago, radwebhosting said:

Be sure to check that your whois servers are up to date in /resources/domains/whois.json

Thanks for your answer. 
I checked the file (its named dist.whois.json btw). I also copied the file from the latest WHMCS bundle. It still does not work.

Link to comment
Share on other sites

Hi you should not modify the dist.whois.json file because this file will consistently be overwritten by system updates.

Create the whois.json file in the same folder to record additional whois servers/responses as well as overwriting any of the default values of the dist.whois.json file. This is where the whois servers and expected response values would originate.

Link to comment
Share on other sites

9 hours ago, radwebhosting said:

Hi you should not modify the dist.whois.json file because this file will consistently be overwritten by system updates.

Create the whois.json file in the same folder to record additional whois servers/responses as well as overwriting any of the default values of the dist.whois.json file. This is where the whois servers and expected response values would originate.

Hi,
yes i know. I only replaced the file with the one shipped with the latest WHMCS download bundle from the official website.

I found a workaround for this now by searching for the registrar module name in the database and calling the checkAvailability function of the module. It feels a little bit hacky but it works for me now.

anyway, thanks for your help.

Link to comment
Share on other sites

Great! There’s definitely multiple ways to accomplish and quite honestly, if you are requesting domain availability frequently, Whois technically isn’t the appropriate method. Some Whois servers may even impose rate limiting or outright blacklisting of the IP making the requests.

I think technically EPP is the most correct way to check domain availability, although WHMCS doesn’t offer native support for this protocol.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated