
一个用 Go 写的 HttpDns 服务, 为了抵抗运营商邪恶的 DNS 劫持污染,并带有缓存功能 。
cd $GOPATH; git clone http://github.com/zheng-ji/goHttpDns; cd src; make # redis connect config redis: host: 127.0.0.1:6379 db: 0 # seelog config log_config: ../etc/logger.xml # ip & port & answer cache TTL listen: 0.0.0.0 port: 9999 ttl: 100 # DnsServer lists dnsservers: - 202.96.128.86 - 202.96.128.166 - 8.8.8.8 - 8.8.4.4 执行 make操作后,在bin目录下就会生成 可执行文件 httpDns
zj@zheng-ji:$ ./httpDns --help Usage of ./httpDns: -c="../etc/conf.yml": conf file , default is ../etc/conf.yml ./httpDns -c="your_conf_yaml_path" You can also use supervisor to start your sever $ curl http://127.0.0.1:9999/d?url=http://zheng-ji.info Resp: { "c":0, "targetip":"http://106.185.48.24", "host":"zheng-ji.info", "msg":"" } Thanks to:
* [launchpad/goyaml]( https://launchpad.net/goyaml ) * [cihub/seelog](github.com/cihub/seelog ) * [miekg/dns](github.com/miekg/dns ) * [redisgo/redis](github.com/garyburd/redigo/redis") * [hoisie/web](github.com/hoisie/web ) 我们需要go get 以上包
1 aspirin2d 2015-08-22 14:15:17 +08:00 via iPhone 超赞!回家就去 star |
2 invite 2015-08-22 16:56:04 +08:00 url=http://zheng-ji.info "targetip":"http://106.185.48.24", 参数是 URL ? 这样做是怎么考虑?难道 DNS 还得看 HTTP 还是 TCP 还是 UDP ? |
3 zhengji OP @invite 其实是为了获取该域名的真正 IP ,背景是这样的, http://www.zmke.com/i/8705.html |
5 kofj 2015-08-22 18:55:53 +08:00 先关注 |
6 ivmm 2015-08-22 19:00:34 +08:00 火钳留名,拿去玩了 |
7 rrfeng 2015-08-22 19:39:45 +08:00 这个首先要有超级稳定可靠的 httpDNS server 如果没有就十分鸡肋…… |
8 onlyice 2015-08-22 22:52:33 +08:00 via iPad 但是远程服务器解析出来的结果不一定是最优的吧?适用的场景是什么呢 |
9 twitterpig 2015-08-22 23:19:15 +08:00 via Android 可惜不会!!!感谢! |
10 zhengji OP |
11 hdcola 2015-08-24 08:03:14 +08:00 http 的加入确实多余了, dns 时只看域名,与协议无关,不过楼主做的不错,支持 |
12 a2ex 2015-08-24 15:38:30 +08:00 甄姬 |
13 RainSlide 2015-08-25 15:24:47 +08:00 做 exe 吗 一文件夹杂碎我们也要 |