Lxc容器上搭建AdGuard Home与SmartDNS
1.先在PVE虚拟化上下载CT模板 如下图:
2.创建Lxc容器,点击创建CT
3.进入WEB控制台安装下ssh
yum install -y openssl openssh-server nano wget tar bind-utils net-tools
或者
dnf install -y openssl openssh-server nano wget tar bind-utils net-tools
修改配置文件
nano /etc/ssh/sshd_config
添加一行
PermitRootLogin yes
按ctrl+x退出保存
启动ssh服务
systemctl start sshd.service
设置开机自动启动ssh服务
systemctl enable sshd.service
4.安装AdGuardHome
下载AdGuardHome安装包
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.37/AdGuardHome_linux_amd64.tar.gz
解压安装包
tar xvf AdGuardHome_linux_amd64.tar.gz
创建安装目录
mkdir /etc/AdGuard_Home
移动文件到指定目录
mv AdGuardHome/* /etc/AdGuard_Home
进入安装目录
cd /etc/AdGuard_Home
开始安装
./AdGuardHome -s install
禁止开机自动启动服务
systemctl disable AdGuardHome
设置开机自动启动服务
systemctl enable AdGuardHome
查看启动服务状态
systemctl status AdGuardHome
启动服务
systemctl start AdGuardHome
重启服务
systemctl restart AdGuardHome
查看服务启动端口
netstat -tunlp
开始设置AdGuardHome
按照安装完成的提示,http://你的IP:3000,访问AdGuardHome的设置网页
设置用户名及其他,登录AdGuardHome
设置完上游DNS
上游dns的意思是adguardhome查询你要用的网址时用的dns服务器,Bootstrap DNS 服务器 是adguardhome 查询dns服务器ip时用的dns服务器,上游服务器应该设置成响应最快的多个dns地址,下面为推荐的DNS地址
https://dns.alidns.com/dns-query https://doh.pub/dns-query https://dns.adguard.com/dns-query https://dns.google/dns-query https://dns.cloudflare.com/dns-query tls://dns.google 8.8.8.8:53 8.8.4.4:53 223.5.5.5:53 114.114.114.114:53 119.29.29.29:53
5.安装SmartDNS
安装包下载地址:点击
解压安装包
tar zxf smartdns.1.2023.08.11-1937.x86_64-linux-all.tar.gz
进入安装目录
cd smartdns chmod +x ./install ./install -i
会报错53端口被占用,不影响后面再修改监听端口
设置开机自动启动服务
systemctl enable smartdns
查看启动服务状态
systemctl status smartdns
启动服务
systemctl start smartdns
重启服务
systemctl restart smartdns
修改配置文件
nano /etc/smartdns/smartdns.conf
配置包含如下基本内容:
# Dns服务器名称 server-name smartdns.lan bind [::]:53 -no-speed-check -no-dualstack-selection bind-tcp [::]:53 -no-speed-check -no-dualstack-selection bind [::]:555 -group public -no-speed-check -no-dualstack-selection bind-tcp [::]:555 -group public -no-speed-check -no-dualstack-selection # 日志级别off、fatal、error、warn、notice、info 或 debug log-level error log-file ./log/smartdns.log log-size 128k # 上游国内解析 server-tcp 114.114.114.114:53 -group py server 2400:3200::1 -group py server 2400:3200:baba::1 -group py server-https https://223.5.5.5/dns-query -group py server-tls 223.6.6.6:853 -group py server 2402:4e00:: -group py server-https https://1.12.12.12/dns-query -group py server-tcp 119.29.29.29:53 -group py server-tls 120.53.53.53:853 -group py # 上游国外解析 server-https https://8.8.8.8/dns-query -group public -exclude-default-group server-https https://1.0.0.1/dns-query -group public -exclude-default-group server-tls 8.8.4.4:853 -group public -exclude-default-group server-tls 1.1.1.1:853 -group public -exclude-default-group server-tcp 168.95.1.1:53 -group public -exclude-default-group server-tcp 101.101.101.101:53 -group public -exclude-default-group # 扩展功能 expand-ptr-from-address yes dualstack-ip-selection yes dualstack-ip-selection-threshold 10 response-mode fastest-response # 缓存 cache-size 102400 cache-persist yes cache-file ./cache/smartdns.dump prefetch-domain yes serve-expired-ttl 180 serve-expired-prefetch-time 86400 cache-checkpoint-time 120 serve-expired-reply-ttl 30 # 关闭特定域名缓存 server 223.5.5.5 -group ddns -exclude-default-group domain-rules /*.xxx.xxx/ -speed-check-mode none -no-cache nameserver /*.xxx.xxx/ddns # 启用ACL #acl-enable yes # 允许访问的主机 #client-rules 192.168.99.3/24 # 加载国际分组解析文件 domain-set -name fwd -file ./fwd.conf domain-rules /domain-set:fwd/ -c none -nameserver public
xxx换成你的域名
6.配置完成上张效果图
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。