Jump to content

Adding a custom whois server?


namhost

Recommended Posts

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? 

Link to comment
Share on other sites

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"
    },	
Link to comment
Share on other sites

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"
    }
]

 

Link to comment
Share on other sites

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 ??

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 ??

Link to comment
Share on other sites

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! :-)

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

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