Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcpdns没有成功过 #55

Closed
ekenchan opened this issue Oct 16, 2016 · 10 comments
Closed

tcpdns没有成功过 #55

ekenchan opened this issue Oct 16, 2016 · 10 comments

Comments

@ekenchan
Copy link

配置tcpdns之后,用dig测试请求总是报malformed DNS request,用nslookup测试总是报errno(150), what: READING|0|0|0|TIMEOUT|0|0x0: Operation now in progress,太难用了

@semigodking
Copy link
Owner

你用的是哪个版本的? malformed的问题最新版应该是修复了的。 TImeout这个应该是真的超时的。TCP DNS
在国内确实不好用。建议试试新轮子 cdns ,好用很多,如果你不是很霉的话。

2016年10月16日 12:33,"ekenchan" notifications@github.com写道:

配置tcpdns之后,用dig测试请求总是报malformed DNS request,用nslookup测试总是报errno(150),
what: READING|0|0|0|TIMEOUT|0|0x0: Operation now in progress,太难用了


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#55, or mute the thread
https://github.com/notifications/unsubscribe-auth/AB-rj0OqVV49A8l_maeZEfOcy6WSPMtBks5q0akhgaJpZM4KX4w3
.

@ekenchan
Copy link
Author

@semigodking release-0.65

@semigodking
Copy link
Owner

这个版本号看不出来,已经很长时间没升级版本号了,是该考虑升一下了。要用最新版。

2016年10月16日 15:30,"ekenchan" notifications@github.com写道:

@semigodking https://github.com/semigodking release-0.65


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#55 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB-rj_wh2JU_VFN4-REH5JFPiz_W3BP_ks5q0dKFgaJpZM4KX4w3
.

@ekenchan
Copy link
Author

我在本地用git clone拿了最新版,编译之后用4个8作为tcpdns上游,dig还是返回malformed DNS request,用nslookup是报drop request。但是本地直接用dig @8.8.8.8 +tcp是有正确结果的

@semigodking
Copy link
Owner

什么平台?能抓点包和log给我看看不?如果你只是想解决问题的话,把tcpdns.c 的304到307行的条件直接改成
if (1) 即可。这条件检查其实意义不大。

2016年10月16日 18:35,"ekenchan" notifications@github.com写道:

我在本地用git clone拿了最新版,编译之后用4个8作为tcpdns上游,dig还是返回malformed DNS
request,用nslookup是报drop request。但是本地直接用dig @8.8.8.8 +tcp是有正确结果的


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#55 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB-rjx2NhlkNgYFamAA6NWAGKsziuOcJks5q0f3bgaJpZM4KX4w3
.

@ekenchan
Copy link
Author

我在cygwin下编译的,之前在centos交叉编译了mips版也是一样

@semigodking
Copy link
Owner

semigodking commented Oct 17, 2016

刚试了一下,没有问题啊。x86 centos

`[abc@default redsocks2]$ cat tcpdns.conf
base {
log_debug = on;
log_info = on;
daemon = off;
redirector= iptables;
}
tcpdns {
local_ip = 127.0.0.1; // Local server to act as DNS server
local_port = 1053; // UDP port to receive UDP DNS requests
tcpdns2 = 8.8.8.8; // DNS server that supports TCP DNS requests
timeout = 4; // Timeout value for TCP DNS requests
}

[abc@default redsocks2]$ ./redsocks2 -c tcpdns.conf &
[1] 13820
[abc@default redsocks2]$ 1476673054.611729 tcpdns.c:476 tcpdns_init_instance(...) tcpdns @ 127.0.0.1:1053
1476673054.611758 main.c:229 main(...) redsocks started with: epoll

[abc@default redsocks2]$
[abc@default redsocks2]$ dig facebook.com @127.0.0.1 -p 1053
1476673063.448111 tcpdns.c:223 choose_tcpdns(...) Dealy of TCP DNS resolvers: 0, 0
1476673063.462420 tcpdns.c:108 tcpdns_readcb(...) [127.0.0.1:50069->127.0.0.1:1053]: response size: 48
1476673063.462474 tcpdns.c:78 tcpdns_drop_request(...) [127.0.0.1:50069->127.0.0.1:1053]: dropping request @ state: 2

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.2 <<>> facebook.com @127.0.0.1 -p 1053
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29351
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;facebook.com. IN A

;; ANSWER SECTION:
facebook.com. 28 IN A 31.13.65.36

;; Query time: 14 msec
;; SERVER: 127.0.0.1#1053(127.0.0.1)
;; WHEN: Mon Oct 17 10:57:43 2016
;; MSG SIZE rcvd: 46

`

@momogentoo
Copy link

The last condition check against !req->data.header.arcount at line 307 is causing problem. Suggest to comment this line out by default.

@semigodking
Copy link
Owner

semigodking commented Dec 3, 2016 via email

@semigodking
Copy link
Owner

Fixed. Please open new issue of you still have similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants