Why
- 图个安心
- 加速
- 一劳永逸的屏蔽广告,和防止钓鱼
下载安装
https://github.com/AdguardTeam/AdGuardHome/releases
wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_amd64.tar.gz
tar xvf AdGuardHome_linux_amd64.tar.gz && cd AdGuardHome && ./AdGuardHome -s install
# stop
./AdGuardHome -s stop
# 卸载
./AdGuardHome -s uninstall
# 下面是AdGuardHome的常用命令
# cd AdGuardHome
# start
./AdGuardHome -s start
./AdGuardHome -s restart
# 显示当前的服务状态。
./AdGuardHome -s status
配置
页面配置 – 还是要设到53端口上 – 这样客户端使用起来比较容易

常规设置,把勾搭上,启用日志

速度不要限制;上游DNS服务器填上
https://dns.quad9.net/dns-query
https://dns.cloudflare.com/dns-query

把能实现广告过滤的清单加上
#EasyList China : 国内网站广告过滤的主规则。
https://easylist-downloads.adblockplus.org/easylistchina.txt
#CJX's Annoyance List : 过滤烦人的自我推广,并补充EasyPrivacy隐私规则。
https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
#I don't care about cookies : 我不关心 Cookie 的问题,屏蔽网站的 cookies 相关的警告。
https://www.i-dont-care-about-cookies.eu/abp/
# others
https://gitee.com/halflife/list/raw/master/ad.txt
https://gitee.com/xinggsf/Adblock-Rule/raw/master/rule.txt
https://gitee.com/xinggsf/Adblock-Rule/raw/master/mv.txt
https://easylist-downloads.adblockplus.org/easyprivacy.txt
https://cdn.jsdelivr.net/gh/neoFelhz/neohosts@gh-pages/127.0.0.1/basic/hosts
https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD/anti-ad-easylist.txt
https://gitee.com/banbendalao/adguard/raw/master/ADgk.txt
https://cdn.jsdelivr.net/gh/vokins/yhosts/data/tvbox.txt
https://anti-ad.win/easylist.txt

加一些例外,不然优酷可能看不了 (@@mp4.ts) – @@是允许的意思

修改本地配置 – 最主要就是改下blocked_response_ttl到60,其他都可以在页面改
~/AdGuardHome ❯ vi AdGuardHome.yaml

使用
网页配置就用 http://IP:3000 记得在宝塔中打开防火墙。如果加了域名反代,需要指向3000端口;然后就可以类似 https://dns.domain.com 来访问了。

需要的地方,把DNS改成DNS服务器的IP就行了。记得防火墙要打开53端口。
参考
主要参考了这篇
Sample yaml
Shell
x
64
64
1
bind_host: 0.0.0.0
2
bind_port: 3000
3
users:
4
- name: adguard_bw
5
password: xxxxxxx
6
http_proxy: ""
7
language: ""
8
rlimit_nofile: 0
9
debug_pprof: false
10
web_session_ttl: 720
11
dns:
12
bind_host: 0.0.0.0
13
port: 53
14
statistics_interval: 7
15
querylog_enabled: false
16
querylog_interval: 1
17
querylog_size_memory: 1000
18
anonymize_client_ip: false
19
protection_enabled: true
20
blocking_mode: default
21
blocking_ipv4: ""
22
blocking_ipv6: ""
23
blocked_response_ttl: 10
24
parental_block_host: family-block.dns.adguard.com
25
safebrowsing_block_host: standard-block.dns.adguard.com
26
ratelimit: 0
27
ratelimit_whitelist: []
28
refuse_any: true
29
upstream_dns:
30
- https://dns.quad9.net/dns-query
31
- https://dns.cloudflare.com/dns-query
32
bootstrap_dns:
33
- 202.96.128.166
34
- 210.75.24.195
35
- 202.96.134.133
36
- 9.9.9.9
37
- 149.112.112.112
38
- 1.1.1.1:53
39
- 1.0.0.1:53
40
- 8.8.8.8:53
41
- 8.8.4.4:53
42
all_servers: true
43
fastest_addr: false
44
allowed_clients: []
45
disallowed_clients: []
46
blocked_hosts: []
47
cache_size: 4194304
48
cache_ttl_min: 0
49
cache_ttl_max: 0
50
bogus_nxdomain: []
51
aaaa_disabled: false
52
enable_dnssec: false
53
edns_client_subnet: true
54
filtering_enabled: true
55
filters_update_interval: 168
56
parental_enabled: false
57
safesearch_enabled: true
58
safebrowsing_enabled: true
59
safebrowsing_cache_size: 1048576
60
safesearch_cache_size: 1048576
61
parental_cache_size: 1048576
62
cache_time: 30
63
rewrites: []
64
blocked_services: []