ℹ️ I realise this library is fairly generic and light, so feel free to close if you'd rather not add specific edge case handling.
The Problem
Whois results show incorrectly for *.jp domains with the current library release:
Querying whois('google.jp')
{
"domainInformation": "[Domain Name] GOOGLE.JP",
"contactInformation": "[Name] Google LLC"
}
Why
Because the Japan Registry Services whois results are not using the popular colon-delimited whois data format.
It uses square brackets for fields.
[ JPRS database provides information on network administration. Its use is ]
[ restricted to network administration purposes. For further information, ]
[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]
[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]
Domain Information:
[Domain Name] GOOGLE.JP
[Registrant] Google LLC
[Name Server] ns1.google.com
[Name Server] ns2.google.com
[Name Server] ns3.google.com
[Name Server] ns4.google.com
...
Solution
I've opted for handling this case specifically based on whether the header used by the JPRS database is present.
We then:
Normalise all square bracketed keys to use colon delimiter [Domain Name] -> Domain Name:
Remove empty keys
Then the normal parsing of the data resumes.
An alternative could be to try a more generic normalisation of all results.
Thanks for the library! Happy to adjust this PR based on your feedback 😄
ℹ️ I realise this library is fairly generic and light, so feel free to close if you'd rather not add specific edge case handling.
The Problem
Whois results show incorrectly for
*.jp
domains with the current library release:Querying
whois('google.jp')
Why
Because the Japan Registry Services whois results are not using the popular colon-delimited whois data format.
It uses square brackets for fields.
Solution
I've opted for handling this case specifically based on whether the header used by the JPRS database is present.
We then:
[Domain Name] -> Domain Name:
Then the normal parsing of the data resumes.
An alternative could be to try a more generic normalisation of all results.
Thanks for the library! Happy to adjust this PR based on your feedback 😄