Skip to content

Commit 369dff7

Browse files
committed
Add support for organization names in Nominet WHOIS data, and allow for extra fields in Nominet WHOIS data where the registrant has opted to have their address omitted. Fixes joepie91#36.
1 parent 0ae66ff commit 369dff7

File tree

6 files changed

+59
-4
lines changed

6 files changed

+59
-4
lines changed

pythonwhois/parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def preprocess_regex(regex):
229229
"Registrant:[ ]*(?P<name>.+)\n[\s\S]*Eligibility Name:[ ]*(?P<organization>.+)\n[\s\S]*Registrant Contact ID:[ ]*(?P<handle>.+)\n", # .au business
230230
"Eligibility Type:[ ]*Citizen\/Resident\n[\s\S]*Registrant Contact ID:[ ]*(?P<handle>.+)\n[\s\S]*Registrant Contact Name:[ ]*(?P<name>.+)\n", # .au individual
231231
"Registrant:[ ]*(?P<organization>.+)\n[\s\S]*Eligibility Type:[ ]*(Higher Education Institution|Company|Incorporated Association|Other)\n[\s\S]*Registrant Contact ID:[ ]*(?P<handle>.+)\n[\s\S]*Registrant Contact Name:[ ]*(?P<name>.+)\n", # .au educational, company, 'incorporated association' (non-profit?), other (spotted for linux.conf.au, unsure if also for others)
232-
" Registrant:\n (?P<name>.+)\n\n Registrant type:\n .*\n\n Registrant's address:\n The registrant .* opted to have", # Nominet (.uk) with hidden address
233-
" Registrant:\n (?P<name>.+)\n\n[\s\S]* Registrant type:\n .*\n\n Registrant's address:\n (?P<street1>.+)\n(?: (?P<street2>.+)\n(?: (?P<street3>.+)\n)??)?? (?P<city>[^0-9\n]+)\n(?: (?P<state>.+)\n)? (?P<postalcode>.+)\n (?P<country>.+)\n\n", # Nominet (.uk) with visible address
232+
" Registrant:\n (?P<name>.+)\n\n(?: Trading as:\s?\n (?P<organization>.+)\n\n)?[\s\S]* Registrant type:\n .*\n\n Registrant's address:\n The registrant .* opted to have", # Nominet (.uk) with hidden address
233+
" Registrant:\n (?P<name>.+)\n\n(?: Trading as:\s?\n (?P<organization>.+)\n\n)?[\s\S]* Registrant type:\n .*\n\n Registrant's address:\n (?P<street1>.+)\n(?: (?P<street2>.+)\n(?: (?P<street3>.+)\n)??)?? (?P<city>[^0-9\n]+)\n(?: (?P<state>.+)\n)? (?P<postalcode>.+)\n (?P<country>.+)\n\n", # Nominet (.uk) with visible address
234234
"Domain Owner:\n\t(?P<organization>.+)\n\n[\s\S]*?(?:Registrant Contact:\n\t(?P<name>.+))?\n\nRegistrant(?:'s)? (?:a|A)ddress:(?:\n\t(?P<street1>.+)\n(?:\t(?P<street2>.+)\n)?(?:\t(?P<street3>.+)\n)?\t(?P<city>.+)\n\t(?P<postalcode>.+))?\n\t(?P<country>.+)(?:\n\t(?P<phone>.+) \(Phone\)\n\t(?P<fax>.+) \(FAX\)\n\t(?P<email>.+))?\n\n", # .ac.uk - what a mess...
235235
"Registrant ID: (?P<handle>.+)\nRegistrant: (?P<name>.+)\nRegistrant Contact Email: (?P<email>.+)", # .cn (CNNIC)
236236
"Registrant contact:\n (?P<name>.+)\n (?P<street>.*)\n (?P<city>.+), (?P<state>.+) (?P<postalcode>.+) (?P<country>.+)\n\n", # Fabulous.com

test/data/tattitude.co.uk

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
Domain name:
3+
tattitude.co.uk
4+
5+
Registrant:
6+
Paul Hartley
7+
8+
Trading as:
9+
Private Registration US
10+
11+
Registrant type:
12+
UK Individual
13+
14+
Registrant's address:
15+
The registrant is a non-trading individual who has opted to have their
16+
address omitted from the WHOIS service.
17+
18+
Data validation:
19+
Registrant contact details validated by Nominet on 10-Dec-2012
20+
21+
Registrar:
22+
Melbourne IT t/a Internet Names Worldwide [Tag = MELBOURNE-IT]
23+
URL: http://www.melbourneit.com.au/contacts
24+
25+
Relevant dates:
26+
Registered on: 14-Jul-2007
27+
Expiry date: 14-Jul-2017
28+
Last updated: 14-Jun-2013
29+
30+
Registration status:
31+
Registered until expiry date.
32+
33+
Name servers:
34+
ns1.pipedns.com
35+
ns2.pipedns.com
36+
ns3.pipedns.com
37+
38+
WHOIS lookup made at 01:14:59 06-Oct-2014
39+
40+
--
41+
This WHOIS information is provided for free by Nominet UK the central registry
42+
for .uk domain names. This information and the .uk WHOIS are:
43+
44+
Copyright Nominet UK 1996 - 2014.
45+
46+
You may not access the .uk WHOIS or use any data from it except as permitted
47+
by the terms of use available in full at http://www.nominet.org.uk/whoisterms,
48+
which includes restrictions on: (A) use of the data for advertising, or its
49+
repackaging, recompilation, redistribution or reuse (B) obscuring, removing
50+
or hiding any or all of this notice and (C) exceeding query rate or volume
51+
limits. The data is provided on an 'as-is' basis and may lag behind the
52+
register. Access may be withdrawn or restricted at any time.
53+

test/target_default/baligems.co.uk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"updated_date": ["2014-01-20T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"city": "Stockport", "name": "Global Travel Group", "state": "Cheshire", "street": "2nd Floor Dale House\nTiviot Dale", "country": "United Kingdom", "postalcode": "SK1 1TB"}, "billing": null}, "nameservers": ["ns1.domainmonster.com", "ns2.domainmonster.com", "ns3.domainmonster.com"], "expiration_date": ["2015-02-04T00:00:00"], "creation_date": ["2008-02-04T00:00:00", "2008-02-04T00:00:00", "2008-02-04T00:00:00"], "raw": ["\n Domain name:\n baligems.co.uk\n\n Registrant:\n Global Travel Group\n\n Trading as: \n The Global Travel Group Plc\n\n Registrant type:\n UK Public Limited Company, (Company number: 2774722)\n\n Registrant's address:\n 2nd Floor Dale House\n Tiviot Dale\n Stockport\n Cheshire\n SK1 1TB\n United Kingdom\n\n Registrar:\n Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]\n URL: http://www.domainmonster.com\n\n Relevant dates:\n Registered on: 04-Feb-2008\n Expiry date: 04-Feb-2015\n Last updated: 20-Jan-2014\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.domainmonster.com\n ns2.domainmonster.com\n ns3.domainmonster.com\n\n WHOIS lookup made at 09:27:26 15-Apr-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]"]}
1+
{"updated_date": ["2014-01-20T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"city": "Stockport", "name": "Global Travel Group", "state": "Cheshire", "street": "2nd Floor Dale House\nTiviot Dale", "country": "United Kingdom", "postalcode": "SK1 1TB", "organization": "The Global Travel Group Plc"}, "billing": null}, "nameservers": ["ns1.domainmonster.com", "ns2.domainmonster.com", "ns3.domainmonster.com"], "expiration_date": ["2015-02-04T00:00:00"], "creation_date": ["2008-02-04T00:00:00", "2008-02-04T00:00:00", "2008-02-04T00:00:00"], "raw": ["\n Domain name:\n baligems.co.uk\n\n Registrant:\n Global Travel Group\n\n Trading as: \n The Global Travel Group Plc\n\n Registrant type:\n UK Public Limited Company, (Company number: 2774722)\n\n Registrant's address:\n 2nd Floor Dale House\n Tiviot Dale\n Stockport\n Cheshire\n SK1 1TB\n United Kingdom\n\n Registrar:\n Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]\n URL: http://www.domainmonster.com\n\n Relevant dates:\n Registered on: 04-Feb-2008\n Expiry date: 04-Feb-2015\n Last updated: 20-Jan-2014\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.domainmonster.com\n ns2.domainmonster.com\n ns3.domainmonster.com\n\n WHOIS lookup made at 09:27:26 15-Apr-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]"]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"updated_date": ["2013-06-14T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "Private Registration US", "name": "Paul Hartley"}, "billing": null}, "nameservers": ["ns1.pipedns.com", "ns2.pipedns.com", "ns3.pipedns.com"], "expiration_date": ["2017-07-14T00:00:00"], "creation_date": ["2007-07-14T00:00:00", "2007-07-14T00:00:00", "2007-07-14T00:00:00"], "raw": ["\n Domain name:\n tattitude.co.uk\n\n Registrant:\n Paul Hartley\n\n Trading as: \n Private Registration US\n\n Registrant type:\n UK Individual\n\n Registrant's address:\n The registrant is a non-trading individual who has opted to have their\n address omitted from the WHOIS service.\n\n Data validation:\n Registrant contact details validated by Nominet on 10-Dec-2012\n\n Registrar:\n Melbourne IT t/a Internet Names Worldwide [Tag = MELBOURNE-IT]\n URL: http://www.melbourneit.com.au/contacts\n\n Relevant dates:\n Registered on: 14-Jul-2007\n Expiry date: 14-Jul-2017\n Last updated: 14-Jun-2013\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.pipedns.com\n ns2.pipedns.com\n ns3.pipedns.com\n\n WHOIS lookup made at 01:14:59 06-Oct-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Melbourne IT t/a Internet Names Worldwide [Tag = MELBOURNE-IT]"]}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"updated_date": ["2014-01-20T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"city": "Stockport", "name": "Global Travel Group", "state": "Cheshire", "street": "2nd Floor Dale House\nTiviot Dale", "country": "United Kingdom", "postalcode": "SK1 1TB"}, "billing": null}, "nameservers": ["ns1.domainmonster.com", "ns2.domainmonster.com", "ns3.domainmonster.com"], "expiration_date": ["2015-02-04T00:00:00"], "creation_date": ["2008-02-04T00:00:00", "2008-02-04T00:00:00", "2008-02-04T00:00:00"], "raw": ["\n Domain name:\n baligems.co.uk\n\n Registrant:\n Global Travel Group\n\n Trading as: \n The Global Travel Group Plc\n\n Registrant type:\n UK Public Limited Company, (Company number: 2774722)\n\n Registrant's address:\n 2nd Floor Dale House\n Tiviot Dale\n Stockport\n Cheshire\n SK1 1TB\n United Kingdom\n\n Registrar:\n Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]\n URL: http://www.domainmonster.com\n\n Relevant dates:\n Registered on: 04-Feb-2008\n Expiry date: 04-Feb-2015\n Last updated: 20-Jan-2014\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.domainmonster.com\n ns2.domainmonster.com\n ns3.domainmonster.com\n\n WHOIS lookup made at 09:27:26 15-Apr-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]"]}
1+
{"updated_date": ["2014-01-20T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"city": "Stockport", "name": "Global Travel Group", "state": "Cheshire", "street": "2nd Floor Dale House\nTiviot Dale", "country": "United Kingdom", "postalcode": "SK1 1TB", "organization": "The Global Travel Group Plc"}, "billing": null}, "nameservers": ["ns1.domainmonster.com", "ns2.domainmonster.com", "ns3.domainmonster.com"], "expiration_date": ["2015-02-04T00:00:00"], "creation_date": ["2008-02-04T00:00:00", "2008-02-04T00:00:00", "2008-02-04T00:00:00"], "raw": ["\n Domain name:\n baligems.co.uk\n\n Registrant:\n Global Travel Group\n\n Trading as: \n The Global Travel Group Plc\n\n Registrant type:\n UK Public Limited Company, (Company number: 2774722)\n\n Registrant's address:\n 2nd Floor Dale House\n Tiviot Dale\n Stockport\n Cheshire\n SK1 1TB\n United Kingdom\n\n Registrar:\n Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]\n URL: http://www.domainmonster.com\n\n Relevant dates:\n Registered on: 04-Feb-2008\n Expiry date: 04-Feb-2015\n Last updated: 20-Jan-2014\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.domainmonster.com\n ns2.domainmonster.com\n ns3.domainmonster.com\n\n WHOIS lookup made at 09:27:26 15-Apr-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Mesh Digital Limited t/a Domainmonster.com [Tag = MONSTER]"]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"updated_date": ["2013-06-14T00:00:00"], "status": ["Registered until expiry date."], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "Private Registration US", "name": "Paul Hartley"}, "billing": null}, "nameservers": ["ns1.pipedns.com", "ns2.pipedns.com", "ns3.pipedns.com"], "expiration_date": ["2017-07-14T00:00:00"], "creation_date": ["2007-07-14T00:00:00", "2007-07-14T00:00:00", "2007-07-14T00:00:00"], "raw": ["\n Domain name:\n tattitude.co.uk\n\n Registrant:\n Paul Hartley\n\n Trading as: \n Private Registration US\n\n Registrant type:\n UK Individual\n\n Registrant's address:\n The registrant is a non-trading individual who has opted to have their\n address omitted from the WHOIS service.\n\n Data validation:\n Registrant contact details validated by Nominet on 10-Dec-2012\n\n Registrar:\n Melbourne IT t/a Internet Names Worldwide [Tag = MELBOURNE-IT]\n URL: http://www.melbourneit.com.au/contacts\n\n Relevant dates:\n Registered on: 14-Jul-2007\n Expiry date: 14-Jul-2017\n Last updated: 14-Jun-2013\n\n Registration status:\n Registered until expiry date.\n\n Name servers:\n ns1.pipedns.com\n ns2.pipedns.com\n ns3.pipedns.com\n\n WHOIS lookup made at 01:14:59 06-Oct-2014\n\n-- \nThis WHOIS information is provided for free by Nominet UK the central registry\nfor .uk domain names. This information and the .uk WHOIS are:\n\n Copyright Nominet UK 1996 - 2014.\n\nYou may not access the .uk WHOIS or use any data from it except as permitted\nby the terms of use available in full at http://www.nominet.org.uk/whoisterms,\nwhich includes restrictions on: (A) use of the data for advertising, or its\nrepackaging, recompilation, redistribution or reuse (B) obscuring, removing\nor hiding any or all of this notice and (C) exceeding query rate or volume\nlimits. The data is provided on an 'as-is' basis and may lag behind the\nregister. Access may be withdrawn or restricted at any time. \n\n"], "registrar": ["Melbourne IT t/a Internet Names Worldwide [Tag = MELBOURNE-IT]"]}

0 commit comments

Comments
 (0)