127 if b'with "=xxx"' in response: |
127 if b'with "=xxx"' in response: |
128 return self.whois(query, hostname, flags, True) |
128 return self.whois(query, hostname, flags, True) |
129 if flags & NICClient.WHOIS_RECURSE and nhost is None: |
129 if flags & NICClient.WHOIS_RECURSE and nhost is None: |
130 nhost = self.findwhois_server(response.decode(), hostname, query) |
130 nhost = self.findwhois_server(response.decode(), hostname, query) |
131 if nhost is not None: |
131 if nhost is not None: |
132 response += self.whois(query, nhost, 0) |
132 response += self.whois(query, nhost, 0).encode('utf-8') |
133 return response.decode() |
133 return response.decode() |
134 |
134 |
135 def choose_server(self, domain): |
135 def choose_server(self, domain): |
136 """Choose initial lookup NIC host""" |
136 """Choose initial lookup NIC host""" |
|
137 print('domain:', domain) |
137 if type(domain) is not str: |
138 if type(domain) is not str: |
138 domain = domain.decode('utf-8').encode('idna').decode('utf-8') |
139 domain = domain.decode('utf-8').encode('idna').decode('utf-8') |
139 if domain.endswith("-NORID"): |
140 if domain.endswith("-NORID"): |
140 return NICClient.NORIDHOST |
141 return NICClient.NORIDHOST |
141 pos = domain.rfind('.') |
142 pos = domain.rfind('.') |
169 options['country'] + NICClient.QNICHOST_TAIL, |
170 options['country'] + NICClient.QNICHOST_TAIL, |
170 flags |
171 flags |
171 ) |
172 ) |
172 elif self.use_qnichost: |
173 elif self.use_qnichost: |
173 nichost = self.choose_server(query_arg) |
174 nichost = self.choose_server(query_arg) |
|
175 print('nichost:', nichost) |
174 if nichost is not None: |
176 if nichost is not None: |
175 result = self.whois(query_arg, nichost, flags) |
177 result = self.whois(query_arg, nichost, flags) |
176 else: |
178 else: |
177 result = '' |
179 result = '' |
178 else: |
180 else: |