Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 0f95223

Browse files
authored
Merge pull request #259 from maarten-boot/development
add central compiled regex pool; add tm tld; fix detection of 2 level tld's; fix tld com is sometimes different: example lg.com
2 parents d42a7f5 + ee42fc0 commit 0f95223

File tree

27 files changed

+184
-30
lines changed

27 files changed

+184
-30
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Raise an issue https://github.com/DannyCork/python-whois/issues/new
8484

8585
2023-01-27: maarten_boot
8686
* add autodetect via iana tld file (this has only tld's)
87+
* add a central collection of all compiled regexes and reuse them: REG_COLLECTION_BY_KEY in _0_init_tld.py
88+
* refresh testdata now that tld has dot instead of _ if more then one level
89+
* add additional strings meaning domain does not exist
8790

8891
## Support
8992
* Python 3.x is supported.

testdata/example.com/nameservers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
example.com name server a.iana-servers.net.
21
example.com name server b.iana-servers.net.
2+
example.com name server a.iana-servers.net.

testdata/example.org/input

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Name Server: a.iana-servers.net
5858
Name Server: b.iana-servers.net
5959
DNSSEC: signedDelegation
6060
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
61-
>>> Last update of WHOIS database: 2023-01-04T15:03:07Z <<<
61+
>>> Last update of WHOIS database: 2023-01-27T13:06:45Z <<<
6262

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

testdata/example.org/nameservers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
example.org name server b.iana-servers.net.
21
example.org name server a.iana-servers.net.
2+
example.org name server b.iana-servers.net.

testdata/google.com/input

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ Tech State/Province: CA
3232
Tech Country: US
3333
Tech Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
3434
Name Server: ns1.google.com
35-
Name Server: ns2.google.com
36-
Name Server: ns3.google.com
3735
Name Server: ns4.google.com
36+
Name Server: ns3.google.com
37+
Name Server: ns2.google.com
3838
DNSSEC: unsigned
3939
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
40-
>>> Last update of WHOIS database: 2023-01-04T14:55:04+0000 <<<
40+
>>> Last update of WHOIS database: 2023-01-27T13:04:53+0000 <<<
4141

4242
For more information on WHOIS status codes, please visit:
4343
https://www.icann.org/resources/pages/epp-status-codes

testdata/hello.xyz/input

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[Querying whois.nic.xyz]
2+
[whois.nic.xyz]
3+
Domain Name: HELLO.XYZ
4+
Registry Domain ID: D2208533-CNIC
5+
Registrar WHOIS Server: whois.namecheap.com
6+
Registrar URL: https://namecheap.com
7+
Updated Date: 2022-03-14T11:17:22.0Z
8+
Creation Date: 2014-03-20T15:01:22.0Z
9+
Registry Expiry Date: 2023-03-20T23:59:59.0Z
10+
Registrar: Namecheap
11+
Registrar IANA ID: 1068
12+
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
13+
Registrant Organization: Privacy service provided by Withheld for Privacy ehf
14+
Registrant State/Province: Capital Region
15+
Registrant Country: IS
16+
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 contact of the queried domain name.
17+
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 contact of the queried domain name.
18+
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 contact of the queried domain name.
19+
Name Server: DNS1.REGISTRAR-SERVERS.COM
20+
Name Server: DNS2.REGISTRAR-SERVERS.COM
21+
DNSSEC: unsigned
22+
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 contact of the queried domain name.
23+
Registrar Abuse Contact Email: [email protected]
24+
Registrar Abuse Contact Phone: +1.9854014545
25+
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
26+
>>> Last update of WHOIS database: 2023-01-27T13:06:56.0Z <<<
27+
28+
For more information on Whois status codes, please visit https://icann.org/epp
29+
30+
>>> IMPORTANT INFORMATION ABOUT THE DEPLOYMENT OF RDAP: please visit
31+
https://www.centralnic.com/support/rdap <<<
32+
33+
The Whois and RDAP services are provided by CentralNic, and contain
34+
information pertaining to Internet domain names registered by our
35+
our customers. By using this service you are agreeing (1) not to use any
36+
information presented here for any purpose other than determining
37+
ownership of domain names, (2) not to store or reproduce this data in
38+
any way, (3) not to use any high-volume, automated, electronic processes
39+
to obtain data from this service. Abuse of this service is monitored and
40+
actions in contravention of these terms will result in being permanently
41+
blacklisted. All data is (c) CentralNic Ltd (https://www.centralnic.com)
42+
43+
Access to the Whois and RDAP services is rate limited. For more
44+
information, visit https://registrar-console.centralnic.com/pub/whois_guidance.

testdata/hello.xyz/nameservers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hello.xyz name server dns1.registrar-servers.com.
2+
hello.xyz name server dns2.registrar-servers.com.

testdata/hello.xyz/output

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
test domain: <<<<<<<<<< hello.xyz >>>>>>>>>>>>>>>>>>>>
3+
name str 'hello.xyz'
4+
tld str 'xyz'
5+
registrar str 'Namecheap'
6+
registrant_country str 'IS'
7+
creation_date datetime.datetime 2014-03-20 15:01:22
8+
expiration_date datetime.datetime 2023-03-20 23:59:59
9+
last_updated datetime.datetime 2022-03-14 11:17:22
10+
status str 'clientTransferProhibited https://icann.org/epp#clientTransferProhibited'
11+
statuses list ['clientTransferProhibited https://icann.org/epp#clientTransferProhibited']
12+
dnssec bool False
13+
name_servers list ['dns1.registrar-servers.com', 'dns2.registrar-servers.com']
14+
registrant str 'Privacy service provided by Withheld for Privacy ehf'
15+
emails list ['[email protected]']

testdata/make_testdata.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ getDomains()
1515
meta.co.jp # jp has [registrar] type keywords not registrar:
1616
meta.kr # has both korean and english text
1717
meta.com.tr # has utf 8 response text and different formatting style
18+
hello.xyz # has sometimes IANA Source beginning on mac
1819
)
1920
}
2021

testdata/meta.co.jp/nameservers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
meta.co.jp name server ns2.meta.co.jp.
2-
meta.co.jp name server ns2.sphere.ad.jp.
32
meta.co.jp name server ns.meta.co.jp.
3+
meta.co.jp name server ns2.sphere.ad.jp.

0 commit comments

Comments
 (0)