I have an issue. I am trying to check if a given string is a valid "registered" or "registerable" domainname.
Ideally I want to see if the given string can have a valid "registrar" or not. I am already checking the string format using regex and returns true for:
- something.com
- something.com.au
- domains.google
- something.something.com
I want to be able to differentiate between "registerable" or "registered" domain from non-registerable or non-registered domain. And I want to do it without checking whois.
My application needs to accept both domains names and subdomain names. So my regex is just fine for that purpose. But I need to flag in my db if the entered value is subdomain or a domain for which I can find whois.
The whole point is to avoid hitting whois servers to retrieve information if the provided string is not a "registered" or "registerable" domain.
I did a lot of research and played around https://publicsuffix.org/list/public_suffix_list.dat but that isn't the solution. This is because for example "wixsite.com" is a valid public sufix, but it "something.wixsite.com" cannot have a whois.