Giter Site home page Giter Site logo

cherrot / gochinadns Goto Github PK

View Code? Open in Web Editor NEW
38.0 5.0 6.0 114 KB

A drop-in replacement for ChinaDNS, with some additional features. NOTICE: This project is not under active development: I believe Clash has provided a more elegant DNS & proxy solution. So there is no need to maintain this project. Have fun guys!

License: MIT License

Go 100.00%
chinadns dns-server dns-over-https dns-proxy

gochinadns's People

Contributors

beanslel avatar cherrot 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

Watchers

 avatar  avatar  avatar  avatar  avatar

gochinadns's Issues

can't start listen

Linux asus 2.6.36.4brcmarm #1 SMP PREEMPT Wed Dec 19 07:47:43 CET 2018 armv7l GNU/Linux

$ ./chinadns -p 54 -v
INFO[0000] 193.112.15.186:2323: average RTT 9.900583ms with 0 errors.
INFO[0000] 119.29.29.29:53: average RTT 37.194065ms with 0 errors.
INFO[0000] 114.114.114.114:53: average RTT 33.271687ms with 0 errors.
INFO[0000] Refined trusted resolvers: [193.112.15.186:2323]
INFO[0000] Refined untrusted resolvers: [114.114.114.114:53 119.29.29.29:53]
INFO[0000] Start server at [::]:54
panic: listen udp 0.0.0.0:54: protocol not available

goroutine 1 [running]:
main.main()

$ ./chinadns -p 5053 -v
INFO[0000] 193.112.15.186:2323: average RTT 9.752631ms with 0 errors.
INFO[0000] 119.29.29.29:53: average RTT 36.254511ms with 0 errors.
INFO[0000] 114.114.114.114:53: average RTT 33.997863ms with 0 errors.
INFO[0000] Refined trusted resolvers: [193.112.15.186:2323]
INFO[0000] Refined untrusted resolvers: [114.114.114.114:53 119.29.29.29:53]
INFO[0000] Start server at [::]:5053
panic: listen tcp 0.0.0.0:5053: protocol not available

goroutine 1 [running]:
main.main()
/mnt/data/compile/go/src/github.com/cherrot/gochinadns/cmd/chinadns/main.go:119 +0x704

运行一天后崩溃

运行参数:
chinadns -c /etc/tinc/conf/china.txt -s 114.114.114.114 -trusted-servers 8.8.8.8

目前只有堆栈打印

time="2019-06-09T00:33:32+08:00" level=error msg="Fail to send UDP query. Will retry in TCP." error="read udp 192.168.192.210:38595->8.8.8.8:53: i/o timeout" question="www.gstatic.com. A" server="8.8.8.8:53"
time="2019-06-09T00:33:33+08:00" level=error msg="Fail to send TCP query." error="dial tcp 8.8.8.8:53: i/o timeout" question="www.gstatic.com. A" server="8.8.8.8:53"
time="2019-06-09T00:33:33+08:00" level=error msg="Error hanppens." error="0: dial tcp 8.8.8.8:53: i/o timeout" question="www.gstatic.com. A"
time="2019-06-09T00:33:34+08:00" level=error msg="Fail to send UDP query. Will retry in TCP." error="read udp 192.168.192.210:38650->8.8.8.8:53: i/o timeout" question="init.itunes.apple.com. A" server="8.8.8.8:53"
time="2019-06-09T00:33:35+08:00" level=error msg="Fail to send UDP query. Will retry in TCP." error="read udp 192.168.192.210:35226->8.8.8.8:53: i/o timeout" question="xp.apple.com. A" server="8.8.8.8:53"
time="2019-06-09T00:33:35+08:00" level=error msg="Fail to send UDP query. Will retry in TCP." error="read udp 192.168.192.210:60947->8.8.8.8:53: i/o timeout" question="itunes.apple.com. A" server="8.8.8.8:53"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x61a2c0]

goroutine 131600 [running]:
github.com/miekg/dns.(*Msg).SetEdns0(...)
        C:/Users/Admin/go/pkg/mod/github.com/miekg/[email protected]/defaults.go:130
github.com/cherrot/gochinadns.setUDPSize(0xc0006c0900, 0x582, 0x69e45a)
        C:/Users/Admin/Desktop/gochinadns-master/lookup.go:183 +0xf0
github.com/cherrot/gochinadns.(*Server).Lookup(0xc000383fb0, 0xc0006c0900, 0xc000012344, 0xa, 0x0, 0x0, 0x0, 0x0)
        C:/Users/Admin/Desktop/gochinadns-master/lookup.go:81 +0x433
github.com/cherrot/gochinadns.(*Server).Lookup-fm(0xc0006c0900, 0xc000012344, 0xa, 0x645d20, 0xc0004f7e20, 0xc0006fed20, 0x25)
        C:/Users/Admin/Desktop/gochinadns-master/dns.go:43 +0x48
github.com/cherrot/gochinadns.lookupInServers.func1(0x0, 0xc000012344, 0xa)
        C:/Users/Admin/Desktop/gochinadns-master/lookup.go:34 +0x14b
created by github.com/cherrot/gochinadns.lookupInServers
        C:/Users/Admin/Desktop/gochinadns-master/lookup.go:56 +0x538
"./root/chinadns-1.3.2/nohup.out" 3261L, 586365C                                

DomainPolluted 无法匹配到

DomainPolluted 无法匹配到,暂时删除最后一个点。。

if !s.DomainPolluted.Contain(strings.TrimRight(qName, ".") ) {

pointer mutation已失效

很有趣,似乎dig google.com没有问题,但www.google.com, twitter, facebook统统中招。所以最开始没有发现这个方法已经失效的事实。。

解决思路:

  1. 换用非常见IP、非标准端口的上游DNS服务
  2. 代理DNS请求
  3. 支持更多DNS扩展协议,支持单独设置每个上游DNS解析服务器使用的协议。

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.