namhost Posted August 27, 2019 Share Posted August 27, 2019 I added a custom server like so in /resouces/domains/whois.json [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "http://localhost/nawhois.php", "available": "No Object Found" }, and in my php I just did this: <?php file_put_contents("./LOG", json_encode($_REQUEST)); But it's not even hitten this code. Must you do some sort of cache clear after adding whois.json? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 27, 2019 Share Posted August 27, 2019 if that's the only entry in whois.json, you don't need the final comma and it's missing a close square bracket ] at the end. also, there is a working public whois server for .na { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "socket://whois.na-nic.com.na", "available": "No Object Found" }, 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 6 minutes ago, brian! said: if that's the only entry in whois.json, you don't need the final comma and it's missing a close square bracket ] at the end. also, there is a working public whois server for .na { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "socket://whois.na-nic.com.na", "available": "No Object Found" }, That was just me copying and pasting the top bit quickly. Here's the actual code: [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "socket://whois.na-nic.com.na", "available": "No Object Found" } ] But that still doesn't work. I would prefer to use my own api, so it would be great if this could work: [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "http://localhost/nawhois.php", "available": "No Object Found" } ] 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 yeah, try as I may, it's not hitting my custom uri that I have specified... :( 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 27, 2019 Share Posted August 27, 2019 Just now, namhost said: But that still doesn't work. testing locally, that works for me. 5 minutes ago, namhost said: yeah, try as I may, it's not hitting my custom uri that I have specified... 😞 can you give it a domain in the URL instead of using localhost ?? 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 It's honestly like whmcs isn't even aware of the whois.json file. Let me try a non-localhost url. 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 Nope. Not even if I put it on a server. It might work online, and not locally, but I want to make it work locally before putting it online. Any ideas on how to debug this? A way to check it's reading whois.json? Or perhaps to see what response it is getting from the whois? 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 Okay, now I'm stumped. I added this to the server: [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "https://MYDOMAIN/nawhois.php", "available": "No Object Found" } ] I added it to /resources/domains/whois.json Nothing. There's also dist.whois.json. Should I maybe delete that? Or rather use dist.whois.json? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 27, 2019 Share Posted August 27, 2019 2 minutes ago, namhost said: There's also dist.whois.json. Should I maybe delete that? Or rather use dist.whois.json? no dist.whois.json contains the lists of whois server used by default in whmcs.... whois,json is just an additional list to add new entries, or replace existing entries. how are you testing the entry - in the admin area or in the cart ? admin area would be better. if you go back to using the public whois server, search for a domain that doesn't exist (eg not registered), what's the output in the admin area ?? 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 27, 2019 Author Share Posted August 27, 2019 Okay, I got it. This works: [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "http://XXXX/nawhois.php?d=", "available": "No Object Found" } ] I needed the ?d= ... otherwise it would create a url like so: nawhois.phpDOMAINNAME.COM instead of: nawhois.php?d=DOMAINNAME.COM Sorted! :-) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 28, 2019 Share Posted August 28, 2019 19 hours ago, namhost said: I needed the ?d= aaahh I should have spotted that myself! 😞 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 29, 2019 Share Posted August 29, 2019 @namhost - is it possible for you to PM me a copy of that nawhois.php script... i'm trying to do something similar with another TLD and it works outside of WHMCS, but not from within it... so there's probably something minor that i'm overlooking. 🙄 0 Quote Link to comment Share on other sites More sharing options...
namhost Posted August 29, 2019 Author Share Posted August 29, 2019 I use CompleteAPI.com for the whois query. So my original plan was to have a script that calls completeapi. But I was able to set it up so that it is called directly like so: [ { "extensions": ".com.na,.alt.na,.co.na,.net.na,.edu.na,.org.na,.na", "uri": "https://www.completeapi.com/v1/[MY_API_KEY]/whois/", "available": "No Object Found" } ] I'm sure something similar can be achieved with other whois apis. The trick for me was going to the admin area and using the whois there. That showed me the output and I was able to debug it. And that is how I found out I needed the query string part. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 29, 2019 Share Posted August 29, 2019 2 minutes ago, namhost said: I'm sure something similar can be achieved with other whois apis. thanks for replying.... in my case, it's not so much a whois server search, it's getting a script called by whois.json to reply with the result... i've done it plenty of times successfully, but with this one script, it just won't reply correctly... oh well, i'll keep banging away at it. 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.