mboot-github / python-whois

Python module/library for retrieving domain WHOIS information (only domain)
https://pypi.org/project/whois/
MIT License
289 stars 136 forks source link

Support for additional missing TLDs (.gt, .my, .za, .ch) #288

Closed RickTorresJr closed 1 year ago

RickTorresJr commented 1 year ago

Describe the bug

Please add support for .gt, .my, .za and .ch TLDs.

To Reproduce

Steps to reproduce the behavior:

import whois
domain = whois.query('edu.gt')
print(domain.__dict__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/whois/__init__.py", line 250, in query
    tld, dl = fromDomainStringToTld(domain, internationalized, verbose)
  File "/usr/local/lib/python3.10/site-packages/whois/__init__.py", line 109, in fromDomainStringToTld
    tld: str = filterTldToSupportedPattern(domain, d, verbose)
  File "/usr/local/lib/python3.10/site-packages/whois/_0_init_tld.py", line 50, in filterTldToSupportedPattern
    raise UnknownTld(msg)
whois.exceptions.UnknownTld: The TLD gt is currently not supported by this package. Use validTlds() to see what toplevel domains are supported.

Expected behavior

Return the expected dictionary.

Desktop (please complete the following information):

maarten-boot commented 1 year ago

note that this library depends on the output of the cli whois tool, if that tool gives no output there is no alternative for us but to give up, if you have working examples using the cli whois command we can use, that would be very helpful

.gt

as you can see from https://www.iana.org/domains/root/db/gt.html the gt domain has no whois servers that the cli whois program can use currently we can only add this tld as privateRef (as it returns no useful information)

whois meta.gt [Querying http://www.gt/cgi-bin/whois.cgi] 404 Not Found


                            nginx/1.20.1

.my

whois.mynic.my never anwers any request i tested with hence it is presnt in the tld list as privateReg meaning it never anweres with anything useful

.za

we currently have za as:

ZZ["za"] = { "extend": "com", }

ZZ["web.za"] = {"extend": "za", "_server": "web-whois.registry.net.za"} ZZ["org.za"] = {"extend": "za", "_server": "org-whois.registry.net.za"} ZZ["net.za"] = {"extend": "za", "_server": "net-whois.registry.net.za"} ZZ["co.za"] = {"extend": "za", "_server": "coza-whois.registry.net.za"}

.ch

and ch as

ZZ["ch"] = {"extend": "_privateReg"}

as it never answeres with anything useful

whois -h whois.nic.ch nic.ch [Querying whois.nic.ch] [whois.nic.ch] Requests of this client are not permitted. Please use https://www.nic.ch/whois/ for queries.

whois -h whois.nic.ch meta.ch [Querying whois.nic.ch] [whois.nic.ch] Requests of this client are not permitted. Please use https://www.nic.ch/whois/ for queries.

maarten-boot commented 1 year ago

gt has been added as privateRegistry

RickTorresJr commented 1 year ago

My mistake. Thank you for clarifying. You are indeed correct. It seems like the macOS version of whois has much less support for non-traditional TLDs versus Debian's whois (5.5.15) which is what caused the majority of the problems.

macOS

$ whois cleversafe.co.za

% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer:

domain:       ZA

organisation: ZA Domain Name Authority
address:      44 Grand Central Blvd
address:      Sanofi House
address:      Halfway house
address:      Midrand Gauteng 1685
address:      South Africa

contact:      administrative
name:         Chairperson
organisation: ZA Domain Name Authority
address:      44 Grand Central Blvd
address:      Sanofi House
address:      Halfway house
address:      Midrand Gauteng 1685
address:      South Africa
phone:        +27 (0)10 020 3910
fax-no:       +27 (0)10 020 3919
e-mail:       chair@zadna.org.za

contact:      technical
name:         Technical Committee
organisation: ZA Domain Name Authority
address:      44 Grand Central Blvd
address:      Sanofi House
address:      Halfway house
address:      Midrand Gauteng 1685
address:      South Africa
phone:        +27 (0)10 020 3910
fax-no:       +27 (0)10 020 3919
e-mail:       dnsadmin@zadna.org.za

nserver:      NSZA.IS.CO.ZA 196.4.160.27
nserver:      ZA-NS.ANYCAST.PCH.NET 2001:500:14:6055:ad:0:0:1 204.61.216.55
nserver:      ZA1.DNSNODE.NET 194.146.106.78 2001:67c:1010:19:0:0:0:53
ds-rdata:     45749 8 2 3e2b0b7e6063ca11400fa4b54d8a530888234cd0eb3b5fbf820c0750784da84e

whois:

status:       ACTIVE
remarks:      Registration information: http://www.zadna.org.za/

created:      1990-11-07
changed:      2020-01-15
source:       IANA

Debian

$whois cleversafe.co.za

whois cleversafe.co.za
Domain Name: cleversafe.co.za
Registry Domain ID: dom_1X740--1
Registrar WHOIS Server:
Registrar URL: https://www.cscglobal.com/cscglobal/home/
Updated Date: 2022-06-11T07:12:21Z
Creation Date: 2009-06-15T12:33:52Z
Registry Expiry Date: 2023-06-15T12:33:52Z
Registrar Registration Expiration Date: 2023-06-15T12:33:52Z
Registrar: CSC Corporate Domains Inc
Registrar IANA ID: 299
Registrar Abuse Contact Email: tldsupport@cscglobal.com
Registrar Abuse Contact Phone: +44.077510055
Reseller:
Domain Status: ok https://icann.org/epp#ok
Registry Registrant ID: REDACTED
Registrant Name: REDACTED
Registrant Organization:
Registrant Street: REDACTED
Registrant City: REDACTED
Registrant State/Province: REDACTED
Registrant Postal Code: REDACTED
Registrant Country: US
Registrant Phone: REDACTED
Registrant Phone Ext: REDACTED
Registrant Fax: REDACTED
Registrant Fax Ext: REDACTED
Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name.
Registry Admin ID: REDACTED
Admin Name: REDACTED
Admin Organization: REDACTED
Admin Street: REDACTED
Admin City: REDACTED
Admin State/Province: REDACTED
Admin Postal Code: REDACTED
Admin Country: REDACTED
Admin Phone: REDACTED
Admin Phone Ext: REDACTED
Admin Fax: REDACTED
Admin Fax Ext: REDACTED
Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name.
Registry Tech ID: REDACTED
Tech Name: REDACTED
Tech Organization: REDACTED
Tech Street: REDACTED
Tech City: REDACTED
Tech State/Province: REDACTED
Tech Postal Code: REDACTED
Tech Country: REDACTED
Tech Phone: REDACTED
Tech Phone Ext: REDACTED
Tech Fax: REDACTED
Tech Fax Ext: REDACTED
Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name.
Registry Billing ID: REDACTED
Billing Name: REDACTED
Billing Organization: REDACTED
Billing Street: REDACTED
Billing City: REDACTED
Billing State/Province: REDACTED
Billing Postal Code: REDACTED
Billing Country: REDACTED
Billing Phone: REDACTED
Billing Phone Ext: REDACTED
Billing Fax: REDACTED
Billing Fax Ext: REDACTED
Billing Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name.
Name Server: ns1.cleversafe.com
Name Server: ns3.cleversafe.com
DNSSEC: unsigned
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of WHOIS database: 2023-03-08T15:51:51Z <<<

For more information on Whois status codes, please visit https://icann.org/epp

# --

# For more information on Whois status codes, please visit https://icann.org/epp

# ZARC Complaint/s Procedure and Form: https://registry.net.za/content.php?gen=1&contentid=226
# The use of this Whois facility is subject to the following terms and
# conditions. https://registry.net.za/whois_terms
# Copyright (c) ZARC 2023
maarten-boot commented 1 year ago

Yes the mac version is notoriously different unfortunarely.

On Wed, Mar 8, 2023, 17:07 Rick Torres Jr. @.***> wrote:

My mistake. Thank you for clarifying. You are indeed correct. It seems like the macOS (GNU) version of whois has much less support for non-traditional TLDs versus Debian's whois (5.5.15) which is what caused the majority of the problems. macOS (GNU)

$ whois cleversafe.co.za

% IANA WHOIS server % for more information on IANA, visit http://www.iana.org % This query returned 1 object

refer:

domain: ZA

organisation: ZA Domain Name Authority address: 44 Grand Central Blvd address: Sanofi House address: Halfway house address: Midrand Gauteng 1685 address: South Africa

contact: administrative name: Chairperson organisation: ZA Domain Name Authority address: 44 Grand Central Blvd address: Sanofi House address: Halfway house address: Midrand Gauteng 1685 address: South Africa phone: +27 (0)10 020 3910 fax-no: +27 (0)10 020 3919 e-mail: @.***

contact: technical name: Technical Committee organisation: ZA Domain Name Authority address: 44 Grand Central Blvd address: Sanofi House address: Halfway house address: Midrand Gauteng 1685 address: South Africa phone: +27 (0)10 020 3910 fax-no: +27 (0)10 020 3919 e-mail: @.***

nserver: NSZA.IS.CO.ZA 196.4.160.27 nserver: ZA-NS.ANYCAST.PCH.NET 2001:500:14:6055:ad:0:0:1 204.61.216.55 nserver: ZA1.DNSNODE.NET 194.146.106.78 2001:67c:1010:19:0:0:0:53 ds-rdata: 45749 8 2 3e2b0b7e6063ca11400fa4b54d8a530888234cd0eb3b5fbf820c0750784da84e

whois:

status: ACTIVE remarks: Registration information: http://www.zadna.org.za/

created: 1990-11-07 changed: 2020-01-15 source: IANA

Debian

$whois cleversafe.co.za

whois cleversafe.co.za Domain Name: cleversafe.co.za Registry Domain ID: dom_1X740--1 Registrar WHOIS Server: Registrar URL: https://www.cscglobal.com/cscglobal/home/ Updated Date: 2022-06-11T07:12:21Z Creation Date: 2009-06-15T12:33:52Z Registry Expiry Date: 2023-06-15T12:33:52Z Registrar Registration Expiration Date: 2023-06-15T12:33:52Z Registrar: CSC Corporate Domains Inc Registrar IANA ID: 299 Registrar Abuse Contact Email: @.*** Registrar Abuse Contact Phone: +44.077510055 Reseller: Domain Status: ok https://icann.org/epp#ok Registry Registrant ID: REDACTED Registrant Name: REDACTED Registrant Organization: Registrant Street: REDACTED Registrant City: REDACTED Registrant State/Province: REDACTED Registrant Postal Code: REDACTED Registrant Country: US Registrant Phone: REDACTED Registrant Phone Ext: REDACTED Registrant Fax: REDACTED Registrant Fax Ext: REDACTED Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name. Registry Admin ID: REDACTED Admin Name: REDACTED Admin Organization: REDACTED Admin Street: REDACTED Admin City: REDACTED Admin State/Province: REDACTED Admin Postal Code: REDACTED Admin Country: REDACTED Admin Phone: REDACTED Admin Phone Ext: REDACTED Admin Fax: REDACTED Admin Fax Ext: REDACTED Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name. Registry Tech ID: REDACTED Tech Name: REDACTED Tech Organization: REDACTED Tech Street: REDACTED Tech City: REDACTED Tech State/Province: REDACTED Tech Postal Code: REDACTED Tech Country: REDACTED Tech Phone: REDACTED Tech Phone Ext: REDACTED Tech Fax: REDACTED Tech Fax Ext: REDACTED Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name. Registry Billing ID: REDACTED Billing Name: REDACTED Billing Organization: REDACTED Billing Street: REDACTED Billing City: REDACTED Billing State/Province: REDACTED Billing Postal Code: REDACTED Billing Country: REDACTED Billing Phone: REDACTED Billing Phone Ext: REDACTED Billing Fax: REDACTED Billing Fax Ext: REDACTED Billing Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin or Tech contacts of the domain name. Name Server: ns1.cleversafe.com Name Server: ns3.cleversafe.com DNSSEC: unsigned URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/

Last update of WHOIS database: 2023-03-08T15:51:51Z <<<

For more information on Whois status codes, please visit https://icann.org/epp

--

For more information on Whois status codes, please visit https://icann.org/epp

ZARC Complaint/s Procedure and Form: https://registry.net.za/content.php?gen=1&contentid=226

The use of this Whois facility is subject to the following terms and

conditions. https://registry.net.za/whois_terms

Copyright (c) ZARC 2023

— Reply to this email directly, view it on GitHub https://github.com/DannyCork/python-whois/issues/288#issuecomment-1460422638, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACU73CXMYP7OTHXPGCGFBMLW3CVDPANCNFSM6AAAAAAVRVU754 . You are receiving this because you commented.Message ID: @.***>