V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
18m
V2EX  ›  Python

强力推荐一个对付运营商DNS劫持的工具,请低调使用

  •  
  •   18m · 2012-05-11 02:26:06 +08:00 · 6964 次点击
    这是一个创建于 4340 天前的主题,其中的信息可能已经有所发展或是发生改变。
    一个很简单的python脚本,监听本地DNS请求,以TCP方式去获取并返回。
    具体不多讲,聪明的你自己来领会。

    github地址
    https://github.com/henices/Tcp-DNS-proxy

    = How to use this python script ?


    1) change your dns server to 127.0.0.1
    $ vi /etc/resolve.conf
    nameserver 127.0.0.1

    2) restart the network
    $ sudo /etc/init.d/networking restart

    3) run the script
    $ sudo python tcpdns.py
    7 条回复    1970-01-01 08:00:00 +08:00
    kojp
        1
    kojp  
       2012-05-11 02:46:38 +08:00
    哈哈,仔细看了一下。终于有我能看懂的代码了。。呵呵。
    gDD
        2
    gDD  
       2012-05-11 08:21:20 +08:00
    楼主写的?加个License吧。
    est
        3
    est  
       2012-05-11 08:36:51 +08:00
    tcp解析效率不行。要做一个cache才好用。
    eerie
        4
    eerie  
       2012-05-11 08:48:02 +08:00
    114dns就挺好用的,感觉做这个没什么必要啊,特别是海外的那几个dns访问速度比较慢
    不过精神上支持下

    另外看到个
    print '>> Please wait program init....'
    print '>> Init finished!'
    print '>> Now you can set dns server to 127.0.0.1'
    这个好蛋疼啊.......
    18m
        5
    18m  
    OP
       2012-05-11 09:51:43 +08:00
    抱歉我没有讲清楚。
    这是在github上翻到的,经过试用不错,所以拿来分享。不是我的创造,不敢造次。
    meteor
        6
    meteor  
       2012-05-11 09:53:59 +08:00
    OpenDNS的这个也是可以的.
    Linux,Mac,Windows版皆有.
    https://github.com/opendns/dnscrypt-proxy
    18m
        7
    18m  
    OP
       2012-05-11 09:56:55 +08:00
    @est 能介绍一下为什么效率不行么? 我不是很懂这方面。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   963 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:35 · PVG 04:35 · LAX 13:35 · JFK 16:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.