{"id":26579624,"url":"https://github.com/timintech/pi-hole-unbound-pialert-setup","last_synced_at":"2025-03-23T06:18:15.776Z","repository":{"id":195760389,"uuid":"693602835","full_name":"TimInTech/Pi-hole-Unbound-PiAlert-Setup","owner":"TimInTech","description":"Pi-hole \u0026 Pi.Alert Installation on Raspberry Pi","archived":false,"fork":false,"pushed_at":"2025-03-15T23:24:42.000Z","size":1864,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T23:07:03.610Z","etag":null,"topics":["ad-blocker","debian","dnssec","gummiflip","netzwerk","pihole","raspberry-pi","recursive-dns","ubuntu","unbound"],"latest_commit_sha":null,"homepage":"https://github.com/TimInTech/Pi-hole-Pi.Alert-Installation-/tree/main","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimInTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-19T10:59:00.000Z","updated_at":"2025-03-20T04:17:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"a862513b-4c02-407a-9ece-059635fb8a95","html_url":"https://github.com/TimInTech/Pi-hole-Unbound-PiAlert-Setup","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"16910f421d32b38d3c6e0f4b4fb282c440112ba7"},"previous_names":["gummiflip/pi-hole-pi.alert-installation-","timintech/pi-hole-pi.alert-installation-"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FPi-hole-Unbound-PiAlert-Setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FPi-hole-Unbound-PiAlert-Setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FPi-hole-Unbound-PiAlert-Setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FPi-hole-Unbound-PiAlert-Setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimInTech","download_url":"https://codeload.github.com/TimInTech/Pi-hole-Unbound-PiAlert-Setup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061636,"owners_count":20554614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ad-blocker","debian","dnssec","gummiflip","netzwerk","pihole","raspberry-pi","recursive-dns","ubuntu","unbound"],"created_at":"2025-03-23T06:18:14.576Z","updated_at":"2025-03-23T06:18:15.753Z","avatar_url":"https://github.com/TimInTech.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n# Pi-hole + Unbound + PiAlert Setup\n\n![Pi-hole + Unbound Setup](https://github.com/TimInTech/Pi-hole-Unbound-PiAlert-Setup/blob/main/eea62b352f4d0301.png)\n\nThis repository provides a detailed guide on setting up **Pi-hole with Unbound** as a local DNS resolver and **PiAlert** for network monitoring.\n\n## 📌 Comprehensive Pi-hole 6 Configuration\nIf you're looking for an **in-depth guide** with additional optimizations, check out my full **Pi-hole v6.0 - Comprehensive Guide**:\n\n➡ **[Pi-hole v6.0 - Comprehensive Guide](https://github.com/TimInTech/Pi-hole-v6.0---Comprehensive-Guide)**\n\n🔗 **Official Resources**  \n[GitHub Repository](https://github.com/pi-hole/pi-hole) | [v6 Migration Guide](https://docs.pi-hole.net/docker/upgrading/v5-v6/)  \n---\n\n**Recommended Hardware**: [Raspberry Pi 4 Kit (8GB)](https://amzn.to/4gXEciT) with NVMe SSD via USB 3.0\n### Features included:\n- Advanced **Pi-hole configurations**\n- Optimized **DNS settings**\n- **Blocklist \u0026 whitelist** management\n- Additional **performance and privacy tweaks**\n\n## 🔹 Feedback \u0026 Updates\nFeel free to share your feedback and suggestions! If you find any issues or have ideas for improvements, open an **Issue** or submit a **Pull Request**.\n\n---\n\n# Installation Guide\n\n## 1️⃣ Installing Pi-hole\nPi-hole filters DNS requests to block advertisements across the network.\n\n### Installation on Ubuntu/Debian\n```bash\ncurl -sSL https://install.pi-hole.net | bash\n```\nFollow the installation prompts and note down your web interface login credentials.\n\n### Accessing the Web Interface\n- Open: `http://pi.hole/admin`\n- Or replace `pi.hole` with your Pi-hole server’s IP address.\n\n### Post-Installation Configuration\nUpdate block lists and rules:\n```bash\npihole -g\n```\nEnsure Pi-hole starts automatically at boot:\n```bash\nsudo systemctl enable pihole-FTL\nsudo systemctl restart pihole-FTL\n```\n\n---\n\n## 2️⃣ Installing Pi.Alert\nPi.Alert monitors the network and detects new devices.\n\n### Pi.Alert Installation\n```bash\nsudo apt update \u0026\u0026 sudo apt install git -y\ngit clone https://github.com/jokob-sk/NetAlertX.git /opt/netalertx\ncd /opt/netalertx\nchmod +x install/install.debian.sh\nsudo ./install/install.debian.sh\n```\nOnce installed, access the web interface at `http://\u003cIP\u003e:20211`.\n\n---\n\n## 3️⃣ Setting Up Unbound as an Upstream DNS for Pi-hole\nUnbound allows independent and secure DNS resolution without third-party services.\n\n### Installing Unbound\n```bash\nsudo apt update \u0026\u0026 sudo apt install unbound -y\n```\n\n### Configuring Unbound for Pi-hole\nCreate the configuration file:\n```bash\nsudo nano /etc/unbound/unbound.conf.d/pi-hole.conf\n```\nAdd the following content:\n```yaml\nserver:\n    verbosity: 0\n    interface: 127.0.0.1\n    port: 5335\n    do-ip4: yes\n    do-ip6: no\n    do-udp: yes\n    do-tcp: yes\n    root-hints: \"/var/lib/unbound/root.hints\"\n    harden-glue: yes\n    harden-dnssec-stripped: yes\n    use-caps-for-id: no\n    edns-buffer-size: 1232\n    prefetch: yes\n    num-threads: 1\n    so-rcvbuf: 1m\n    private-address: 192.168.0.0/16\n    private-address: 172.16.0.0/12\n    private-address: 10.0.0.0/8\n```\n\n### Downloading Root Server Hints\n```bash\nsudo wget -O /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache\nsudo chown unbound:unbound /var/lib/unbound/root.hints\n```\n\n### Restart and Enable Unbound\n```bash\nsudo systemctl restart unbound\nsudo systemctl enable unbound\n```\n\n---\n\n## 4️⃣ Configuring Pi-hole to Use Unbound as Upstream DNS\n1. Open the Pi-hole Web Interface (`http://pi.hole/admin`).\n2. Navigate to **Settings → DNS**.\n3. Disable all external DNS providers (Google, Cloudflare, OpenDNS, etc.).\n4. Set `127.0.0.1#5335` as the upstream DNS.\n5. Save the changes and restart Pi-hole:\n```bash\npihole restartdns\n```\n\n---\n\n## 5️⃣ Testing Unbound Functionality\nVerify that Unbound resolves DNS queries correctly:\n```bash\ndig google.com @127.0.0.1 -p 5335\n```\nIf the response contains `status: NOERROR`, the configuration is working correctly.\n\n---\n\n## 6️⃣ Common Issues \u0026 Solutions\n\n### \"SERVFAIL\" Error in DNS Resolution\nCheck if Unbound is running:\n```bash\nsudo systemctl status unbound\n```\nTest Unbound manually:\n```bash\ndig google.com @127.0.0.1 -p 5335\n```\n\n### Slow DNS Resolution\n- Ensure **root server hints** are correctly downloaded.\n- Disable **DNSSEC in Pi-hole** (Unbound handles it already).\n\n### Issues with IPv6 DNS Resolution\nIf IPv6 is required:\n- Change `do-ip6: no` to `do-ip6: yes` in the Unbound config file.\n- Check your network's **IPv6 settings**.\n\n### \"Connection refused\" Error\nIf Unbound is not responding:\n- Ensure the firewall is not blocking port 5335:\n```bash\nsudo ufw allow 5335/tcp\nsudo ufw reload\n```\n\n---\n\n## 7️⃣ Optimization \u0026 Advanced Settings\n\n### Increase Cache Size\n```yaml\ncache-max-ttl: 86400\ncache-min-ttl: 3600\n```\n\n### Enable Error Logging\n```yaml\nlogfile: \"/var/log/unbound.log\"\n```\nCheck the log for troubleshooting:\n```bash\nsudo tail -f /var/log/unbound.log\n```\n\n### Test DNSSEC Validation\n```bash\ndig sigok.verteiltesysteme.net @127.0.0.1 -p 5335\n```\nIf the response includes `status: NOERROR`, DNSSEC is correctly configured.\n\n---\n\n## 8️⃣ Conclusion\nWith this setup, you achieve a **fast, secure, and private DNS system**:\n✔ **Ad-blocking (Pi-hole)** for a cleaner browsing experience\n✔ **Network monitoring (Pi.Alert)** for better control\n✔ **Independent DNS resolution (Unbound)** for privacy\n\n## 📌 Troubleshooting \u0026 Common Issues\nFor common Pi-hole v6 issues and solutions, check out the **[Troubleshooting Guide](TROUBLESHOOTING.md)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimintech%2Fpi-hole-unbound-pialert-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimintech%2Fpi-hole-unbound-pialert-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimintech%2Fpi-hole-unbound-pialert-setup/lists"}