[发布]一个DNS代理,支持TCP协议,支持内网私有DNS - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
linkerlin

[发布]一个DNS代理,支持TCP协议,支持内网私有DNS

  •  1
     
  •   linkerlin Jun 13, 2013 13680 views
    This topic created in 4711 days ago, the information mentioned may be changed or developed.
    BlackHolePy 一个支持TCP和白名单的DNS代理服务器

    https://github.com/linkerlin/BlackHolePy

    BlackHolePy
    ===========


    BlackHolePy是一个迷你型的DNS(代理)服务器。
    它的主要特色:
    1) 支持TCP DNS并支持白名单,从而在防止DNS污染的同时支持了内部私有域名解析。
    如果你的企业或组织在内部架设了自己的DNS Server,那么可以配置 config.py 里面的 WHITE_DNSS 。
    2) 内置了Cache, 带给你飞一般的感觉。尤其是访问国外网站的时候。





    行需求
    ===========
    Python 2.7 或者 PyPy 2.0.2
    如果能安装 GEvent 和 dnspython 那就最好了。不装也能跑。
    安装GEvent以后,BlackHolePy运行在单线程模式,快捷并节约系统资源。
    在 PyPy 2.0.2 下测试通过。但是PyPy的coroutine暂时还没有支持。


    运行
    ===========
    sudo python dnsproxy.py


    然后把你的DNS服务器配置到 127.0.0.1 即可。


    感谢
    ===========
    本项目是基于以下两个项目的思路,重新编写的。
    https://github.com/henices/Tcp-DNS-proxy
    https://github.com/code4craft/blackhole
    在此感谢这两个项目的作者!
    8 replies    1970-01-01 08:00:00 +08:00
    venmos
        1
    venmos  
       Jun 15, 2013
    已经clone到一台linux server上使用,装了gevent和pythondns感觉速度还不错,没装前有点慢。
    暂时没什么问题,good job
    fqrouter2
        2
    fqrouter2  
       Jun 15, 2013
    也许楼主的需求不是为了翻墙,但是与我为了anti-GFW做的fqdns很像: https://github.com/fqrouter/fqdns
    fqdns的目标是最快速度拿到没有被污染的解析结果,而且解析出来的IP还最好是最佳的线路。
    Ellonia
        3
    Ellonia  
       Jun 16, 2013
    这是不是一个简化版的dnsmasq?
    wowo2088
        4
    wowo2088  
       Jun 16, 2013
    明天试一试~~
    wowo2088
        5
    wowo2088  
       Jun 17, 2013
    cannot find dnspython
    cannot find gevent
    cannot find dnspython
    >> Please wait program init....
    >> Init finished!
    >> Now you can set dns server to 127.0.0.1
    listening at: ('0.0.0.0', 53)

    这个状态是正常的么~~~
    cannot find dnspython
    cannot find gevent
    cannot find dnspython
    这三行不碍事吧~
    dnser
        6
    dnser  
       Jun 17, 2013
    和DNSCrpyt有什么区别?
    linkerlin
        7
    linkerlin  
    OP
       Jul 7, 2013
    出现没有gevent提示的,可以装一下gevent。
    虽然稍微有些麻烦。
    不装也能跑,但是不是很快了。
    pythonee
        8
    pythonee  
       Sep 15, 2013
    能先说为什么需要dns代理吗,我是小白
    About     Help     Advertise     Blog     API     FAQ     Solana     2926 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 67ms UTC 15:28 PVG 23:28 LAX 08:28 JFK 11:28
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86