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

Chinadns does not use upstream dns server of internal IP #121

Open
bingzhangdai opened this issue Jan 25, 2024 · 0 comments
Open

Chinadns does not use upstream dns server of internal IP #121

bingzhangdai opened this issue Jan 25, 2024 · 0 comments

Comments

@bingzhangdai
Copy link

First, I have an ISP provided DNS 192.168.1.1

root@OpenWrt:~# dig -p 53 @192.168.1.1 hmajax.itheima.net

; <<>> DiG 9.14.12 <<>> -p 53 @192.168.1.1 hmajax.itheima.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20761
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;hmajax.itheima.net.            IN      A

;; ANSWER SECTION:
hmajax.itheima.net.     30      IN      CNAME   ajiuktqsgom3gahaiqbshcuc8in7d4d6.yundunwaf2.com.
ajiuktqsgom3gahaiqbshcuc8in7d4d6.yundunwaf2.com. 30 IN A 223.5.179.239

;; Query time: 5 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Thu Jan 25 13:28:27 HKT 2024
;; MSG SIZE  rcvd: 124

I also have a dns forwarder

root@OpenWrt:~# dig -p 5300 @127.0.0.1 hmajax.itheima.net

; <<>> DiG 9.14.12 <<>> -p 5300 @127.0.0.1 hmajax.itheima.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3963
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1224
;; QUESTION SECTION:
;hmajax.itheima.net.            IN      A

;; ANSWER SECTION:
hmajax.itheima.net.     600     IN      CNAME   ajiuktqsgom3gahaiqbshcuc8in7d4d6.yundunwaf2.com.
ajiuktqsgom3gahaiqbshcuc8in7d4d6.yundunwaf2.com. 300 IN A 223.5.179.239

;; Query time: 346 msec
;; SERVER: 127.0.0.1#5300(127.0.0.1)
;; WHEN: Thu Jan 25 13:31:34 HKT 2024
;; MSG SIZE  rcvd: 124

If I set up the china dns using 114.114.114.114 and 127.0.0.1:5300, everything works fine

root@OpenWrt:/e/dnsmasq.d# /usr/bin/chinadns -m -b 0.0.0.0 -p 5355 -s 114.114.114.114,127.0.0.1#5300 -c /etc/chinadns_chnroute.txt -v -d
Thu Jan 25 13:26:40 2024 request hmajax.itheima.net from 114.114.114.114:53 127.0.0.1:5300
Thu Jan 25 13:26:40 2024 response hmajax.itheima.net from 114.114.114.114:53 - 223.5.179.239, pass
Thu Jan 25 13:26:40 2024 response hmajax.itheima.net from 127.0.0.1:5300 - 223.5.179.239, filter

If I use 192.168.1.1 and 127.0.0.1:5300, chinadns does not query 192.168.1.1

root@OpenWrt:/e/dnsmasq.d# /usr/bin/chinadns -m -b 0.0.0.0 -p 5355 -s 192.168.1.1,127.0.0.1#5300 -c /etc/chinadns_chnroute.txt -v -d
Thu Jan 25 13:26:00 2024 request hmajax.itheima.net from 127.0.0.1:5300
Thu Jan 25 13:26:01 2024 response hmajax.itheima.net from 127.0.0.1:5300 - 223.5.179.239, filter
Thu Jan 25 13:26:05 2024 request hmajax.itheima.net from 127.0.0.1:5300
Thu Jan 25 13:26:06 2024 response hmajax.itheima.net from 127.0.0.1:5300 - 223.5.179.239, filter
Thu Jan 25 13:26:10 2024 request hmajax.itheima.net from 127.0.0.1:5300
Thu Jan 25 13:26:11 2024 response hmajax.itheima.net from 127.0.0.1:5300 - 223.5.179.239, filter
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

1 participant