diff --git a/pwhois b/pwhois index 08c9595..eb406fd 100755 --- a/pwhois +++ b/pwhois @@ -20,15 +20,19 @@ def json_fallback(obj): return obj if args.file is None: - data = pythonwhois.net.get_whois_raw(args.domain[0]) + data, server_list = pythonwhois.net.get_whois_raw(args.domain[0], with_server_list=True) else: + server_list = [] with open(args.file, "r") as f: data = f.read().split("\n--\n") if args.raw == True: print "\n--\n".join(data) else: - parsed = pythonwhois.parse.parse_raw_whois(data, normalized=True) + if len(server_list) > 0: + parsed = pythonwhois.parse.parse_raw_whois(data, normalized=True, never_query_handles=False, handle_server=server_list[-1]) + else: + parsed = pythonwhois.parse.parse_raw_whois(data, normalized=True) if args.json == True: print json.dumps(parsed, default=json_fallback) diff --git a/pythonwhois/__init__.py b/pythonwhois/__init__.py index b9eabf6..47639c3 100644 --- a/pythonwhois/__init__.py +++ b/pythonwhois/__init__.py @@ -1,8 +1,11 @@ from . import net, parse def get_whois(domain, normalized=[]): - raw_data = net.get_whois_raw(domain) - return parse.parse_raw_whois(raw_data, normalized=normalized) + raw_data, server_list = net.get_whois_raw(domain, with_server_list=True) + # Unlisted handles will be looked up on the last WHOIS server that was queried. This may be changed to also query + # other servers in the future, if it turns out that there are cases where the last WHOIS server in the chain doesn't + # actually hold the handle contact details, but another WHOIS server in the chain does. + return parse.parse_raw_whois(raw_data, normalized=normalized, never_query_handles=False, handle_server=server_list[-1]) def whois(*args, **kwargs): raise Exception("The whois() method has been replaced by a different method (with a different API), since pythonwhois 2.0. Either install the older pythonwhois 1.2.3, or change your code to use the new API.") diff --git a/pythonwhois/net.py b/pythonwhois/net.py index 982162e..0f22b8d 100644 --- a/pythonwhois/net.py +++ b/pythonwhois/net.py @@ -2,7 +2,7 @@ import socket, re from codecs import encode, decode from . import shared -def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False): +def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False, with_server_list=False, server_list=[]): # Sometimes IANA simply won't give us the right root WHOIS server exceptions = { ".ac.uk": "whois.ja.net", @@ -14,8 +14,9 @@ def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False) if rfc3490: domain = encode( domain if type(domain) is unicode else decode(domain, "utf8"), "idna" ) - if len(previous) == 0: + if len(previous) == 0 and server == "": # Root query + server_list = [] # Otherwise it retains the list on subsequent queries, for some reason. is_exception = False for exception, exc_serv in exceptions.iteritems(): if domain.endswith(exception): @@ -26,7 +27,7 @@ def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False) target_server = get_root_server(domain) else: target_server = server - if domain.endswith(".jp") and target_server == "whois.jprs.jp": + if target_server == "whois.jprs.jp": request_domain = "%s/e" % domain # Suppress Japanese output elif domain.endswith(".de") and ( target_server == "whois.denic.de" or target_server == "de.whois-servers.net" ): request_domain = "-T dn,ace %s" % domain # regional specific stuff @@ -52,14 +53,18 @@ def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False) break if never_cut == False: new_list = [response] + previous + server_list.append(target_server) for line in [x.strip() for x in response.splitlines()]: match = re.match("(refer|whois server|referral url|whois server|registrar whois):\s*([^\s]+\.[^\s]+)", line, re.IGNORECASE) if match is not None: referal_server = match.group(2) - if referal_server != server: + if referal_server != server and "://" not in referal_server: # We want to ignore anything non-WHOIS (eg. HTTP) for now. # Referal to another WHOIS server... - return get_whois_raw(domain, referal_server, new_list) - return new_list + return get_whois_raw(domain, referal_server, new_list, server_list=server_list, with_server_list=with_server_list) + if with_server_list: + return (new_list, server_list) + else: + return new_list def get_root_server(domain): data = whois_request(domain, "whois.iana.org") diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index f13fe75..1f28083 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -1,11 +1,13 @@ from __future__ import print_function import re, sys, datetime +from . import net, shared grammar = { "_data": { 'id': ['Domain ID:[ ]*(?P.+)'], 'status': ['\[Status\]\s*(?P.+)', 'Status\s*:\s?(?P.+)', + '\[State\]\s*(?P.+)', '^state:\s*(?P.+)'], 'creation_date': ['\[Created on\]\s*(?P.+)', 'Created on[.]*: [a-zA-Z]+, (?P.+)', @@ -27,6 +29,7 @@ grammar = { 'Domain Create Date\s?[.]*:?\s*?(?P.+)', 'Domain Registration Date\s?[.]*:?\s*?(?P.+)', 'created:\s*(?P.+)', + '\[Registered Date\]\s*(?P.+)', 'created-date:\s*(?P.+)', 'registered:\s*(?P.+)', 'registration:\s*(?P.+)'], @@ -72,6 +75,7 @@ grammar = { 'Last Update\s?[.]*:\s?(?P.+)', 'Last updated on (?P.+) [a-z]{3,4}', 'Last updated:\s*(?P.+)', + '\[Last Update\]\s*(?P.+) \([A-Z]+\)', 'Last update of whois database:\s?[a-z]{3}, (?P.+) [a-z]{3,4}'], 'registrar': ['registrar:\s*(?P.+)', 'Registrar:\s*(?P.+)', @@ -153,7 +157,7 @@ else: return isinstance(data, str) -def parse_raw_whois(raw_data, normalized=[]): +def parse_raw_whois(raw_data, normalized=[], never_query_handles=True, handle_server=""): data = {} raw_data = [segment.replace("\r", "") for segment in raw_data] # Carriage returns are the devil @@ -257,7 +261,7 @@ def parse_raw_whois(raw_data, normalized=[]): data["registrar"] = [match.group(1).strip()] - data["contacts"] = parse_registrants(raw_data) + data["contacts"] = parse_registrants(raw_data, never_query_handles, handle_server) # Parse dates try: @@ -502,7 +506,7 @@ def preprocess_regex(regex): regex = re.sub(r"\[ \]\*\(\?P<([^>]+)>\.\*\)", r"(?P<\1>.*)", regex) return regex -def parse_registrants(data): +def parse_registrants(data, never_query_handles=True, handle_server=""): registrant = None tech_contact = None billing_contact = None @@ -523,6 +527,7 @@ def parse_registrants(data): "Holder of domain name:\n(?P[\S\s]+)\n(?P.+)\n(?P[A-Z0-9-]+)\s+(?P.+)\n(?P.+)\nContractual Language", # nic.ch "\n\n(?:Owner)?\s+: (?P.*)\n(?:\s+: (?P.*)\n)?\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n", # nic.io "Contact Information:\n\[Name\]\s*(?P.*)\n\[Email\]\s*(?P.*)\n\[Web Page\]\s*(?P.*)\n\[Postal code\]\s*(?P.*)\n\[Postal Address\]\s*(?P.*)\n(?:\s+(?P.*)\n)?(?:\s+(?P.*)\n)?\[Phone\]\s*(?P.*)\n\[Fax\]\s*(?P.*)\n", # jprs.jp + "g\. \[Organization\] (?P.+)\n", # .co.jp registrations at jprs.jp "Registrant ID:(?P.*)\nRegistrant Name:(?P.*)\n(?:Registrant Organization:(?P.*)\n)?Registrant Address1:(?P.*)\n(?:Registrant Address2:(?P.*)\n)?(?:Registrant Address3:(?P.*)\n)?Registrant City:(?P.*)\n(?:Registrant State/Province:(?P.*)\n)?Registrant Postal Code:(?P.*)\nRegistrant Country:(?P.*)\nRegistrant Country Code:.*\nRegistrant Phone Number:(?P.*)\n(?:Registrant Facsimile Number:(?P.*)\n)?Registrant Email:(?P.*)", # .US, .biz (NeuStar) "Registrant\n Name: (?P.+)\n(?: Organization: (?P.+)\n)? ContactID: (?P.+)\n(?: Address: (?P.+)\n(?: (?P.+)\n(?: (?P.+)\n)?)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+)\n)?(?: Created: (?P.+)\n)?(?: Last Update: (?P.+)\n)?", # nic.it " Organisation Name[.]* (?P.*)\n Organisation Address[.]* (?P.*)\n Organisation Address[.]* (?P.*)\n(?: Organisation Address[.]* (?P.*)\n)? Organisation Address[.]* (?P.*)\n Organisation Address[.]* (?P.*)\n Organisation Address[.]* (?P.*)\n Organisation Address[.]* (?P.*)", # Melbourne IT (what a horrid format...) @@ -606,17 +611,6 @@ def parse_registrants(data): ] # Some registries use NIC handle references instead of directly listing contacts... - - nic_contact_regexes = [ - "personname:\s*(?P.+)\norganization:\s*(?P.+)\nstreet address:\s*(?P.+)\npostal code:\s*(?P.+)\ncity:\s*(?P.+)\ncountry:\s*(?P.+)\n(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:e-mail:\s*(?P.+)\n)?nic-hdl:\s*(?P.+)\nchanged:\s*(?P.+)", # nic.at - "contact-handle:[ ]*(?P.+)\ncontact:[ ]*(?P.+)\n(?:organisation:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\n(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\n(?:phone:[ ]*(?P.+)\n)?(?:fax:[ ]*(?P.+)\n)?(?:email:[ ]*(?P.+)\n)?", # LCN.com - "person:\s*(?P.+)\nnic-hdl:\s*(?P.+)\n", # .ie - "nic-hdl:\s*(?P.+)\ntype:\s*(?P.+)\ncontact:\s*(?P.+)\n(?:.+\n)*?(?:address:\s*(?P.+)\naddress:\s*(?P.+)\naddress:\s*(?P.+)\naddress:\s*(?P.+)\n)?(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P.+)\n)?(?:.+\n)*?changed:\s*(?P[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness without country field - "nic-hdl:\s*(?P.+)\ntype:\s*(?P.+)\ncontact:\s*(?P.+)\n(?:.+\n)*?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P.+)\n)?(?:.+\n)*?changed:\s*(?P[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness any country -at all- - "nic-hdl:\s*(?P.+)\ntype:\s*(?P.+)\ncontact:\s*(?P.+)\n(?:.+\n)*?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?(?:address:\s*(?P.+)\n)?country:\s*(?P.+)\n(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P.+)\n)?(?:.+\n)*?changed:\s*(?P[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness with country field - - ] - nic_contact_references = { "registrant": [ "registrant:\s*(?P.+)", # nic.at @@ -627,10 +621,12 @@ def parse_registrants(data): "tech": [ "tech-c:\s*(?P.+)", # nic.at, AFNIC, iis.se "technical-contact:\s*(?P.+)", # LCN.com + "n\. \[Technical Contact\] (?P.+)\n", #.co.jp ], "admin": [ "admin-c:\s*(?P.+)", # nic.at, AFNIC, iis.se "admin-contact:\s*(?P.+)", # LCN.com + "m\. \[Administrative Contact\] (?P.+)\n", # .co.jp ], "billing": [ "billing-c:\s*(?P.+)", # iis.se @@ -677,14 +673,10 @@ def parse_registrants(data): break # Find NIC handle contact definitions - handle_contacts = [] - for regex in nic_contact_regexes: - for segment in data: - matches = re.finditer(regex, segment) - for match in matches: - handle_contacts.append(match.groupdict()) + handle_contacts = parse_nic_contact(data) # Find NIC handle references and process them + missing_handle_contacts = [] for category in nic_contact_references: for regex in nic_contact_references[category]: for segment in data: @@ -694,9 +686,23 @@ def parse_registrants(data): if data_reference["handle"] == "-" or re.match("https?:\/\/", data_reference["handle"]) is not None: pass # Reference was either blank or a URL; the latter is to deal with false positives for nic.ru else: + found = False for contact in handle_contacts: if contact["handle"] == data_reference["handle"]: + found = True data_reference.update(contact) + if found == False: + # The contact definition was not found in the supplied raw WHOIS data. If the + # method has been called with never_query_handles=False, we can use the supplied + # WHOIS server for looking up the handle information separately. + if never_query_handles == False: + try: + contact = fetch_nic_contact(data_reference["handle"], handle_server) + data_reference.update(contact) + except shared.WhoisException as e: + pass # No data found. TODO: Log error? + else: + pass # TODO: Log warning? if category == "registrant": registrant = data_reference elif category == "tech": @@ -706,7 +712,7 @@ def parse_registrants(data): elif category == "admin": admin_contact = data_reference break - + # Post-processing for obj in (registrant, tech_contact, billing_contact, admin_contact): if obj is not None: @@ -732,6 +738,8 @@ def parse_registrants(data): obj["street"] = "\n".join(street_items) if 'changedate' in obj: obj['changedate'] = parse_dates([obj['changedate']])[0] + if 'creationdate' in obj: + obj['creationdate'] = parse_dates([obj['creationdate']])[0] if 'street' in obj and "\n" in obj["street"] and 'postalcode' not in obj: # Deal with certain mad WHOIS servers that don't properly delimit address data... (yes, AFNIC, looking at you) lines = [x.strip() for x in obj["street"].splitlines()] @@ -754,3 +762,33 @@ def parse_registrants(data): "admin": admin_contact, "billing": billing_contact, } + +def fetch_nic_contact(handle, lookup_server): + response = net.get_whois_raw(handle, lookup_server) + response = [segment.replace("\r", "") for segment in response] # Carriage returns are the devil + results = parse_nic_contact(response) + + if len(results) > 0: + return results[0] + else: + raise shared.WhoisException("No contact data found in the response.") + +def parse_nic_contact(data): + nic_contact_regexes = [ + "personname:\s*(?P.+)\norganization:\s*(?P.+)\nstreet address:\s*(?P.+)\npostal code:\s*(?P.+)\ncity:\s*(?P.+)\ncountry:\s*(?P.+)\n(?:phone:\s*(?P.+)\n)?(?:fax-no:\s*(?P.+)\n)?(?:e-mail:\s*(?P.+)\n)?nic-hdl:\s*(?P.+)\nchanged:\s*(?P.+)", # nic.at + "contact-handle:[ ]*(?P.+)\ncontact:[ ]*(?P.+)\n(?:organisation:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\n(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?(?:address:[ ]*(?P.+)\n)?address:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\naddress:[ ]*(?P.+)\n(?:phone:[ ]*(?P.+)\n)?(?:fax:[ ]*(?P.+)\n)?(?:email:[ ]*(?P.+)\n)?", # LCN.com + "Contact Information:\na\. \[JPNIC Handle\] (?P.+)\nc\. \[Last, First\] (?P.+), (?P.+)\nd\. \[E-Mail\] (?P.+)\ng\. \[Organization\] (?P.+)\nl\. \[Division\] (?P.+)\nn\. \[Title\] (?P.+)\no\. \[TEL\] (?P<phone>.+)\np\. \[FAX\] (?P<fax>.+)\ny\. \[Reply Mail\] .*\n\[Last Update\] (?P<changedate>.+) \(JST\)\n", # JPRS .co.jp contact handle lookup + "person:\s*(?P<name>.+)\nnic-hdl:\s*(?P<handle>.+)\n", # .ie + "nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\naddress:\s*(?P<street2>.+)\naddress:\s*(?P<street3>.+)\naddress:\s*(?P<country>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness without country field + "nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness any country -at all- + "nic-hdl:\s*(?P<handle>.+)\ntype:\s*(?P<type>.+)\ncontact:\s*(?P<name>.+)\n(?:.+\n)*?(?:address:\s*(?P<street1>.+)\n)?(?:address:\s*(?P<street2>.+)\n)?(?:address:\s*(?P<street3>.+)\n)?(?:address:\s*(?P<street4>.+)\n)?country:\s*(?P<country>.+)\n(?:phone:\s*(?P<phone>.+)\n)?(?:fax-no:\s*(?P<fax>.+)\n)?(?:.+\n)*?(?:e-mail:\s*(?P<email>.+)\n)?(?:.+\n)*?changed:\s*(?P<changedate>[0-9]{2}\/[0-9]{2}\/[0-9]{4}).*\n", # AFNIC madness with country field + ] + + handle_contacts = [] + for regex in nic_contact_regexes: + for segment in data: + matches = re.finditer(regex, segment) + for match in matches: + handle_contacts.append(match.groupdict()) + + return handle_contacts \ No newline at end of file diff --git a/test.py b/test.py index 40dbc57..4117c69 100755 --- a/test.py +++ b/test.py @@ -4,6 +4,9 @@ import sys, argparse, os, pythonwhois, json, datetime, codecs import pkgutil import encodings +# FIXME: The testing script is currently incapable of testing referenced NIC handles that are +# retrieved separately, such as is the case with the JPRS registry for .co.jp. This +# really needs to be fixed, to ensure that contact parsing for this doesn't break. def get_codecs(): """Dynamically get list of codecs in python.""" diff --git a/test/data/google.co.jp b/test/data/google.co.jp new file mode 100644 index 0000000..9001689 --- /dev/null +++ b/test/data/google.co.jp @@ -0,0 +1,33 @@ +[ 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'. ] +[ ] +[ Notice -------------------------------------------------------------------- ] +[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ] +[ following two points on January 18, 2015. ] +[ ] +[ 1) Change of the format of response about gTLD domain name ] +[ 2) Change of the character encoding ] +[ ] +[ For further information, please see the following webpage. ] +[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ] +[ --------------------------------------------------------------------------- ] + +Domain Information: +a. [Domain Name] GOOGLE.CO.JP +g. [Organization] Google Japan +l. [Organization Type] corporation +m. [Administrative Contact] DL152JP +n. [Technical Contact] TW124137JP +p. [Name Server] ns1.google.com +p. [Name Server] ns2.google.com +p. [Name Server] ns3.google.com +p. [Name Server] ns4.google.com +s. [Signing Key] +[State] Connected (2015/03/31) +[Registered Date] 2001/03/22 +[Connected Date] 2001/03/22 +[Last Update] 2014/04/01 01:18:23 (JST) + + diff --git a/test/data/nttpc.co.jp b/test/data/nttpc.co.jp new file mode 100644 index 0000000..f93c537 --- /dev/null +++ b/test/data/nttpc.co.jp @@ -0,0 +1,31 @@ +[ 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'. ] +[ ] +[ Notice -------------------------------------------------------------------- ] +[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ] +[ following two points on January 18, 2015. ] +[ ] +[ 1) Change of the format of response about gTLD domain name ] +[ 2) Change of the character encoding ] +[ ] +[ For further information, please see the following webpage. ] +[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ] +[ --------------------------------------------------------------------------- ] + +Domain Information: +a. [Domain Name] NTTPC.CO.JP +g. [Organization] NTT PC Communications Incorporated +l. [Organization Type] Corporation +m. [Administrative Contact] TY4708JP +n. [Technical Contact] YA6489JP +p. [Name Server] ns1.sphere.ad.jp +p. [Name Server] ns2.sphere.ad.jp +s. [Signing Key] +[State] Connected (2015/03/31) +[Registered Date] +[Connected Date] +[Last Update] 2014/04/01 01:10:41 (JST) + + diff --git a/test/target_default/google.co.jp b/test/target_default/google.co.jp new file mode 100644 index 0000000..27488c9 --- /dev/null +++ b/test/target_default/google.co.jp @@ -0,0 +1 @@ +{"status": ["Connected (2015/03/31)"], "updated_date": ["2014-04-01T01:18:23"], "contacts": {"admin": {"handle": "DL152JP"}, "tech": {"handle": "TW124137JP"}, "registrant": {"organization": "Google Japan"}, "billing": null}, "nameservers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"], "creation_date": ["2001-03-22T00:00:00"], "raw": ["[ JPRS database provides information on network administration. Its use is ]\n[ restricted to network administration purposes. For further information, ]\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\n[ ]\n[ Notice -------------------------------------------------------------------- ]\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\n[ following two points on January 18, 2015. ]\n[ ]\n[ 1) Change of the format of response about gTLD domain name ]\n[ 2) Change of the character encoding ]\n[ ]\n[ For further information, please see the following webpage. ]\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\n[ --------------------------------------------------------------------------- ]\n\nDomain Information:\na. [Domain Name] GOOGLE.CO.JP\ng. [Organization] Google Japan\nl. [Organization Type] corporation\nm. [Administrative Contact] DL152JP\nn. [Technical Contact] TW124137JP\np. [Name Server] ns1.google.com\np. [Name Server] ns2.google.com\np. [Name Server] ns3.google.com\np. [Name Server] ns4.google.com\ns. [Signing Key] \n[State] Connected (2015/03/31)\n[Registered Date] 2001/03/22\n[Connected Date] 2001/03/22\n[Last Update] 2014/04/01 01:18:23 (JST)\n\n\n"]} \ No newline at end of file diff --git a/test/target_default/nttpc.co.jp b/test/target_default/nttpc.co.jp new file mode 100644 index 0000000..b0a20a7 --- /dev/null +++ b/test/target_default/nttpc.co.jp @@ -0,0 +1 @@ +{"status": ["Connected (2015/03/31)"], "updated_date": ["2014-04-01T01:10:41"], "nameservers": ["ns1.sphere.ad.jp", "ns2.sphere.ad.jp"], "contacts": {"admin": {"handle": "TY4708JP"}, "tech": {"handle": "YA6489JP"}, "registrant": {"organization": "NTT PC Communications Incorporated"}, "billing": null}, "raw": ["[ JPRS database provides information on network administration. Its use is ]\n[ restricted to network administration purposes. For further information, ]\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\n[ ]\n[ Notice -------------------------------------------------------------------- ]\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\n[ following two points on January 18, 2015. ]\n[ ]\n[ 1) Change of the format of response about gTLD domain name ]\n[ 2) Change of the character encoding ]\n[ ]\n[ For further information, please see the following webpage. ]\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\n[ --------------------------------------------------------------------------- ]\n\nDomain Information:\na. [Domain Name] NTTPC.CO.JP\ng. [Organization] NTT PC Communications Incorporated\nl. [Organization Type] Corporation\nm. [Administrative Contact] TY4708JP\nn. [Technical Contact] YA6489JP\np. [Name Server] ns1.sphere.ad.jp\np. [Name Server] ns2.sphere.ad.jp\ns. [Signing Key] \n[State] Connected (2015/03/31)\n[Registered Date] \n[Connected Date] \n[Last Update] 2014/04/01 01:10:41 (JST)\n\n\n"]} \ No newline at end of file diff --git a/test/target_normalized/google.co.jp b/test/target_normalized/google.co.jp new file mode 100644 index 0000000..27488c9 --- /dev/null +++ b/test/target_normalized/google.co.jp @@ -0,0 +1 @@ +{"status": ["Connected (2015/03/31)"], "updated_date": ["2014-04-01T01:18:23"], "contacts": {"admin": {"handle": "DL152JP"}, "tech": {"handle": "TW124137JP"}, "registrant": {"organization": "Google Japan"}, "billing": null}, "nameservers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"], "creation_date": ["2001-03-22T00:00:00"], "raw": ["[ JPRS database provides information on network administration. Its use is ]\n[ restricted to network administration purposes. For further information, ]\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\n[ ]\n[ Notice -------------------------------------------------------------------- ]\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\n[ following two points on January 18, 2015. ]\n[ ]\n[ 1) Change of the format of response about gTLD domain name ]\n[ 2) Change of the character encoding ]\n[ ]\n[ For further information, please see the following webpage. ]\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\n[ --------------------------------------------------------------------------- ]\n\nDomain Information:\na. [Domain Name] GOOGLE.CO.JP\ng. [Organization] Google Japan\nl. [Organization Type] corporation\nm. [Administrative Contact] DL152JP\nn. [Technical Contact] TW124137JP\np. [Name Server] ns1.google.com\np. [Name Server] ns2.google.com\np. [Name Server] ns3.google.com\np. [Name Server] ns4.google.com\ns. [Signing Key] \n[State] Connected (2015/03/31)\n[Registered Date] 2001/03/22\n[Connected Date] 2001/03/22\n[Last Update] 2014/04/01 01:18:23 (JST)\n\n\n"]} \ No newline at end of file diff --git a/test/target_normalized/nttpc.co.jp b/test/target_normalized/nttpc.co.jp new file mode 100644 index 0000000..b0a20a7 --- /dev/null +++ b/test/target_normalized/nttpc.co.jp @@ -0,0 +1 @@ +{"status": ["Connected (2015/03/31)"], "updated_date": ["2014-04-01T01:10:41"], "nameservers": ["ns1.sphere.ad.jp", "ns2.sphere.ad.jp"], "contacts": {"admin": {"handle": "TY4708JP"}, "tech": {"handle": "YA6489JP"}, "registrant": {"organization": "NTT PC Communications Incorporated"}, "billing": null}, "raw": ["[ JPRS database provides information on network administration. Its use is ]\n[ restricted to network administration purposes. For further information, ]\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\n[ ]\n[ Notice -------------------------------------------------------------------- ]\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\n[ following two points on January 18, 2015. ]\n[ ]\n[ 1) Change of the format of response about gTLD domain name ]\n[ 2) Change of the character encoding ]\n[ ]\n[ For further information, please see the following webpage. ]\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\n[ --------------------------------------------------------------------------- ]\n\nDomain Information:\na. [Domain Name] NTTPC.CO.JP\ng. [Organization] NTT PC Communications Incorporated\nl. [Organization Type] Corporation\nm. [Administrative Contact] TY4708JP\nn. [Technical Contact] YA6489JP\np. [Name Server] ns1.sphere.ad.jp\np. [Name Server] ns2.sphere.ad.jp\ns. [Signing Key] \n[State] Connected (2015/03/31)\n[Registered Date] \n[Connected Date] \n[Last Update] 2014/04/01 01:10:41 (JST)\n\n\n"]} \ No newline at end of file