mokeyish / smartdns-rs

A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoQ, DoH, DoH3.
GNU General Public License v3.0
588 stars 40 forks source link

我不知道smartDNS是否生效了 #350

Closed stevenlyw closed 2 months ago

stevenlyw commented 2 months ago

需求应用场景 我想知道我的smartDNS是否生效了呢 我是服务形式安装的 然后修改了C:\ProgramData\smartdns 里面的conf文件

建议的方案 实现上述场景建议的方案。

设备信息 使用环境 windows

这是日志信息 我已经把日志设置为debug了,但是比如说我使用nslookup,我还是看不到任何解析相关的日志啊,我现在分不清楚这个smartDNS是否生效了呢

2024-08-16 22:42:43.6:INFO: upstream server: https://223.5.5.5/dns-query [Group: []] 2024-08-16 22:42:43.6:INFO: upstream server: https://1.1.1.1/dns-query [Group: []] 2024-08-16 22:42:43.6:INFO: upstream server: https://8.8.8.8/dns-query [Group: []] 2024-08-16 22:42:43.6:INFO: upstream server: https://dns.alidns.com/dns-query [Group: default] 2024-08-16 22:42:43.6:INFO: upstream server: https://doh.pub/dns-query [Group: default] 2024-08-16 22:42:43.6:INFO: upstream server: https://cloudflare-dns/dns-query [Group: default] 2024-08-16 22:42:43.6:INFO: upstream server: https://dns.quad9.net/dns-query [Group: default] 2024-08-16 22:42:43.6:INFO: upstream server: https://dns.google/dns-query [Group: default] 2024-08-16 22:42:43.6:INFO: upstream server: quic://223.5.5.5 [Group: default] 2024-08-16 22:42:43.6:INFO: cache: size(32768) 2024-08-16 22:42:43.6:INFO: cache persist: NO 2024-08-16 22:42:43.6:INFO: domain prefetch: OFF 2024-08-16 22:42:43.6:INFO: speed check mode: OFF 2024-08-16 22:42:43.12:INFO: bootstrap-dns https://223.5.5.5/dns-query 2024-08-16 22:42:43.12:INFO: bootstrap-dns https://1.1.1.1/dns-query 2024-08-16 22:42:43.13:INFO: bootstrap-dns https://8.8.8.8/dns-query 2024-08-16 22:42:43.15:DEBUG:smartdns::dnsclient:198: create name server [Group: Default], servers 9 2024-08-16 22:42:43.15:DEBUG:smartdns::server::net:339: binding UDP to [::]:53 2024-08-16 22:42:43.16:INFO: listening for UDP on [::]:53 2024-08-16 22:42:43.16:INFO: 2024-08-16 22:42:43.16:INFO: ____ ____ 2024-08-16 22:42:43.16:INFO: / | | | | | \ | |/ | 2024-08-16 22:42:43.16:INFO: | ( _ | | | | | | | | ( 2024-08-16 22:42:43.16:INFO: | ' \ / | '| | | | | | . ` | \ 2024-08-16 22:42:43.16:INFO: ) | | | | | | (| | | | | | || | |\ |) | 2024-08-16 22:42:43.16:INFO: |___/|| || ||,|| | |____/|| |_____/ 2024-08-16 22:42:43.17:INFO: 2024-08-16 22:42:43.17:INFO: awaiting connections... 2024-08-16 22:42:43.17:INFO: server starting up

这是我的配置文件,其实我就加了几个server (用叹号是因为#触发了markdown语法吧应该是,样式有变化,其实配置是#) !! -bootstrap-dns: set as bootstrap dns server. !! server 8.8.8.8 -blacklist-ip -check-edns -group g1 -group g2 !! server tls://dns.google:853 !! server https://dns.google/dns-query server https://223.5.5.5/dns-query -bootstrap-dns -exclude-default-group server https://1.1.1.1/dns-query -bootstrap-dns -exclude-default-group server https://8.8.8.8/dns-query -bootstrap-dns -exclude-default-group server https://dns.alidns.com/dns-query server https://doh.pub/dns-query server https://cloudflare-dns/dns-query server https://dns.quad9.net/dns-query server https://dns.google/dns-query

使用 DoQ

server-quic 223.5.5.5

nslookup结果

C:\Users\admin>nslookup www.baidu.com 服务器: UnKnown Address: fe80::d6da

非权威应答: 名称: www.a.shifen.com Addresses: 2408:871a:2100:2:0:ff:b09f:237 2408:871a:2100:3:0:ff:b025:348d 110.242.68.4 110.242.68.3 Aliases: www.baidu.com

然后我来回lookup,这个结果也是来回的跳,,所以我感觉是没好使啊

mokeyish commented 2 months ago

你应该配置错了,debug 模式,如果又请求一定会打印的。

网卡上需要配置 DNS server 为你本机的。 image

另外,你也可以自己弄个 https 证书,然后信任这个证书,浏览器也可以查询的。

image

浏览器的 DoH 配置 image

stevenlyw commented 2 months ago

你好,我想问一下你这边说的DNS 本机地址是127.0.0.1还是路由器跟我分配的地址啊,两个我都设置了,我看LOG还是没有信息呢...

mokeyish commented 2 months ago

可能是端口被其他占用了,windows 的 wsl,虚拟机。

stevenlyw commented 2 months ago

1 2 3

我想问一下,这应该是正常的吧 然后我想问一下,本机地址应该是127的地址对吧,而不是路由器分配的192.168.的地址

stevenlyw commented 2 months ago

关单了,我看有smart的一键脚本可以直接装在windows上,还是WSL比较稳