spin6lock/pydnsproxy

我的isp拦截了外部dns服务器的返回数据,你这个东西没用啊

Closed this issue · 3 comments

我的isp拦截了外部dns服务器的返回数据,你这个东西没用啊

Original issue reported on code.google.com by ggc...@gmail.com on 1 Dec 2010 at 1:30

已添加tcp方式获取dns,可以试试

Original comment by john...@gmail.com on 19 Nov 2011 at 4:11

  • Changed state: Fixed
请问怎么使用tcp方式呢?

Original comment by ggc...@gmail.com on 23 Nov 2011 at 1:22

开启dns.py,我安装了python 
2.7环境,修改网卡dns为127.0.0.1,进入nslookup,查询如下:
C:\Users\ggcall>nslookup
DNS request timed out.
    timeout was 2 seconds.
默认服务器:  UnKnown
Address:  127.0.0.1

> www.sina.com
服务器:  UnKnown
Address:  127.0.0.1

DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
*** 请求 UnKnown 超时

dns.py错误如下:
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 54994)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\SocketServer.py", line 639, in __init__
    self.handle()
  File "E:\web\pydnsproxy\dns.py", line 40, in handle
    resp = self.query_with_no_match(data)
  File "E:\web\pydnsproxy\dns.py", line 82, in get_response_normal
    return resp
UnboundLocalError: local variable 'resp' referenced before assignment
----------------------------------------

请问是什么问题?

Original comment by ggc...@gmail.com on 14 Jan 2012 at 1:10