准备工作
- 下载并安装SSH连接工具Finalshell:【点击进入】
1、在iStoreOS上部署Pi-hole:【点击进入】
- 确认软路由上有 Docker & docker compose
docker -v
docker compose version
- 创建存放配置的目录(建议在硬盘上)
mkdir -p /opt/pihole/etc-pihole
cd /opt/pihole
- 创建配置文件:docker-compose.yml
cat > docker-compose.yml << 'EOF'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
network_mode: "bridge"
ports:
- "10053:53/tcp"
- "10053:53/udp"
- "8080:80/tcp"
environment:
TZ: "Asia/Shanghai"
FTLCONF_webserver_api_password: "你的密码"
FTLCONF_dns_listeningMode: "all"
volumes:
- "./etc-pihole:/etc/pihole"
restart: unless-stopped
EOF
- 启动 Pi-hole 容器
- 在
/opt/pihole目录执行:
- 在
docker compose up -d
2、常用命令(注意:命令都要在cd /opt/pihole目录下执行)
- 停止:
docker compose down
- 重启:
docker compose up -d
- 彻底删除(先停止再删除)
cd /opt
rm -rf pihole
3、打开 Web 管理页面(红色端口部分要和docker-compose.yml配置中的对应过来)
http://【软路由LAN IP】:8080/admin
4、Pi-hole设置
- 添加公共DNS:【点击进入】
- 添加规则
AdGuard DNS filter:https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt
AdAway Default Blocklist:https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt
1Hosts (Lite):https://adguardteam.github.io/HostlistsRegistry/assets/filter_24.txt
HaGeZi's Normal Blocklist:https://adguardteam.github.io/HostlistsRegistry/assets/filter_34.txt
HaGeZi's Pro Blocklist:https://adguardteam.github.io/HostlistsRegistry/assets/filter_48.txt
HaGeZi's Pro++ Blocklist:https://adguardteam.github.io/HostlistsRegistry/assets/filter_51.txt
HaGeZi's Ultimate Blocklist:https://adguardteam.github.io/HostlistsRegistry/assets/filter_49.txt
Steven Black's List:https://adguardteam.github.io/HostlistsRegistry/assets/filter_33.txt
5、设置流量转发
- 「网络」 → 「DHCP/DNS」——「转发」——「DNS 转发」——(红色端口和上面对应)
127.0.0.1#10053










