分享下使用AdGuardHome 前置于ss-tproxy #218
Replies: 8 comments 11 replies
-
|
4.7版本,我发现一个不用折腾iptables 的方法,使用还很方便 |
Beta Was this translation helpful? Give feedback.
-
|
这行其实可以改为函数调用: |
Beta Was this translation helpful? Give feedback.
-
|
我加个新配置吧: 如果填了端口号且与mainport不同,表示用户想在dnsmasq之前插入其他dns进程(套娃),可以在pre_start/post_start里面启动相关进程,并监听mainport。 |
Beta Was this translation helpful? Give feedback.
-
|
我分享一个 coredns 的方案吧
coredns 监听
# 有效时间单位: "ns", "us" (or "µs"), "ms", "s", "m", "h".
# (xyz) { ... } 格式为代码块, 可以通过 import 导入
# import 也可以导入外置文件
(disable_aaaa) {
template ANY AAAA {
# 只回复 NOERROR, 然后结束(不回复 ANSWER)
rcode NOERROR
}
}
(enable_cache) {
# 缓存在到达数量上限之后,才会被随机删除。
# 默认缓存数量 256 * 39 = 9984
cache {
# 30 分钟之内查询过2次, 当 ttl 剩余 10% 就会自动预查询
prefetch 2 30m 10%
# 立刻发送过期缓存, 同时后台刷新缓存, 提高效率
serve_stale 24h immediate
# 不要缓存 SERVFAIL
servfail 0
# 不要缓存 NXDOMAIN
disable denial
# 不要缓存这些域名 比如你的 ddns 域名
disable success ddns.example.com
}
}
(enable_hosts) {
hosts {
# 默认会加载 /etc/hosts 以及下面自定义的 hosts
# 自定义 hosts 格式为
# ip 域名 别名 别名 别名 ....
# 比如 :
1.2.3.4 example.com us1
# 如果 hosts 没有匹配, 就继续查询
fallthrough
}
}
.:53 {
import disable_aaaa
import enable_cache
import enable_hosts
errors
# 配置文件被修改自动重新加载,会清空缓存
#reload 5s
bufsize 1232
forward . 127.0.0.1:65353 {
# 因为 chinadns-ng 目前只支持 UDP
prefer_udp
max_fails 0
}
}
# 导入 dns over tls 配置文件
import /etc/coredns/corefile_extra
(common_bind) {
bind 127.0.0.1
bufsize 1232
errors
}
(forward_timer) {
health_check 1s
#expire 60s
max_fails 0
}
.:53111 {
import common_bind
forward . tls://1.1.1.1 {
import forward_timer
tls_servername cloudflare-dns.com
}
}
.:53888 {
import common_bind
forward . tls://8.8.8.8 {
import forward_timer
tls_servername dns.google
}
}
.:53223 {
import common_bind
forward . tls://223.5.5.5 {
import forward_timer
tls_servername dns.alidns.com
}
}
.:53120 {
import common_bind
forward . tls://120.53.53.53 {
import forward_timer
tls_servername dot.pub
}
} |
Beta Was this translation helpful? Give feedback.
-
后置coredns dotcoredns 配置 这样看分流就太舒服了 |
Beta Was this translation helpful? Give feedback.
-
|
更新了下 coredns_extra 的设置, 增加一个 |
Beta Was this translation helpful? Give feedback.
-
|
又编辑了下... 我觉得 health_check 没有必要做了, 另外 |
Beta Was this translation helpful? Give feedback.
-
|
已整理至 wiki/DNS方案。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
效果
AdGuardHome -> ss-tproxy
使用AdGuardHome 可以方便的查看dns 的日志, 可以block 不想要的域名, 可以使用其自带的广告过滤
还有挺多功能的, 我不需要就不在介绍了
安装步骤
安装AdGuardHome
配置其监听192.168.31.1:53, 然后设置它的上级路由为192.168.31.1:54
ss-tproxy.conf 端口改为54
脚本里把dns的 53 -> 54的 规则注释掉
Beta Was this translation helpful? Give feedback.
All reactions