惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Blog — PlanetScale
Blog — PlanetScale
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
L
LangChain Blog
F
Fortinet All Blogs
C
Check Point Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
J
Java Code Geeks
月光博客
月光博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
宝玉的分享
宝玉的分享
Jina AI
Jina AI

方永、南天紫雲

linux透明代理 技术的边界 停机问题通俗说明 Rust与oracle、redis集群的纠结 学习能力的增长 微信调试的原语 mac外接移动硬盘安装ArchLinux linux的死机问题 linux下全键盘操作 漂亮又好用的bspwm linux本机透明代理 ssh、mosh、autossh linux不能待机又一例 从WordPress切换到Hugo 折腾电脑开机 linux系统QQ新思路 Arch Linux的字体渲染 svn管理之submin OpenWrt自动fucking墙記錄 二维码(qrcode)名片的一些事儿 用lua nginx module搭建一个二维码(qr code)生成器 CentOS 7 安裝註記 php程序連接MySQL时只能127.0.0.1而localhost無法連接的問題 ThinkPad之FAN_ERROR、hi fi聲卡 jetty多端口部署 OpenWrt簡單暴力限網 linux中cron之PATH变量 OpenWrt的WDS無線橋接模式 再敘OpenWrt下的rtl8187無線中繼 sed之模擬tail
OpenWrt上SmartDNS的一个有效配置
zola · 2024-03-31 · via 方永、南天紫雲

SmartDNS功能强大,协议全面,OpenWrt上的支持也很完备, 是很多人主用的 dns server。

因为需要分组解析域名的功能,虽然dnsmasq也能实现,但SmartDNS的配置更为简洁,支持一组域名从文件中读的功能,并可以为这个组的域名统一设置解析规则。当然也有chinadns-ng这样的工具可以一试。

在OpenWrt上使用时,遇到一个问题,就是上游服务器可正确解析,但是SmartDNS返回A记录是空。 尝试关闭 serve expired,关闭 cache persist,目前可正常工作。

配置如下:

/var/etc/smartdns/smartdns.conf

server-name smartdns
speed-check-mode tcp:443,tcp:80,ping
cache-size 20000
dnsmasq-lease-file /tmp/dhcp.leases
rr-ttl 3600
rr-ttl-min 5
log-size 64K
log-num 1
log-level error
audit-size 64K
audit-num 1
cache-persist no
force-qtype-SOA  65
resolv-file /tmp/resolv.conf.d/resolv.conf.auto
bind [::]:53@br-lan
bind [::]:53@lo
server 114.114.114.114
domain-set -name domain-block-list -file /etc/smartdns/domain-block.list
domain-rules /domain-set:domain-block-list/ -address #
conf-file /etc/smartdns/address.conf
conf-file /etc/smartdns/blacklist-ip.conf
conf-file /etc/smartdns/custom.conf

/etc/smartdns/address.conf, /etc/smartdns/blacklist-ip.conf

/etc/smartdns/custom.conf

server 10.0.0.2 -group fq -exclude-default-group
address /router.lan/192.168.1.1
domain-set -name fq -type list -file fq.list
domain-rules /domain-set:fq/ -nameserver fq -nftset #4:inet#fw4#fq

fq 组上游服务器10.0.0.2是WireGuard的peer地址,在此机器上配置端口转发,即53端口转发到 1.1.1.1,这样能保证域名解析和路由 path 是同一出口。