教程分享——Openwrt使用Smartdns+ADGuard进行DNS组网

2020-09-06 22:11:15 58点赞 351收藏 26评论

前言

本教程的目的是介于目前市面上还有很多使用了垃圾宽带导致日常上网体验及其不稳定的情况下,使用开源服务SmartDns搭配ADGuard进行全套的上网加速功能。本教程适用于各种固件,请自行解决安装问题,文章中示范固件为OpenWrt。

一:SmartDns

1、启用smartdns,端口默认「6053」,开启「域名预加载」,「过期缓存服务」,重定向选择「无」,缓存大小可根据需求填入,这里填入「1024」,域名TTL可根据需求填入,这里填入「30」、域名TTL最小值填入「30」、域名TTL最大值填入「300」.

教程分享——Openwrt使用Smartdns+ADGuard进行DNS组网

2、上游dns服务器可以选择几个公共dns,还可以选配自己带宽自带dns。但是为了减少dns查询次数和时间,一般不建议超过10个,在这里我们只选择1个国内的,例如:

教程分享——Openwrt使用Smartdns+ADGuard进行DNS组网

而且不需要详细设置。

不用怀疑,这里不需要添加国外的DNS,因为在后面会一次性完善。

3、启用第二DNS服务器,端口默认「6553」,开启「TCP服务器」,服务器组填入GLOBAL。

4、自定义设置里填入以下规则:

speed-check-mode ping

server 114.114.114.114 -group CN -check-edns #国内

server 180.76.76.76 -group CN -check-edns #国内

server 223.5.5.5 -group CN -check-edns #国内

server 119.29.29.29 -group CN -check-edns #国内

server 61.132.163.68 -group CN -check-edns #国内

server-tcp 1.1.1.1 -group GLOBAL -check-edns -exclude-default-group #国外

server-tcp 8.8.8.8 -group GLOBAL -check-edns -exclude-default-group #国外

server-tcp 9.9.9.9 -group GLOBAL -check-edns -exclude-default-group #国外

server-tcp 208.67.222.222 -group GLOBAL -check-edns -exclude-default-group #国外

注意:以上自定义规则中的IP都可以自由搭配,根据自己当地运营商情况以及网络自由选择。

二:AdGuard Home

1、首先更新核心版本,然后点击「详细日志」、「开机后网络准备好时重启」、「在关机时备份工作目录文件」所有的√。

重定向方式任选以下其一:

一:「作为dnsmasq的上游服务器」

二:「重定向53端口到ADGuardHome」

教程分享——Openwrt使用Smartdns+ADGuard进行DNS组网

2、打开「手动设置」,把以下的模板文件全部替换进去,然后点击保存并应用。

注:不要点使用模板。

bind_host: 0.0.0.0

bind_port: 3000

users:

- name: root

password: $2a$10$R823NIDOLRWukfXH8L5yRewC8bahsXtjfM/0Pqt6rCdR37dZllveO

http_proxy: ""

language: ""

rlimit_nofile: 0

debug_pprof: false

web_session_ttl: 720

dns:

bind_host: 0.0.0.0

port: 5553

statistics_interval: 7

querylog_enabled: true

querylog_interval: 1

querylog_size_memory: 1000

anonymize_client_ip: false

protection_enabled: true

blocking_mode: default

blocking_ipv4: ""

blocking_ipv6: ""

blocked_response_ttl: 10

parental_block_host: family-block.dns.adguard.com

safebrowsing_block_host: standard-block.dns.adguard.com

ratelimit: 0

ratelimit_whitelist: []

refuse_any: true

upstream_dns:

- 127.0.0.1:6053

- 127.0.0.1:6553

bootstrap_dns:

- 114.114.114.114

- 1.1.1.1

- 2620:fe::10

- 2620:fe::fe:10

all_servers: false

fastest_addr: false

allowed_clients: []

disallowed_clients: []

blocked_hosts: []

cache_size: 4194304

cache_ttl_min: 0

cache_ttl_max: 0

bogus_nxdomain: []

aaaa_disabled: false

enable_dnssec: false

edns_client_subnet: false

filtering_enabled: true

filters_update_interval: 24

parental_enabled: false

safesearch_enabled: false

safebrowsing_enabled: false

safebrowsing_cache_size: 1048576

safesearch_cache_size: 1048576

parental_cache_size: 1048576

cache_time: 30

rewrites: []

blocked_services: []

tls:

enabled: false

server_name: ""

force_https: false

port_https: 443

port_dns_over_tls: 853

allow_unencrypted_doh: false

strict_sni_check: false

certificate_chain: ""

private_key: ""

certificate_path: ""

private_key_path: ""

filters:

- enabled: true

url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt

name: uBlock filters

id: 1587388244

- enabled: true

url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt

name: uBlock filters – Badware risks

id: 1587388245

- enabled: true

url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt

name: uBlock filters – Privacy

id: 1587394825

- enabled: true

url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt

name: uBlock filters – Resource abuse

id: 1587394826

- enabled: true

url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt

name: uBlock filters -- Unbreak

id: 1587394827

- enabled: true

url: https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt

name: AdGuard Base filter

id: 1587394828

- enabled: true

url: https://filters.adtidy.org/extension/chromium/filters/2.txt

name: AdGuard Base filter

id: 1587394829

- enabled: true

url: https://filters.adtidy.org/extension/ublock/filters/11.txt

name: AdGuard Mobile Ads filter

id: 1587394830

- enabled: true

url: https://easylist.to/easylist/easylist.txt

name: EasyList

id: 1587394831

- enabled: true

url: https://easylist.to/easylist/easyprivacy.txt

name: EasyPrivacy

id: 1587394832

- enabled: true

url: https://gitcdn.xyz/cdn/NanoMeow/MDLMirror/d043946ce8ccfdd99a36f224924849616d692c64/hosts.txt

name: Malware Domain List

id: 1587394833

- enabled: true

url: https://mirror.cedia.org.ec/malwaredomains/justdomains

name: justdomains

id: 1587394834

- enabled: true

url: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext

name: Peter Lowe’s Ad and tracking server list

id: 1587394835

- enabled: true

url: https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt

name: CJX's EasyList Lite

id: 1587394836

- enabled: true

url: https://raw.githubusercontent.com/vokins/yhosts/master/data/tvbox.txt

name: tvbox

id: 1575018007

- enabled: true

url: https://hosts.nfz.moe/full/hosts

name: neoHosts full

id: 1575618240

- enabled: true

url: https://hosts.nfz.moe/basic/hosts

name: neoHosts basic

id: 1575618241

- enabled: true

url: http://sbc.io/hosts/hosts

name: StevenBlack host basic

id: 1575618242

- enabled: true

url: https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD/anti-ad-easylist.txt

name: anti-AD(Adblock+neohosts+yhosts+cjxlist+adhlist)

id: 1577113202

- enabled: true

url: https://gitee.com/xinggsf/Adblock-Rule/raw/master/rule.txt

name: 码云

id: 1592991052

- enabled: true

url: https://gitee.com/xinggsf/Adblock-Rule/raw/master/mv.txt

name: MV

id: 1592991053

- enabled: true

url: http://sub.adtchrome.com/adt-chinalist-easylist.txt

name: ChinaList+EasyList(修正)

id: 1592991058

- enabled: true

url: https://www.daxiaamu.com/wp-content/uploads/files/blocklist.txt

name: blocklist

id: 1592991065

- enabled: true

url: http://git.oschina.net/halflife/list/raw/master/ad.txt

name: My AdFilters

id: 1592991067

- enabled: true

url: https://filters.adtidy.org/extension/chromium/filters/10.txt

name: Filter unblocking search ads and self-promotion

id: 1592991069

- enabled: true

url: https://filters.adtidy.org/extension/chromium/filters/14.txt

name: AdGuard Annoyances filter

id: 1592991070

- enabled: true

url: https://filters.adtidy.org/extension/chromium/filters/3.txt

name: AdGuard Tracking Protection filter

id: 1592991071

- enabled: true

url: https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt

name: CJX's Annoyance List

id: 1593149805

- enabled: true

url: https://easylist-downloads.adblockplus.org/easylistchina.txt

name: EasyList China

id: 1593149807

whitelist_filters: []

user_rules:

- ""

dhcp:

enabled: false

interface_name: ""

gateway_ip: ""

subnet_mask: ""

range_start: ""

range_end: ""

lease_duration: 86400

icmp_timeout_msec: 1000

clients: []

log_file: ""

verbose: false

schema_version: 6

3、打开AdGuard Home网页,账号密码都是root,点击「过滤器」->「DNS封锁清单」,检查更新即可。

修改密码方法:点击AdGuard Home在OpenWrt的设置页面下方的「更多选项」选择改变网页登录密码点击添加,然后点击载入计算模块,输入你想要的密码,点击计算,最后复制生成的密钥到「手动设置」页面复制进第五行password后面。

4、最新版更新方法:static.adguard.com

教程分享——Openwrt使用Smartdns+ADGuard进行DNS组网

注:lan口设置:设置lan口dns服务器为本机,即127.0.0.1。

碍于某些原因,文章进行了部分删减,太可惜了。

展开 收起

ihuman 洪恩 识字子集拼音思维ABC会员永久包3-6岁儿童早教启蒙礼物玩具 识字会员终身包

ihuman 洪恩 识字子集拼音思维ABC会员永久包3-6岁儿童早教启蒙礼物玩具 识字会员终身包

268元起

任天堂 Nintendo Switch《舞力全开 Just Dance》 游戏兑换卡

任天堂 Nintendo Switch《舞力全开 Just Dance》 游戏兑换卡

159元起

Microsoft 微软 OFFICE 365 家庭版 会员

Microsoft 微软 OFFICE 365 家庭版 会员

106元起

WPS 金山软件 WPS 超级会员 3年卡

WPS 金山软件 WPS 超级会员 3年卡

308元起

Microsoft 微软 Office 365 个人版

Microsoft 微软 Office 365 个人版

106元起

Microsoft 微软 365 家庭版 电子秘钥 正版高级Office应用 1T云存储

Microsoft 微软 365 家庭版 电子秘钥 正版高级Office应用 1T云存储

299元起

Microsoft 微软 到手18.2元/月 微软office365家庭版microsoft365增强版15个月

Microsoft 微软 到手18.2元/月 微软office365家庭版microsoft365增强版15个月

289元起

Microsoft 微软 OFFICE 365 个人版 办公软件

Microsoft 微软 OFFICE 365 个人版 办公软件

189元起

Microsoft 微软 office专业版永久激活码office2019增强版终身版outlook密钥

Microsoft 微软 office专业版永久激活码office2019增强版终身版outlook密钥

249元起

WPS超级会员Pro套餐4年卡1488天官方正版pdf转word排版

WPS超级会员Pro套餐4年卡1488天官方正版pdf转word排版

676.4元起

WPS超级会员4年套餐pdf转word排版PPT润色模板素材店铺

WPS超级会员4年套餐pdf转word排版PPT润色模板素材店铺

暂无报价

国行版 Switch体感游戏套装 《健身环大冒险》

国行版 Switch体感游戏套装 《健身环大冒险》

439元起

WPS 金山软件 会员季卡

WPS 金山软件 会员季卡

59.85元起

Microsoft 微软 office365家庭版15个月 203元

Microsoft 微软 office365家庭版15个月 203元

198元起

微软(Microsoft))win10win11专业版批量式授权企业版嵌入式正版化解决方案win11家庭版

微软(Microsoft))win10win11专业版批量式授权企业版嵌入式正版化解决方案win11家庭版

1288元起

Microsoft 微软 活动6天 office365家庭版microsoft365订阅密钥

Microsoft 微软 活动6天 office365家庭版microsoft365订阅密钥

234元起
26评论

  • 精彩
  • 最新
  • 试过smartdns+adguardhome,也试过双adguardhome,没感觉变快反而多了很多莫名其妙问题,如大妈图片打开变慢…还是拆了直接用清爽点

    校验提示文案

    提交
    可能是没有分流呢,可以试一下这种

    校验提示文案

    提交
    哈哈,跟你一样。微信公众号的图片都打不开 [吐血]

    校验提示文案

    提交
    收起所有回复
  • 有没有完整版 [邪恶]

    校验提示文案

    提交
    恩山有,搜我名字吧

    校验提示文案

    提交
    收起所有回复
  • 这个东西理论上很棒,用过一阵子,家人都反映网速怎么这么慢你是不是瞎整啥了 [尴尬] 果断关了

    校验提示文案

    提交
  • 不用迷信adguardhome的作用,对去电视和手机广告帮助很小。远不如手机装个付费版的。而电脑的广告用浏览器版效果更好!规则添加多了,延迟很大。另外新版的adgaurdhome有dns优选功能,不需要smartdns。smartdns更多是出国用的。

    校验提示文案

    提交
    出国直接走隧道了,本地部署smartdns没有啥用

    校验提示文案

    提交
    主要给国内用的,国外走8888就挺好

    校验提示文案

    提交
    还有1条回复
    收起所有回复
  • 楼主有没有测试adguard对网速的影响,上次我开了影响挺大的然后就关了

    校验提示文案

    提交
    起码慢2秒

    校验提示文案

    提交
    收起所有回复
  • 用了这个之后微信老是转圈圈

    校验提示文案

    提交
  • [小眼睛] 用这东西 玩dnf组上队友30s 大红

    校验提示文案

    提交
  • 还用SmartDns?

    校验提示文案

    提交
  • 请问linux能不能搭建文件服务器,可以实现用户对文件、文件夹进行用户或者某些用户组读、写、可读可写、不可读不可写这种权限的设置?就像WINDOWS Server文件服务器一样的一些功能,如果可以的话设置起来比较易上手吗?请问有什么详细的教程吗?哪个版本的Linux能实现我说的这些功能?

    校验提示文案

    提交
    Samba服务,所以Linux都可以,也是学习Linux服务器的第一个服务,但要说配置简单,因为没有图形界面,所以熟悉Linux他就很简单,不熟悉就很难。

    校验提示文案

    提交
    收起所有回复
  • 这玩意用处不大,确实电信的网络用了还感觉慢,广告也过滤不了,比浏览器过滤效果差多了 [皱眉]

    校验提示文案

    提交
  • 感觉影响网速,不知道是不是没设置明白。

    校验提示文案

    提交
  • ***宽带有内网缓存的DNS服务器,设置其他任何DNS都会导致请求走到外网反而更慢了 [装大款]

    校验提示文案

    提交
  • 还用smartdns啊

    校验提示文案

    提交
  • 可能关键的内容删减了,就不喷了。这条写给普通用户,不出国就别瞎折腾了,运营商的dns,cdn,负载比这个好,用了这个只会更慢,几ms感受不到的纯属心理作用。懂得自然懂,懂得也不会在这里看教程 [不说话]

    校验提示文案

    提交
  • 问个问题,ikuai……openwrt旁路…ad单机…ssr设置ad的IP科学,不时就打不开科学了。主机特洛伊!用v2ray就没有问题

    校验提示文案

    提交
  • 应该是passwall+ad才对。

    校验提示文案

    提交
  • 目前单用smartdns

    校验提示文案

    提交
  • adguard最近发现可以替代油猴的功能,直接在全局跑脚本,就是维护和修改脚本变麻烦了。不知道大家有推荐类似的工具吗

    校验提示文案

    提交
提示信息

取消
确认
评论举报

相关好价推荐
查看更多好价

相关文章推荐

更多精彩文章
更多精彩文章
最新文章 热门文章
351
扫一下,分享更方便,购买更轻松