smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

开启缓存后,是否支持按列表分组

Open maojianyou opened this issue 1 year ago • 8 comments

问题现象 简要描述问题出现的现象 看文档是针对单个域名不缓存,如 domain-rules /example.com/ -no-cache

但我这边需求是,针对特定组不缓存,这种配置是否支持 server 8.8.8.8 -group guowai -exclude-default-group -no-cache

运行环境

固件型号 xen虚拟机 运营商 电信 smartdns来源以及版本 smartdns 1.2023.08.11-1937 涉及的配置(注意去除个人相关信息)

重现步骤

上游DNS配置。

maojianyou avatar Feb 29 '24 09:02 maojianyou

server 8.8.8.8 -group guowai -exclude-default-group -no-cache

这个 guowai 是用什么定义的,bind定义可以在bind同时做 -no-cache,domain-rule或nameserver定义可以用domain-rule做-no-cache

PikuZheng avatar Feb 29 '24 10:02 PikuZheng

server 8.8.8.8 -group guowai -exclude-default-group -no-cache

这个 guowai 是用什么定义的,bind定义可以在bind同时做 -no-cache,domain-rule或nameserver定义可以用domain-rule做-no-cache

conf-file /etc/smartdns/test.conf 加载这个,然后里面的文件是 image

因为test.conf里面可能非常多的域名,使用guowai这个组,那么我想直接应用到下面这个组上,就可以针对test文件里面的所有不做cache,这种支持不 server 8.8.8.8 -group guowai -exclude-default-group -no-cache

maojianyou avatar Mar 01 '24 09:03 maojianyou

建议用domain-rule做

PikuZheng avatar Mar 01 '24 10:03 PikuZheng

为什么要不厌其烦搞那么复杂,分流很简单。

方法1:

group-begin guowai
server x.x.x.x
domain-set -name guowai-domain -file path-to-guowai.list
group-match -domain domain-set:guowai-domain
address #6
speed-check-mode none
group-end

方法二:

server x.x.x.x -g guowai -e
domain-set -name guowai-domain -file path-to-guowai.list
domain-rules domain-set:guowai-domain -nameserver guowai -address #6 -c none

pymumu avatar Mar 01 '24 14:03 pymumu

为什么要不厌其烦搞那么复杂,分流很简单。

方法1:

group-begin guowai
server x.x.x.x
domain-set -name guowai-domain -file path-to-guowai.list
group-match -domain domain-set:guowai-domain
address #6
speed-check-mode none
group-end

方法二:

server x.x.x.x -g guowai -e
domain-set -name guowai-domain -file path-to-guowai.list
domain-rules domain-set:guowai-domain -nameserver guowai -address #6 -c none

我大概意思,国外分组guowai的缺省域名不进行缓存,但国内的域名可以进行缓存,所以想通过分组名称是否进行缓存

maojianyou avatar Mar 09 '24 04:03 maojianyou

group-begin guowai
server x.x.x.x
domain-set -name guowai-domain -file path-to-guowai.list
group-match -domain domain-set:guowai-domain
address #6
speed-check-mode none
# 增加关闭所有域名缓存规则。
domain-rules /./ -no-cache
group-end

pymumu avatar Mar 09 '24 04:03 pymumu

group-begin guowai
server x.x.x.x
domain-set -name guowai-domain -file path-to-guowai.list
group-match -domain domain-set:guowai-domain
address #6
speed-check-mode none
# 增加关闭所有域名缓存规则。
domain-rules /./ -no-cache
group-end

我用的方法二,请问两种方式有什么区别或者问题

ixmu avatar Apr 23 '24 13:04 ixmu

group-begin guowai
server x.x.x.x
domain-set -name guowai-domain -file path-to-guowai.list
group-match -domain domain-set:guowai-domain
address #6
speed-check-mode none
# 增加关闭所有域名缓存规则。
domain-rules /./ -no-cache
group-end

我用的方法二,请问两种方式有什么区别或者问题

方法二,看起来更加简洁,方便维护,结果应该是保持一致的

maojianyou avatar Jul 14 '24 02:07 maojianyou