shadowsocks / ChinaDNS

Protect yourself against DNS poisoning in China.
GNU General Public License v3.0
3.6k stars 1.29k forks source link

The problem of ChinaDNS port? #76

Open hduffddybz opened 9 years ago

hduffddybz commented 9 years ago

I have a lot of websites to resolve in the internal network, but I have encountered a problem, the setting of ChinaDNS listed below: dns The setting of DNSmasq are listed: dns2

I also set "Ignore resolve file".

and when I am using the dig command to debug it, it get me confused that: 1 2

But the result of resolving Google, facebook and Youtube seems all correct. how to fix it?

hduffddybz commented 9 years ago

I get more confusion about it! OpenWrt:"/usr/bin/chinadns -s 114.114.114.114,107...: -p 5353 -c /etc/chinadns_chnroute.txt -l /etc/chinadns_iplist.txt -y 0.3 -v" Win7 PC:"dig @192.168.1.1 cwc.hdu.edu.cn" Result: 1 2

cpktpoetkxwz commented 9 years ago

Add private ip address to your chnroute file

hduffddybz commented 9 years ago

@Pentiumluyu Why have to change the chnroute file? It seems that chnroute.txt file was used to distinguish the process of website resolving that whether to direct to abroad.

cpktpoetkxwz commented 9 years ago

Since those private IP addresses are not in the chnroute file, they would be treated as foreign ip addresses. Therefore, when a answer contains private IP, chinadns will wait for the designated foreign DNS servers to reply.

aa65535 commented 9 years ago

Current Version: 1.3.0

hduffddybz commented 9 years ago

Hi!Thanks all of your patient reply! @Pentiumluyu the ip address which should be resolved is from 192.168.0.0 to 192.168.255.255, so what I should add is "192.168.0.0/16" is it right?But it did not change anything.

(It is another problem) @aa65535 And now I change the version to 1.3.0 and seems it did not change anything! And one more problem is that when I do the process below: 1) opkg remove ChinaDNS 2) opkg install chinadns and the display of chinadns is gone! I try many times of the process "opkg remove luci-app-chinadns" and "opkg install luci-app-chinadns".But it did not take effect. How to deal with this strange problem!

hduffddybz commented 9 years ago

It is not stable to resolve the internal ip address

hduffddybz commented 9 years ago

It is not stable!Sometimes it is really hard to open the internal network!

cpktpoetkxwz commented 9 years ago

@hduffddybz Can you post the verbose logs after adding "192.168.0.0/16" to your chnroute file?

hduffddybz commented 9 years ago

Hi!

; <<>> DiG 9.10.1-P1 <<>> @192.168.1.1 cwc.hdu.edu.cn +trace ; (1 server found) ;; global options: +cmd . 419121 IN NS i.root-servers.net. . 419121 IN NS e.root-servers.net. . 419121 IN NS d.root-servers.net. . 419121 IN NS j.root-servers.net. . 419121 IN NS h.root-servers.net. . 419121 IN NS m.root-servers.net. . 419121 IN NS g.root-servers.net. . 419121 IN NS l.root-servers.net. . 419121 IN NS k.root-servers.net. . 419121 IN NS b.root-servers.net. . 419121 IN NS a.root-servers.net. . 419121 IN NS f.root-servers.net. . 419121 IN NS c.root-servers.net. ;; Received 239 bytes from 192.168.1.1#53(192.168.1.1) in 23 ms

cwc.hdu.edu.cn. 234 IN A 192.168.100.6 ;; Received 59 bytes from 192.36.148.17#53(i.root-servers.net) in 344 ms

cpktpoetkxwz commented 9 years ago

I mean logs of chinadns.

hduffddybz commented 9 years ago

In the file /tmp/log/chinadns.err.log, it get the message: Fri Mar 13 05:12:12 2015 chinadns.c:577 ns_initparse: Message too long for many times.

cpktpoetkxwz commented 9 years ago

That error occurs when you enable pointer compression mutation, which doesn't affect the resolving process. Run chinadns with option "-v" manually to get verbose logs.

hduffddybz commented 9 years ago

OK!The logs list: Fri Mar 13 05:32:45 2015 request cwc.hdu.edu.cn Fri Mar 13 05:32:45 2015 response cwc.hdu.edu.cn from 114.114.114.114:53 - 192.168.100.6, delay Fri Mar 13 05:32:45 2015 response cwc.hdu.edu.cn from 107.170..:(foreign DNS) - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 request cwc.hdu.edu.cn Fri Mar 13 05:32:48 2015 request cwc.hdu.edu.cn Fri Mar 13 05:32:48 2015 request cwc.hdu.edu.cn Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 114.114.114.114:53 - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 114.114.114.114:53 - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 114.114.114.114:53 - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 107.170..: - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 107.170.:* - 192.168.100.6, delay Fri Mar 13 05:32:48 2015 response cwc.hdu.edu.cn from 107.170..:* - 192.168.100.6, delay Fri Mar 13 05:32:56 2015 request cwc.hdu.edu.cn Fri Mar 13 05:32:56 2015 response cwc.hdu.edu.cn from 114.114.114.114:53 - 192.168.100.6, delay Fri Mar 13 05:32:56 2015 response cwc.hdu.edu.cn from 107.170..:* - 192.168.100.6, delay

cpktpoetkxwz commented 9 years ago

It seems adding private ip addresses doesn't work. Is the path corrected? I'll try this method tonight.

hduffddybz commented 9 years ago

But using the command "dig @192.168.1.1 cwc.hdu.edu.cn" to resolve the website and the result of it is correct!(Compare to the other router that can access "cwc.hdu.edu.cn")

cpktpoetkxwz commented 9 years ago

Before adding 192.168.0.0/16 to chnroute.txt. screen shot 2015-03-13 at 7 11 56 pm Chinadns treated 192.168.100.6 as a foreign ip address, it would wait for foreign dns to reply.

After adding 192.168.0.0/16 to chnroute.txt screen shot 2015-03-13 at 7 12 37 pm 192.168.100.6 was recognised as a Chinese ip address, and chinadns would less it pass. (I used the "-d" option and "-m" option to enable bidirectional filtering and dns compression mutation respectively.)

I think there was something wrong with your dnsmasq's configuration. It seems that the requests were not forwarded to chinadns.

hduffddybz commented 9 years ago

You can see the output list below: 1 really strange!

cpktpoetkxwz commented 9 years ago

I think that's the same problem as #56.