Revision 1534e9c2
b/settings.py.dist | ||
---|---|---|
201 | 201 |
"args": (), |
202 | 202 |
}, |
203 | 203 |
} |
204 |
|
|
204 |
# whois |
|
205 |
PRIMARY_WHOIS = 'whois.grnet.gr' |
|
206 |
ALTERNATE_WHOIS = 'whois.ripe.net' |
|
205 | 207 |
|
206 | 208 |
ACCOUNT_ACTIVATION_DAYS = 7 |
b/utils/whois.py | ||
---|---|---|
1 | 1 |
import socket |
2 | 2 |
from ipaddr import * |
3 | 3 |
import re |
4 |
|
|
5 |
RIPEWHOIS = 'whois.ripe.net' |
|
6 |
GRNETWHOIS = 'whois.grnet.gr' |
|
4 |
import settings |
|
7 | 5 |
|
8 | 6 |
def query(query, hostname, flags): |
9 | 7 |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
... | ... | |
38 | 36 |
return final_routes |
39 | 37 |
|
40 | 38 |
def whois(queryas): |
41 |
routes = query(queryas,GRNETWHOIS, None)
|
|
39 |
routes = query(queryas,settings.PRIMARY_WHOIS, None)
|
|
42 | 40 |
if not routes: |
43 |
routes = query(queryas,RIPEWHOIS, None)
|
|
41 |
routes = query(queryas,settings.ALTERNATE_WHOIS, None)
|
|
44 | 42 |
return routes |
Also available in: Unified diff