Code Monkey home page Code Monkey logo

simpledns's Introduction

SimpleDNS

https://badge.fury.io/py/simpledns.png

A lightweight yet useful proxy DNS server designed to cope with complicated Internet environment in China, inspired by ChinaDNS , dnsmasq-chinadns and fqdns, powered by Python Twisted.

Requirement

  • Python 3.4
  • Twisted
  • Tornado for using Tornado IOLoop(optional)

Install

  • Linux/Mac OS X:

    # Clone this project
    $ sudo python setup.py install
    

Usage

Run sudo simpledns on your local machine. Then set your DNS server to 127.0.0.1.

$ dig www.twitter.com +short @127.0.0.1
twitter.com.
199.59.149.230
199.59.148.10
199.59.150.7
199.59.150.39

Note that the default cache lifetime depends on the ttl of DNS answer. You may want to set a larger ttl using --min-ttl to extend the cache lifetime.

Advanced

$ simpledns -h
usage: simpledns [-h] [-b BIND_ADDR] [-p BIND_PORT]
                 [--upstream-ip UPSTREAM_IP] [--upstream-port UPSTREAM_PORT]
                 [--query-timeout QUERY_TIMEOUT] [--min-ttl MIN_TTL]
                 [--max-ttl MAX_TTL] [--cache-size CACHE_SIZE] [-t]
                 [--hosts-file HOSTS_FILE] [--dispatch-conf DISPATCH_CONF]
                 [-v {0,1,2}] [-q] [-V]

A lightweight yet useful proxy DNS server

optional arguments:
  -h, --help            show this help message and exit
  -b BIND_ADDR, --bind-addr BIND_ADDR
                        local address to listen
  -p BIND_PORT, --bind-port BIND_PORT
                        local port to listen
  --upstream-ip UPSTREAM_IP
                        upstream DNS server ip address
  --upstream-port UPSTREAM_PORT
                        upstream DNS server port
  --query-timeout QUERY_TIMEOUT
                        time before close port used for querying
  --min-ttl MIN_TTL     the minimum time a record is held in cache
  --max-ttl MAX_TTL     the maximum time a record is held in cache
  --cache-size CACHE_SIZE
                        record cache size
  -t, --tcp-server      enables TCP serving
  --hosts-file HOSTS_FILE
                        hosts file
  --dispatch-conf DISPATCH_CONF
                        URL dispatch conf file
  -v {0,1,2}, --verbosity {0,1,2}
                        output verbosity
  -q, --quiet           disable output
  -V, --version         print version number and exit

Configuration

Configuration file is at /usr/local/etc/simpledns/dispatch.conf.

Dispatch conf file uses the same rule as in Dnsmasq. 'Address' and 'Server' rules are supported.

address=/example1.com/1.1.1.1
server=/example2.com/1.1.1.2

Default dispatch conf file is from dnsmasq-china-list.

Fake ip list file is at /usr/local/ect/simpledns/iplist/txt. The source is ChinaDNS.

TODO

  • Config file support
  • EDNS support
  • Negative caching

License

MIT License

simpledns's People

Contributors

skyline75489 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpledns's Issues

报错

123:~ 123$ python /Users/123/program/simpledns/simpledns/dnsproxy.py
Traceback (most recent call last):
File "/Users/123/program/simpledns/simpledns/dnsproxy.py", line 47, in
from simpledns.util import is_address_validate
ImportError: No module named simpledns.util

IOError on OS X 10.11 el capitan

Traceback (most recent call last):
  File "/usr/local/bin/simpledns", line 7, in <module>
    from simpledns.dnsproxy import main
  File "/Library/Python/2.7/site-packages/simpledns/dnsproxy.py", line 75, in <module>
    GFW_LIST = read_iplist(IPLIST_PATH)
  File "/Library/Python/2.7/site-packages/simpledns/dnsproxy.py", line 70, in read_iplist
    with open(path) as f:
IOError: [Errno 2] No such file or directory: '/usr/local/etc/simpledns/iplist.txt'

已经 sudo 权限打开了,还是找不到文件,不知道这个 iplist.txt 是否是自己生成的?
我试了一下,自己从 ChinaDNS 中复制这个文件之后,可以运行了,我觉得有必须在 Usage 中说明一下

PS,用了 simple 之后速度慢好多,所以又放弃了

Where is the fake IP list?

The fake IPs have increased more, so we want to know where is the fake IP ignore list and we can edit it manually...

泛域名无法使用

dnsmasq中有类似这样的: address=/.xxx.com/x.x.x.x ,不知SimpleDNS能否支持呢?

module 错误 macOS high sierra beta8

sudo simpledns
Traceback (most recent call last):
File "/usr/local/bin/simpledns", line 9, in
load_entry_point('simpledns==0.1.5', 'console_scripts', 'simpledns')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 2697, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 2370, in load
return self.resolve()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/init.py", line 2376, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "build/bdist.macosx-10.13-intel/egg/simpledns/dnsproxy.py", line 51, in
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/reactor.py", line 38, in
from twisted.internet import default
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/default.py", line 56, in
install = _getInstallFunction(platform)
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/default.py", line 50, in _getInstallFunction
from twisted.internet.selectreactor import install
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/selectreactor.py", line 18, in
from twisted.internet import posixbase
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/posixbase.py", line 18, in
from twisted.internet import error, udp, tcp
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/tcp.py", line 28, in
from twisted.internet._newtls import (
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/_newtls.py", line 21, in
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.13-intel.egg/twisted/internet/_sslverify.py", line 38, in
TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

有几个建议

  1. 可否增加一个自动更新 iplist.txt 功能,例如 simpledns 运行期间
  2. 可否增加一个读取自定义 txt 的功能 ( 自己解决了,看到了--hosts-file
  3. 可否增加一个配置文件,这样可以自定义监听端口,要设置的其他的参数。
  4. 默认使用的上游的 DNS是啥。。有没有办法可以自己指定更换,比如 202.141.176.93 202.141.162.123 202.38.93.153 这几个本身就可以正常解析国外的网站,要是能指定 多个上游DNS 就好了

以上 4 个需求中,功能 3 是紧急且重要的,希望可以考虑早日实现。

issue with edu.cn

hi really like your simpleDNS. Doing fine until now
I found I cannot access any website ended with edu.cn.
I added
server=/edu.cn/202..1 or
address=/edu.cn/202.
.1 (good Chinese dns)
but still don't work.
I am in the school's network.

内网好像访问不了这个DNS服务器.

在搭建了SimpleDNS的主机上, DNS使用127.0.0.1是成功的.
但是用局域网里的另一台电脑, 使用192.168.xx.xx(DNS主机的局域网ip)则是不成功的.

Reverse lookup

Lets say you have /etc/hosts

10.0.0.1 domain.tld

If you do:

$ dig -x 10.0.0.1

It should answer:

piwo:~ pathcl$ dig -x 10.0.0.1

; <<>> DiG 9.8.3-P1 <<>> -x 10.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30503
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;1.0.0.10.in-addr.arpa. IN PTR

;; ANSWER SECTION:
1.0.0.10.in-addr.arpa. 0 IN PTR domain.tld.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Jun 24 11:13:45 2017
;; MSG SIZE rcvd: 81

I know maybe its just not a feature PTR :)

偶尔出现无法解析的情况


2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 47931 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('finance.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 38608 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 13072 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('d4.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 40030 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 1821 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('ip.house.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 53575 Closed)
2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 28, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('sax.sina.com.cn', 1, 1)]

2016-02-14 01:48:22+0800 [-] (UDP Port 55027 Closed)
2016-02-14 01:48:22+0800 [-] (UDP Port 33618 Closed)
2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('idc-hq-kxc.sinajs.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] (UDP Port 41838 Closed)
2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 1, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 1, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 1, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 1, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('s.weibo.com', 1, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 28, 1)]

2016-02-14 01:48:23+0800 [-] (UDP Port 12016 Closed)
2016-02-14 01:48:23+0800 [-] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.internet.defer.TimeoutError: [Query('open.weather.sina.com.cn', 1, 1)]

通常这不需要我做什么,过一小会就会好了。

Not happy on 3.6.1, 3.5.2

espresso:SimpleDNS pathcl$ sudo simpledns --hosts-file /etc/hosts --upstream-ip 8.8.8.8 -v 2
2017-06-21 13:59:04-0400 [-] Log opened.
2017-06-21 13:59:04-0400 [-] Listening on 127.0.0.1:53
2017-06-21 13:59:04-0400 [-] Using 8.8.8.8:53 as upstream server
2017-06-21 13:59:04-0400 [-] Updating local cache
2017-06-21 13:59:04-0400 [-] DNSDatagramProtocol starting on 53
2017-06-21 13:59:04-0400 [-] Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x1042697f0>
2017-06-21 13:59:04-0400 [-] Using Tornado ioloop
2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] query from ('127.0.0.1', 65294)
2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] Cache miss for b'google.cl'
2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 310, in addCallbacks
self._runCallbacks()
File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/local/lib/python3.6/site-packages/twisted/names/resolve.py", line 30, in call
return self.resolver(self.query, self.timeout)
File "/usr/local/lib/python3.6/site-packages/twisted/names/common.py", line 73, in query
return defer.maybeDeferred(method, query.name.name, timeout)
--- ---
File "/usr/local/lib/python3.6/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/usr/local/lib/python3.6/site-packages/simpledns-0.1.5-py3.6.egg/simpledns/dnsproxy.py", line 245, in lookupAddress

  File "/usr/local/lib/python3.6/site-packages/simpledns-0.1.5-py3.6.egg/simpledns/dnsproxy.py", line 224, in _matchAddress

builtins.TypeError: a bytes-like object is required, not 'str'

2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] Replying with no answers
2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] Processed query in 0.002 seconds
2017-06-21 13:59:07-0400 [DNSDatagramProtocol (UDP)] Lookup failed
^C2017-06-21 13:59:14-0400 [-] Exiting
espresso:SimpleDNS pathcl$ python3
Python 3.6.1 (default, Apr 4 2017, 09:40:51)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

OS : OSX Capitan

How to make this work with IPv6?

We are all from CERNET2 with IPv6, and we rented a VPS @ Zhengzhou GIANT (景安), which provides IPv6 network.
How to make this works with both IPv4 and IPv6?
-b 0.0.0.0 —— V4 only...
-b :: —— it won't crash, but cannot nslookup
-b [::] —— crash...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.