smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

测试了无数次,仅配置上游dns服务器,自定义设置为空,过段时间baidu就解析到国外!

Open zxlhhyccc opened this issue 3 years ago • 94 comments

image

请问有哪个大佬仅配置上游服务器吗?如果有,能否指导配置方法或者分享配置,谢谢!

zxlhhyccc avatar Oct 11 '22 13:10 zxlhhyccc

”仅配置上游服务器“ 是个什么操作?不区分国内组国外组,那不是哪个测速快就走哪个了?

PikuZheng avatar Oct 11 '22 14:10 PikuZheng

”仅配置上游服务器“ 是个什么操作?不区分国内组国外组,那不是哪个测速快就走哪个了?

1、肯定分组了,国内为china组、国外为fq_dns组; 2、如果国内组每个dns添加-exclude-default-group,可以正常解析,但国外组的每个dns添加-exclude-default-group,国外解析失败!

zxlhhyccc avatar Oct 11 '22 14:10 zxlhhyccc

那实际配置不只有上游服务器啊 具体出问题时看debug日志 baidu究竟从哪个组出去了吧

”仅配置上游服务器“ 是个什么操作?不区分国内组国外组,那不是哪个测速快就走哪个了?

1、肯定分组了,国内为china组、国外为fq_dns组; 2、如果国内组每个dns添加-exclude-default-group,可以正常解析,但国外组的每个dns添加-exclude-default-group,国外解析失败!

单看这个现象,像是国外组所有上游网络不通

PikuZheng avatar Oct 11 '22 14:10 PikuZheng

那实际配置不只有上游服务器啊 具体出问题时看debug日志 baidu究竟从哪个组出去了吧

”仅配置上游服务器“ 是个什么操作?不区分国内组国外组,那不是哪个测速快就走哪个了?

1、肯定分组了,国内为china组、国外为fq_dns组; 2、如果国内组每个dns添加-exclude-default-group,可以正常解析,但国外组的每个dns添加-exclude-default-group,国外解析失败!

单看这个现象,像是国外组所有上游网络不通

1、百度解析到国外后,关键是国外正常解析了 2、我把国外组(第二组)的跳过缓存去掉勾,目前貌似解析正常。。。 3、国外正常解析出现这个,貌似国外最快dns解析没起作用 image

zxlhhyccc avatar Oct 11 '22 14:10 zxlhhyccc

那实际配置不只有上游服务器啊 具体出问题时看debug日志 baidu究竟从哪个组出去了吧

”仅配置上游服务器“ 是个什么操作?不区分国内组国外组,那不是哪个测速快就走哪个了?

1、肯定分组了,国内为china组、国外为fq_dns组; 2、如果国内组每个dns添加-exclude-default-group,可以正常解析,但国外组的每个dns添加-exclude-default-group,国外解析失败!

单看这个现象,像是国外组所有上游网络不通

怎么看baidu从哪个组出去的?

zxlhhyccc avatar Oct 11 '22 15:10 zxlhhyccc

debug日志里会写 send baidu.com to group xxx

如果是国外的结果测速最快 可能是由于代理工具抢答了

PikuZheng avatar Oct 11 '22 23:10 PikuZheng

这明显是smartdns没起作用,被抢答了。

yyysuo avatar Oct 12 '22 00:10 yyysuo

让SmartDNS独立使用一个IP,成为这个网络的专职DNS,先于代理工作。

cresky-github avatar Oct 12 '22 02:10 cresky-github

有时smartdns有日志,不代表是smartdns返回,smartdns有日志只能说明有收到相关请求,像楼上说的可能被其他插件抢答了。可以试试这个命令看看目前路由哪些端口在监听,我现在路由即使只留一个smartdns插件也偶尔莫名其妙丢掉dns转发= =!

iptables -t nat -L PREROUTING | grep REDIRECT

4thanks avatar Oct 12 '22 08:10 4thanks

有时smartdns有日志,不代表是smartdns返回,smartdns有日志只能说明有收到相关请求,像楼上说的可能被其他插件抢答了。可以试试这个命令看看目前路由哪些端口在监听,我现在路由即使只留一个smartdns插件也偶尔莫名其妙丢掉dns转发= =!

iptables -t nat -L PREROUTING | grep REDIRECT

按这说法, 查看端口占用情况,应该可以得到验证。

cresky-github avatar Oct 12 '22 09:10 cresky-github

有时smartdns有日志,不代表是smartdns返回,smartdns有日志只能说明有收到相关请求,像楼上说的可能被其他插件抢答了。可以试试这个命令看看目前路由哪些端口在监听,我现在路由即使只留一个smartdns插件也偶尔莫名其妙丢掉dns转发= =!

iptables -t nat -L PREROUTING | grep REDIRECT

image

zxlhhyccc avatar Oct 12 '22 16:10 zxlhhyccc

软件装多了,不知道哪个软件干的。。。我这没啥问题。

jxph1123 avatar Oct 13 '22 00:10 jxph1123

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

4thanks avatar Oct 13 '22 03:10 4thanks

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

直接是smartdns接管了dnsmasq,使用的是53端口

zxlhhyccc avatar Oct 13 '22 11:10 zxlhhyccc

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

直接是smartdns接管了dnsmasq,使用的是53端口

把dnsmasq卸载了。 一了百了。

cresky-github avatar Oct 13 '22 13:10 cresky-github

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。 image

zxlhhyccc avatar Oct 14 '22 00:10 zxlhhyccc

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

没发现smartdns有啥问题,就是会出现切换节点,导致国外不通: image

image

zxlhhyccc avatar Oct 14 '22 00:10 zxlhhyccc

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

没发现smartdns有啥问题,就是会出现切换节点,导致国外不通: image

image

切换节点,导致国外不通

那是肯定的, 解决思路是怎么压缩节点切换的空窗时间

cresky-github avatar Oct 14 '22 00:10 cresky-github

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

没发现smartdns有啥问题,就是会出现切换节点,导致国外不通: image

image

切换节点,导致国外不通

那是肯定的, 解决思路是怎么压缩节点切换的空窗时间

为什么切换节点会导致国外不通呢,我这里并没有遇到,是用smartdns作为主dns了?

yyysuo avatar Oct 14 '22 03:10 yyysuo

你上游dns服务器是哪个插件?再试试这个命令

netstat -anp | grep smartdns

smartdns换成你上游dns插件名称再查一次。

没发现smartdns有啥问题,就是会出现切换节点,导致国外不通: image

image

切换节点,导致国外不通 那是肯定的, 解决思路是怎么压缩节点切换的空窗时间

为什么切换节点会导致国外不通呢,我这里并没有遇到,是用smartdns作为主dns了?

换节点,就是 断开/连接 线路,肯定不通,连接上了才通。这个过程其实很复杂的,涉及路由方面的因素。 若是过程有问题,就说不清楚的。

我是把 smartdns 独立成一个IP,也就是一个虚拟机。 这个 IP 就代表 smartdns,也就是说,smartdns 是这个网络的专职DNS,会先于clash等代理 之前工作。

cresky-github avatar Oct 14 '22 05:10 cresky-github

为什么切换节点会导致国外不通呢,我这里并没有遇到,是用smartdns作为主dns了?

smartdns作为主dns接管了dnsmasq,dnsmasq不用了。。。

zxlhhyccc avatar Oct 14 '22 12:10 zxlhhyccc

发现是淘宝解析到国外,配置文件里加一行:nameserver /taobao.com/china,貌似问题得到解决,继续测试。。。。

zxlhhyccc avatar Oct 16 '22 06:10 zxlhhyccc

发现是淘宝解析到国外,配置文件里加一行:nameserver /taobao.com/china,貌似问题得到解决,继续测试。。。。

上游DNS,不要乱填。指定组的DNS除外。

要不,全国内; 要不,全国外。

国内/国外混填,一定会出事的。 反正,一个原则:一个组,要不定为国内,要不定为国外。

cresky-github avatar Oct 16 '22 06:10 cresky-github

发现是淘宝解析到国外,配置文件里加一行:nameserver /taobao.com/china,貌似问题得到解决,继续测试。。。。

上游DNS,不要乱填。指定组的DNS除外。

要不,全国内; 要不,全国外。

国内/国外混填,一定会出事的。 反正,一个原则:一个组,要不定为国内,要不定为国外。

我是两个组,一个组是国内一个组是国外,没有混填,但如果不加nameserver /taobao.com/china,china是国内组,保证会解析到国外,淘宝有国内和国际的地址,估计国内和国外同时都在解析,如果国外更快,那么解析就会到国外,此问题貌似不是我一个人有这个问题,我加nameserver /taobao.com/china,就是强制淘宝使用国内组解析。。。。 加了nameserver /taobao.com/china后目前还没出现解析到国外情况。。。 另外,还有一个问题,旧版页面中的上游DNS服务器可以同时添加-exclude-default-group,但是新版本不能同时添加,如果同时添加,国外无法解析,如果要保证解析正常,上游dns服务器国内国外添加了-exclude-default-group后,必须到自定义设置里添加解析国外的dns,而且不能添加-exclude-default-group,否则出现同样问题。

zxlhhyccc avatar Oct 16 '22 13:10 zxlhhyccc

要乱填。指定组的DNS除外。

要不,全国内; 要不,全国外。

国内/国外混填,一定会出事的。 反正,一个原则:一个组,要不

你还直接把smartdns的配置图截全了粘上来吧,包括smartdns的配置文件,都粘一下,单靠描述信息明显不够全面。

yyysuo avatar Oct 17 '22 01:10 yyysuo

烦请大佬指导一下哪里设置有问题,配置文件里不加一行:nameserver /taobao.com/china淘宝会解析到国外,而且在上游dn服务器和自定义配置里对国内和国外dns都加上-exclude-default-group,网络不通。目前自定义设置里对国外dns不加-exclude-default-group网络正常(luci截图见后),谢谢! 上游dns服务器国内组(luci页面):

config server
	option enabled '1'
	option name 'DNS派'
	option ip '101.226.4.6'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Baidu'
	option ip '180.76.76.76'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '腾讯DNS'
	option ip '119.29.29.29'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

上游dns服务器国外组(luci页面):

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.1.1.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.0.0.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.1.1.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.0.0.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Cisco OpenDNS'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://dns.opendns.com/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '0'
	option name 'google'
	option ip '8.8.8.8'
	option port '53'
	option type 'tcp'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option name 'google'
	option ip '8.8.8.8'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option enabled '1'
	option host_name 'dns.google'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'google'
	option port '443'
	option type 'https'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option ip 'https://dns.google/dns-query'
	option addition_arg '-exclude-default-group'

自定义设置:

bind :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind-tcp :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group
bind-tcp :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group

tcp-idle-time 10
cache-size 16384
cache-persist yes
cache-file /tmp/smartdns.cache
prefetch-domain yes
serve-expired yes
serve-expired-ttl 345600
serve-expired-reply-ttl 1
serve-expired-prefetch-time 43200
force-AAAA-SOA yes
seconddns_force_aaaa_soa yes
rr-ttl 300
rr-ttl-min 60
rr-ttl-max 86400
rr-ttl-reply-max 60
log-level info
log-file /var/log/smartdns/smartdns.log
log-size 128k
log-num 2
server 101.6.6.6:5353 -group china -exclude-default-group
server 202.38.93.153:5353 -group china -exclude-default-group
server 202.141.162.123:5353 -group china -exclude-default-group
server 202.141.178.13:5353 -group china -exclude-default-group
server 2001:da8::666 -group china -exclude-default-group

server 208.67.222.222:5353 -group fq_dns
server 208.67.220.220:5353 -group fq_dns

server-tcp 1.0.0.1 -group fq_dns
server-tcp 8.8.4.4 -group fq_dns
server-tcp 149.112.112.112 -group fq_dns

server-tls 1.1.1.1 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 2606:4700:4700::1111 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 1dot1dot1dot1.cloudflare-dns.com -group fq_dns -host-name 1dot1dot1dot1.cloudflare-dns.com
server-tls 8.8.8.8 -host-name dns.google -group fq_dns
server-tls dns.google -group fq_dns -host-name dns.google

image image image image

zxlhhyccc avatar Oct 17 '22 05:10 zxlhhyccc

烦请大佬指导一下哪里设置有问题,配置文件里不加一行:nameserver /taobao.com/china淘宝会解析到国外,而且在上游dn服务器和自定义配置里对国内和国外dns都加上-exclude-default-group,网络不通。目前自定义设置里对国外dns不加-exclude-default-group网络正常(luci截图见后),谢谢! 上游dns服务器国内组(luci页面):

config server
	option enabled '1'
	option name 'DNS派'
	option ip '101.226.4.6'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Baidu'
	option ip '180.76.76.76'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '腾讯DNS'
	option ip '119.29.29.29'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

上游dns服务器国外组(luci页面):

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.1.1.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.0.0.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.1.1.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.0.0.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Cisco OpenDNS'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://dns.opendns.com/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '0'
	option name 'google'
	option ip '8.8.8.8'
	option port '53'
	option type 'tcp'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option name 'google'
	option ip '8.8.8.8'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option enabled '1'
	option host_name 'dns.google'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'google'
	option port '443'
	option type 'https'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option ip 'https://dns.google/dns-query'
	option addition_arg '-exclude-default-group'

自定义设置:

bind :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind-tcp :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group
bind-tcp :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group

tcp-idle-time 10
cache-size 16384
cache-persist yes
cache-file /tmp/smartdns.cache
prefetch-domain yes
serve-expired yes
serve-expired-ttl 345600
serve-expired-reply-ttl 1
serve-expired-prefetch-time 43200
force-AAAA-SOA yes
seconddns_force_aaaa_soa yes
rr-ttl 300
rr-ttl-min 60
rr-ttl-max 86400
rr-ttl-reply-max 60
log-level info
log-file /var/log/smartdns/smartdns.log
log-size 128k
log-num 2
server 101.6.6.6:5353 -group china -exclude-default-group
server 202.38.93.153:5353 -group china -exclude-default-group
server 202.141.162.123:5353 -group china -exclude-default-group
server 202.141.178.13:5353 -group china -exclude-default-group
server 2001:da8::666 -group china -exclude-default-group

server 208.67.222.222:5353 -group fq_dns
server 208.67.220.220:5353 -group fq_dns

server-tcp 1.0.0.1 -group fq_dns
server-tcp 8.8.4.4 -group fq_dns
server-tcp 149.112.112.112 -group fq_dns

server-tls 1.1.1.1 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 2606:4700:4700::1111 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 1dot1dot1dot1.cloudflare-dns.com -group fq_dns -host-name 1dot1dot1dot1.cloudflare-dns.com
server-tls 8.8.8.8 -host-name dns.google -group fq_dns
server-tls dns.google -group fq_dns -host-name dns.google

image image image image

知道问题所在了。 Openwrt,有2套配置:应用本身的配置 和 luci配置。luci配置优先级高于应用本身的配置,甚至覆盖。 所以,要不luci配置,要不应用配置,不要混用。

cresky-github avatar Oct 17 '22 11:10 cresky-github

知道问题所在了。 Openwrt,有2套配置:应用本身的配置 和 luci配置。luci配置优先级高于应用本身的配置,甚至覆盖。 所以,要不luci配置,要不应用配置,不要混用。

一、openwrt,按照你说的应用luci配置不用本身配置: 1、国内和国外均添加:-exclude-default-group,国外无法解析(解析失败),国内虽然解析正常,但无法上网; 2、国内添加-exclude-default-group,国外不添加-exclude-default-group,解析没问题,但过会taobao会解析到国外; 3、国内不添加-exclude-default-group,国外添加-exclude-default-group,解析没问题,但一样的过会taobao会解析到国外; 二、openwrt,按照你说的不应用luci配置用本身配置: 1、国内和国外均添加:-exclude-default-group,都可以解析,taobao解析正常; 2、国内添加-exclude-default-group,国外不添加-exclude-default-group,解析没问题,但过会taobao会解析到国外; 3、国内不添加-exclude-default-group,国外添加-exclude-default-group,解析没问题,但一样的过会taobao会解析到国外; 三、openwrt,luci和本身均配置: 1、luci的国内和国外均添加:-exclude-default-group,但本身配置里国内可以添加-exclude-default-group,国外不能添加-exclude-default-group,否则国外一样的不能解析(解析失败); 2、同时本身配置里还需添加:nameserver /taobao.com/china,否则过会taobao也会解析到国外; 以上问题不知道什么原因!

zxlhhyccc avatar Oct 17 '22 11:10 zxlhhyccc

知道问题所在了。 Openwrt,有2套配置:应用本身的配置 和 luci配置。luci配置优先级高于应用本身的配置,甚至覆盖。 所以,要不luci配置,要不应用配置,不要混用。

一、openwrt,按照你说的应用luci配置不用本身配置: 1、国内和国外均添加:-exclude-default-group,国外无法解析(解析失败),国内虽然解析正常,但无法上网; 2、国内添加-exclude-default-group,国外不添加-exclude-default-group,解析没问题,但过会taobao会解析到国外; 3、国内不添加-exclude-default-group,国外添加-exclude-default-group,解析没问题,但一样的过会taobao会解析到国外; 二、openwrt,按照你说的不应用luci配置用本身配置: 1、国内和国外均添加:-exclude-default-group,都可以解析,taobao解析正常; 2、国内添加-exclude-default-group,国外不添加-exclude-default-group,解析没问题,但过会taobao会解析到国外; 3、国内不添加-exclude-default-group,国外添加-exclude-default-group,解析没问题,但一样的过会taobao会解析到国外; 三、openwrt,luci和本身均配置: 1、luci的国内和国外均添加:-exclude-default-group,但本身配置里国内可以添加-exclude-default-group,国外不能添加-exclude-default-group,否则国外一样的不能解析(解析失败); 2、同时本身配置里还需添加:nameserver /taobao.com/china,否则过会taobao也会解析到国外; 以上问题不知道什么原因!

我就分2个组:国内组和默认组(国外组)。国内组排除默认组。 上游DNS,建议国内-阿里,国外-谷歌。无它,因为支持EDNS。其它不明确知道支持EDNS,不建议用,可能会意外出国。

我试过,不用域名表,全部解析由谷歌负责,国内不出国,但延时大。

若DNS使用域名形式,得先解析DNS域名。

cresky-github avatar Oct 17 '22 12:10 cresky-github

烦请大佬指导一下哪里设置有问题,配置文件里不加一行:nameserver /taobao.com/china淘宝会解析到国外,而且在上游dn服务器和自定义配置里对国内和国外dns都加上-exclude-default-group,网络不通。目前自定义设置里对国外dns不加-exclude-default-group网络正常(luci截图见后),谢谢! 上游dns服务器国内组(luci页面):

config server
	option enabled '1'
	option name 'DNS派'
	option ip '101.226.4.6'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Baidu'
	option ip '180.76.76.76'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '腾讯DNS'
	option ip '119.29.29.29'
	option port '5353'
	option type 'udp'
	option server_group 'china'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

上游dns服务器国外组(luci页面):

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.1.1.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option ip '1.0.0.1'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option host_name 'dns.opendns.com'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.1.1.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name '美国 Cloudflare'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://1.0.0.1/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'Cisco OpenDNS'
	option type 'https'
	option port '443'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option ip 'https://dns.opendns.com/dns-query'
	option addition_arg '-exclude-default-group'

config server
	option enabled '0'
	option name 'google'
	option ip '8.8.8.8'
	option port '53'
	option type 'tcp'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option addition_arg '-exclude-default-group'

config server
	option name 'google'
	option ip '8.8.8.8'
	option port '853'
	option type 'tls'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option no_check_certificate '0'
	option enabled '1'
	option host_name 'dns.google'
	option addition_arg '-exclude-default-group'

config server
	option enabled '1'
	option name 'google'
	option port '443'
	option type 'https'
	option server_group 'fq_dns'
	option blacklist_ip '0'
	option ip 'https://dns.google/dns-query'
	option addition_arg '-exclude-default-group'

自定义设置:

bind :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind-tcp :53 speed-check-mode ping,tcp:80,tcp:443 -no-dualstack-selection
bind :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group
bind-tcp :5335 -group fq_dns -no-speed-check -no-rule-add -no-rule-nameserver -no-dualstack-selection -no-cache -no-rule-soa -exclude-default-group

tcp-idle-time 10
cache-size 16384
cache-persist yes
cache-file /tmp/smartdns.cache
prefetch-domain yes
serve-expired yes
serve-expired-ttl 345600
serve-expired-reply-ttl 1
serve-expired-prefetch-time 43200
force-AAAA-SOA yes
seconddns_force_aaaa_soa yes
rr-ttl 300
rr-ttl-min 60
rr-ttl-max 86400
rr-ttl-reply-max 60
log-level info
log-file /var/log/smartdns/smartdns.log
log-size 128k
log-num 2
server 101.6.6.6:5353 -group china -exclude-default-group
server 202.38.93.153:5353 -group china -exclude-default-group
server 202.141.162.123:5353 -group china -exclude-default-group
server 202.141.178.13:5353 -group china -exclude-default-group
server 2001:da8::666 -group china -exclude-default-group

server 208.67.222.222:5353 -group fq_dns
server 208.67.220.220:5353 -group fq_dns

server-tcp 1.0.0.1 -group fq_dns
server-tcp 8.8.4.4 -group fq_dns
server-tcp 149.112.112.112 -group fq_dns

server-tls 1.1.1.1 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 2606:4700:4700::1111 -host-name 1dot1dot1dot1.cloudflare-dns.com -group fq_dns
server-tls 1dot1dot1dot1.cloudflare-dns.com -group fq_dns -host-name 1dot1dot1dot1.cloudflare-dns.com
server-tls 8.8.8.8 -host-name dns.google -group fq_dns
server-tls dns.google -group fq_dns -host-name dns.google

image image image image

看了一下,你的配置有问题,你这么配置,就会出现你描述的现象,跟luci没什么关系。

按你的配置,smartdns的default组是53端口,你把所有的上游dns全都排除出了default组,default组占用了53端口却没有上游dns,当然网络就不通了,所以上游的dns作为国内组dns,不能加-exclude-default-group参数。

国外组你用了5335端口,smartdns只是提供了5335一个服务,你需要在科学软件中指定用本机5335端口的dns服务,科学软件会添加dnsmasq分流规则,把国外域名的dns请求转发到5335。

你现在国外组不加-exclude-default-group参数,那么国外组同时作为了default组,所有的dns请求全部发到了国外,taobao不跑到海外才是怪事。

yyysuo avatar Oct 17 '22 12:10 yyysuo