Skip to content

Commit 7af056a

Browse files
author
Ángel González
committed
Support the "Registrar WHOIS Server" key name for the referral
The ICANN “Registry Registration Data Directory Services Consistent Labeling and Display Policy” [1] renames the key from "WHOIS Server" to this. Remove duplicate "whois server" entry, as noticed by @devl00p Fixes joepie91#131 [1] https://www.icann.org/resources/pages/rdds-labeling-policy-2017-02-01-en
1 parent bc75768 commit 7af056a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pythonwhois/net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Fals
7777
# Ignore redirects from registries who publish the registrar data themselves
7878
if target_server not in ('whois.nic.xyz',):
7979
for line in [x.strip() for x in response.splitlines()]:
80-
match = re.match("(refer|whois server|referral url|whois server|registrar whois):\s*([^\s]+\.[^\s]+)", line, re.IGNORECASE)
80+
match = re.match("(refer|whois server|referral url|registrar whois(?: server)?):\s*([^\s]+\.[^\s]+)", line, re.IGNORECASE)
8181
if match is not None:
8282
referal_server = match.group(2)
8383
if referal_server != server and "://" not in referal_server: # We want to ignore anything non-WHOIS (eg. HTTP) for now.

pythonwhois/parse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def precompile_regexes_dict(source, flags=0):
156156
'Domain Registrar :\s?(?P<val>.+)',
157157
'Registration Service Provider: (?P<val>.+)',
158158
'\tName:\t\s(?P<val>.+)'],
159-
'whois_server': ['Whois Server:\s?(?P<val>.+)',
159+
'whois_server': ['Registrar WHOIS Server:\s?(?P<val>.+)',
160+
'Whois Server:\s?(?P<val>.+)',
160161
'Registrar Whois:\s?(?P<val>.+)'],
161162
'nameservers': ['Name Server:[ ]*(?P<val>[^ ]+)',
162163
'Nameservers:[ ]*(?P<val>[^ ]+)',

0 commit comments

Comments
 (0)