帮助你部署和维护家庭网络中的 Pi-hole 广告拦截与 DNS 服务
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "homelab-pihole-dns" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/homelab-pihole-dns/SKILL.md 2. 保存为 ~/.claude/skills/homelab-pihole-dns/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为家庭实验室编写一份 Pi-hole 安装指南,目标系统是 Ubuntu Server。包括 Docker 和原生安装两种方式、初始 Web 管理配置、常用端口说明,以及安装后如何把路由器或客户端 DNS 指向 Pi-hole。
一份分步骤安装文档,包含命令、配置要点和启用后的接入方式。
我想让 Pi-hole 通过 DNS-over-HTTPS 转发查询,请给出推荐方案,并说明如何配置 Cloudflared 或类似组件、如何在 Pi-hole 中设置上游、以及如何验证是否生效。
一套可执行的 DoH 配置方案,附带验证步骤和常见错误排查建议。
家里网络出现 DNS 解析异常:部分设备无法打开网站,Pi-hole 日志里有被拦截和超时记录。请给我一个系统化排查流程,覆盖 DHCP、上游 DNS、黑名单、本地域名记录、缓存和客户端设置。
一个按优先级排序的故障排查清单,帮助快速定位并修复解析问题。
Pi-hole is a network-wide DNS ad blocker that runs on a Raspberry Pi or any Linux host. Every device on your network gets ad and malware domain blocking automatically — no browser extension needed.
nas.home.lan, pi.home.lan)Normal flow (without Pi-hole):
Device → requests ads.tracker.com → ISP DNS → real IP → ads load
With Pi-hole:
Device → requests ads.tracker.com → Pi-hole DNS → blocked (returns 0.0.0.0) → no ad
All DNS queries go through Pi-hole first.
Pi-hole checks against blocklists.
Blocked domains return a null response — the ad/tracker never loads.
Allowed domains get forwarded to your upstream resolver (Cloudflare, Google, etc.).
Docker is the easiest way to install Pi-hole and makes updates and backups straightforward.
# docker-compose.yml
services:
pihole:
image: pihole/pihole:<pinned-release-tag>
container_name: pihole
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp" # Web admin
environment:
TZ: "America/New_York"
WEBPASSWORD: "${PIHOLE_WEBPASSWORD}" # set via .env file or secret
PIHOLE_DNS_: "1.1.1.1;1.0.0.1"
DNSMASQ_LISTENING: "all"
volumes:
- "./etc-pihole:/etc/pihole"
- "./etc-dnsmasq.d:/etc/dnsmasq.d"
restart: unless-stopped
cap_add:
- NET_ADMIN # only needed if Pi-hole will serve DHCP
Replace <pinned-release-tag> with a current Pi-hole release tag before deploying.
Avoid latest for long-lived DNS infrastructure so upgrades are deliberate and
reviewable.
Set PIHOLE_WEBPASSWORD in a .env file next to docker-compose.yml, chmod it to
600, and keep it out of git — do not put the password directly in the compose file.
Access web admin at: http://<pi-ip>/admin
Pi-hole requires a static IP before installing.
# Step 1: Assign a static IP (edit /etc/dhcpcd.conf on Pi OS)
sudo nano /etc/dhcpcd.conf
# Add at the bottom:
interface eth0
static ip_address=192.168.3.2/24
static routers=192.168.3.1
static domain_name_servers=192.168.3.1
# Step 2: Download and inspect the installer before running it.
# Prefer the package or installer path documented by Pi-hole for your OS/version.
curl -sSL https://install.pi-hole.net -o pi-hole-install.sh
less pi-hole-install.sh # review before proceeding
# Step 3: Run
bash pi-hole-install.sh
# Follow the interactive installer:
# 1. Select network interface (eth0 for wired — recommended)
# 2. Select upstream DNS (Cloudflare or leave default — can change later)
# 3. Confirm static IP
# 4. Install the web admin interface (recommended)
# 5. Note the admin password shown at the end
# Method 1: Change DNS in your router DHCP settings (recommended)
Router admin UI → DHCP Settings → DNS Server
Primary DNS: 192.168.3.2 (Pi-hole IP)
Secondary DNS: leave blank for strict blocking, or use a second Pi-hole.
A public fallback such as 1.1.1.1 improves availability during
rollout but can bypass blocking because clients may query it.
All devices get Pi-hole as DNS automatically on next DHCP renewal.
Force renewal: reconnect Wi-Fi or run 'sudo dhclient -r && sudo dhclient' on Linux
# Method 2: Per-device DNS (useful for testing before network-wide rollout)
Windows: Control Panel → Network Adapter → IPv4 Properties → set DNS manually
macOS: System Settings → Network → Details → DNS → set manually
…
为 TypeScript、JavaScript、React 与 Node.js 提供统一编码规范与最佳实践建议
帮助开发者掌握 Ktor 服务端常用模式、认证依赖注入与测试实践。
帮助开发者为代码代理配置性能优化、安全防护与研究优先工作流。
为 Windows 原生桌面应用生成并执行端到端自动化测试流程。
帮助 Swift 开发者实现基于 Actor 的线程安全内存与文件持久化方案
帮助团队编排多代理协作流程,管理任务归属、看板流转与交接控制。
帮助你规划家庭与实验室网络拓扑、地址分配、设备连接与常见避坑。
用自然语言管理 Pi-hole v6 的拦截列表、域名策略与 DNS 诊断。
为家庭实验室网络改造提供分段、DNS过滤与远程访问变更前检查清单
帮助用户搭建 WireGuard VPN、配置客户端并安全远程访问家庭网络。
帮助用户配置家庭实验室 WireGuard VPN,实现安全远程访问与密钥管理。
帮助用户规划并配置家庭实验室网络、设备连通与安全分段。