Luxaaa Posted February 11 Share Posted February 11 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 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted February 13 Share Posted February 13 Be sure to check that your whois servers are up to date in /resources/domains/whois.json 0 Quote Link to comment Share on other sites More sharing options...
Luxaaa Posted February 13 Author Share Posted February 13 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. 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted February 14 Share Posted February 14 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. 0 Quote Link to comment Share on other sites More sharing options...
Luxaaa Posted February 14 Author Share Posted February 14 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. 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted February 15 Share Posted February 15 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.