AdGuardHome – DNS服务器的安装以及设置
23 5 月, 2020 | 添加评论
前言
最近购买了一台J1900,上面安装了PVE,并虚拟了LEDE,我们需要搭建一个DNS服务器,使得电信和联通都能够通过最快的DNS解析,并达到网页秒开的效果。
AdGuardHome开源地址:点击访问
准备工作
1、基于PVE的安装
2、更改ProxmoxVE的LXC仓库为国内源
3、建立PVE–CentOS容器
创建AdGuardHome的LXC,更改LXC仓库源
首先,我们还是需要更改ProxmoxVE的LXC仓库为国内源的下载地址,不然龟速的下载,会让你怀疑人生。
SSH连接PVE,复制下面代码,并一起粘贴并输入回车运行。
grep -rn "download.proxmox.com" /usr/share/perl5/PVE/* sed -i.bak "s#http://download.proxmox.com/images#https://mirrors.ustc.edu.cn/proxmox/images#g" /usr/share/perl5/PVE/APLInfo.pm wget -O /var/lib/pve-manager/apl-info/mirrors.ustc.edu.cn https://mirrors.ustc.edu.cn/proxmox/images/aplinfo.dat
下载Centos7镜像文件
依次找到 “local–内容–模板” 然后下载Centos7的镜像文件模板。
开始创建AdGuardHome CT
开始创建CT。右键你的节点,“创建CT”,填写ROOT密码。
根据你的内网IP段,填入你准备规划的DNS服务器的IP地址,具体如下图:
登录控制台,首先更新源 yum -y update 然后安装 openssh-server。命令如下
yum install -y openssl openssh-server
修改配置文件 vi /etc/ssh/sshd_config ,把 #Port 22 前面的 #去掉,打开22端口,然后一起贴入下面三行命令:
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config reboot
开始安装AdGuardHome
1、安装依赖环境wget
yum -y install wget
2、下载官方AdGuardHome
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.102.0/AdGuardHome_linux_amd64.tar.gz
3、解压AdGuardHome
tar xvf AdGuardHome_linux_amd64.tar.gz
4、进入AdGuardHome目录
cd AdGuardHome
5、安装AdGuardHome
./AdGuardHome -s install
6、设置自启动
systemctl enable AdGuardHome
开始设置AdGuardHome
按照安装完成的提示,http://你的IP:3000,访问AdGuardHome的设置网页。
设置完上游DNS,完工了
上游dns的意思是adguardhome查询你要用的网址时用的dns服务器,Bootstrap DNS 服务器 是adguardhome 查询dns服务器ip时用的dns服务器,上游服务器应该设置成响应最快的多个dns地址,下面为推荐的DNS地址。
https://dns.adguard.com/dns-query https://dns.cloudflare.com/dns-query tls://dns.google tcp://8.8.8.8 tcp://8.8.4.4 176.103.130.130 114.114.114.114 119.29.29.29
附录AdGuardHome规则
过滤器,AdGuard Home 可以解析基础的adblock规则和Hosts语法。
系统自带过滤器
AdGuard Simplified Domain Names filter https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt AdAway https://adaway.org/hosts.txt hpHosts – Ad and Tracking servers only https://hosts-file.net/ad_servers.txt MalwareDomainList.com Hosts List https://www.malwaredomainlist.com/hostslist/hosts.txt
自定义过滤器
anti-AD
https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-easylist.txt
Easylist 官方规则
https://easylist.to/easylist/easylist.txt
EasyList China 中文补充规则
https://easylist-downloads.adblockplus.org/easylistchina.txt
EasyList Lite 中文精简规则
https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt
EasyPrivacy 隐私保护
https://easylist-downloads.adblockplus.org/easyprivacy.txt
CJX’s Annoyance List 去自我推广列表
https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
ChinaList 国内大部分视频网站的广告过滤 (广告净化器)
https://raw.githubusercontent.com/hopol/ChinaList2.0/master/ChinaList2.0.txt
乘风广告过滤规则
https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/ABP-FX.txt
【码云更新】https://gitee.com/xinggsf/Adblock-Rule/raw/master/rule.txt
【MV规则】https://gitee.com/xinggsf/Adblock-Rule/raw/master/mv.txt
Fanboy+Easylist-Merged Ultimate List
https://fanboy.co.nz/r/fanboy-ultimate.txt
StevenBlack
http://sbc.io/hosts/alternates/fakenews-gambling-porn-social/hosts
yhosts
https://raw.githubusercontent.com/vokins/yhosts/master/hosts
大圣净化
https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts
1024_hosts
https://raw.githubusercontent.com/Goooler/1024_hosts/master/hosts
neoHosts Full
https://hosts.nfz.moe/full/hosts
Google Host
https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts
ChinaList+EasyList(修正)
http://sub.adtchrome.com/adt-chinalist-easylist.txt
以下慎用
I don’t care about cookies 屏蔽网站 cookies 相关警告!!!
https://www.i-dont-care-about-cookies.eu/abp/