{"id":39850259,"url":"https://github.com/panoc/pihole-latency-stats","last_synced_at":"2026-01-31T19:00:29.877Z","repository":{"id":332750398,"uuid":"1134872038","full_name":"panoc/pihole-latency-stats","owner":"panoc","description":"Pi-hole Latency Stats is a lightweight Bash script to analyze your Pi-hole's and Unbound DNS response times. It reads directly from the FTL database to visualize how fast your local DNS is resolving queries.","archived":false,"fork":false,"pushed_at":"2026-01-26T07:10:11.000Z","size":973,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-26T09:58:26.530Z","etag":null,"topics":["bash-script","dashboard","dns","dns-benchmark","dns-delay","dns-latency","home-assistant","latency","monitoring","network","network-monitoring","pi-hole","pihole","statistics","stats","unbound"],"latest_commit_sha":null,"homepage":"https://panoc.github.io/pihole-latency-stats/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-15T10:21:01.000Z","updated_at":"2026-01-26T07:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/panoc/pihole-latency-stats","commit_stats":null,"previous_names":["panoc/pihole-latency-stats"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/panoc/pihole-latency-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoc%2Fpihole-latency-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoc%2Fpihole-latency-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoc%2Fpihole-latency-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoc%2Fpihole-latency-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panoc","download_url":"https://codeload.github.com/panoc/pihole-latency-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoc%2Fpihole-latency-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash-script","dashboard","dns","dns-benchmark","dns-delay","dns-latency","home-assistant","latency","monitoring","network","network-monitoring","pi-hole","pihole","statistics","stats","unbound"],"created_at":"2026-01-18T13:41:36.708Z","updated_at":"2026-01-31T19:00:29.868Z","avatar_url":"https://github.com/panoc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/favicon.png\" height=\"100\" alt=\"Logo\"\u003e\n  \u003cbr\u003e\n  \n  \u003cimg src=\"assets/title.png\" height=\"50\" alt=\"Pi-hole Latency Stats\"\u003e\n  \n  \u003cp\u003e\n    \u003cb\u003eAnalyze your Pi-hole and Unbound DNS response times.\u003c/b\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n**Pi-hole Latency Stats** is a lightweight, zero-dependency Bash script that analyzes your **Pi-hole**'s performance. It calculates latency percentiles (Median, 95th), groups query speeds into \"Tiers\" (buckets), monitors your **Unbound** recursive DNS server, and presents everything in a **modern, responsive web dashboard**.\n\nThis tool helps you answer: *\"Is my DNS slow because of my upstream provider, or is it just my local network?\"* and *\"Is Unbound performing efficiently?\"*\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=https://img.shields.io/badge/pihole-%2396060C.svg?style=for-the-badge\u0026logo=pi-hole\u0026logoColor=white\u003e \u003cimg src=https://img.shields.io/badge/Unbound-341893?style=for-the-badge\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAYAAACEYr13AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCA1LjEuN4vW9zkAAAC2ZVhJZklJKgAIAAAABQAaAQUAAQAAAEoAAAAbAQUAAQAAAFIAAAAoAQMAAQAAAAMAAAAxAQIAEAAAAFoAAABphwQAAQAAAGoAAAAAAAAAo5MAAOgDAACjkwAA6AMAAFBhaW50Lk5FVCA1LjEuNwADAACQBwAEAAAAMDIzMAGgAwABAAAAAQAAAAWgBAABAAAAlAAAAAAAAAACAAEAAgAEAAAAUjk4AAIABwAEAAAAMDEwMAAAAAA02IfdCSajZAAAAoZJREFUOE+Vk89LVFEUxz/3jk9tdOUf0NyIMGonaYv+AGnTpn0EgYsQRGhTLWwhgSDhpogghKBaBEmbiChdhQYZRv7IwLyJjDLajKOj4/jeu6fF3BeTKdUXLu+cd873e+45917Gxt4rEdFU0ZTN5q45J6Vc7sdWa2uXAZifX7gZhpGsrOSmpqbmTvtclpdX6hKbubmFS/n8RsE5JyIia2t5GRwcPgcwMfHxk3hUKnti7fLzvr67JwHo7b0XbG6WXsRxnOTsiUi8vp6XgYGHHQDj45MfREScc3siEjvnZHu7XAnD6Kzu7798prk5fUFrHYmIE5Hg17ZA1dgAGtBKqXI63Vivte7W6fSRUCmFDySz2I/9QgGA1qqkDwj+D1KHVfxn/E1Aqh/l9gcSHCYgIqC1rqs6LjnvP9o9SCAGUqmUplDY2gBoaGgoAiilQhG/qQQi0u7PP/ZLyuWKLC1lbyQ5o6Pv2vL5je9RFCd5oec8wDnX4Z1oZ2dbstnVpZGRN+0A2Wy2bmbmS0MiNDv79UmhUJAoiiqJgBKRtjAMJ4vFoiuVSto5txkEwWsRGc5kMi8BFha+HauvD7qiKLronDsRBEHY0tISNDU13Ve5XK5zd3f3VRRFTmutlFKqps87wDRwCzhKdQ4452Ig1djY+EwtLi72KKWGlFJ7IlLviTGQSlQ8Iv9PebtOROa11votsOrJUkMWwNWs5CjjxFZKPdKZTGYaaAcee/WELMnjqamaxJeBbmPMbWWt1cYYB2Ct7QR6gPM11ahpp+TnMWyMyVtrq8/QWqsBMcaI968A14HjnlgGngJDxpjPPidljIl/u5rW2hTgjDFirU0DV4FTwKAxZnZ/DsBPrDKEljYmwJEAAAAASUVORK5CYII=\u0026logoColor=whit \u003e \u003cimg src=https://img.shields.io/badge/bash_script-%23121011.svg?style=for-the-badge\u0026logo=gnu-bash\u0026logoColor=white\u003e\n\n---\n\n## ✨ Key Features\n **🔍 Latency Analysis**  Calculates **Average**, **Median**, and **P95** latency to spot jitters. \n \n **📈 Tiered Grouping**  Groups query speeds into \"Tiers\" (e.g., `\u003c10ms`, `10-50ms`) for easy analysis. \n \n **🔄 Unbound Integration**  Auto-detects Unbound to report **Cache Hit Ratio**, **Prefetching**, and **RAM Usage**. \n \n **📸 Snapshot Mode**  Safely copies the database before analysis to prevent `Database Locked` errors.\n \n **🎯 Smart Filtering**  Filter by **Time** (24h, 7d), **Status** (Blocked/Forwarded), or **Domain** (Wildcards supported). \n \n **🤖 Automation Ready**  Native **JSON output** for Home Assistant, Grafana, or Node-RED integration. \n\n\n---\n\n## Requirements\n\n* `sqlite3` (usually installed by default)\n* *(Optional)* `unbound` and `unbound-host` (for Unbound statistics)\n\n---\n\n## Quick Start (One-Step Install)\n\nTo install the core script, the web dashboard, and all required dependencies, run:\n\n```bash\nwget -O install_phls.sh https://github.com/panoc/pihole-latency-stats/releases/latest/download/install_phls.sh \u0026\u0026 sudo bash install_phls.sh\n\n```\n\n### 👉 [Manual Installation Guide](https://github.com/panoc/pihole-latency-stats/blob/main/docs/MANUAL_INSTALLATION.md)\n\n---\n\n## 📊 Visual Dashboard\n\nIncludes a modern, responsive browser dashboard powered by **Chart.js**.\n\n*Features: Auto-refresh, Dark Mode, Historical Trends, and Multi-Profile support.*\n\n\u003ca href=\"https://raw.githubusercontent.com/panoc/pihole-latency-stats/main/assets/phls_gif_small.gif\" target=\"_blank\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/panoc/pihole-latency-stats/main/assets/phls_gif_small.gif\" alt=\"Dashboard Screenshot\" width=\"100%\" style=\"border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.3);\"\u003e\n\u003c/a\u003e\n\n---\n\n\n## 🛠️ Real-World Use Cases\n\n### 1. Diagnosing \"Is it me or the ISP?\"\n\nSpeed tests measure bandwidth, not latency. DNS lag is the primary cause of sluggish browsing.\n\n* **The Test:** Compare your **Local** speed vs **Upstream** speed.\n* `./pihole_stats.sh -pi` (Cached/Local answers)\n* `./pihole_stats.sh -up` (Cloudflare/Google/ISP answers)\n\n\n\n\u003e **💡 The Insight**\n\u003e * If **`-pi` is slow (\u003e 10ms):** Your Raspberry Pi might be overloaded or using a slow SD card.\n\u003e * If **`-up` is slow (\u003e 100ms):** Your ISP or upstream DNS provider is having issues.\n\u003e \n\u003e \n\n### 2. Optimizing Unbound Performance\n\nIf you run Unbound as a recursive resolver, blind trust isn't enough. Verify your efficiency.\n\n* **The Strategy:** Run `./pihole_stats.sh -up` to strictly analyze upstream resolution speed. Compare the **Average** against a standard forwarder (like `1.1.1.1`).\n* **Deep Inspection:** Use the `-ucc` flag to count the exact number of **Messages** and **RRsets** in RAM.\n\n\u003e **💡 The Insight**\n\u003e If your **Cache Hit Ratio** stays low (\u003c 50%) after 24 hours, consider increasing `cache-min-ttl` in your Unbound config.\n\n### 3. Domain-Specific Debugging\n\nServices like work VPNs or streaming sites often behave differently than general traffic.\n\n* **The Test:** Filter stats for specific domains.\n* `./pihole_stats.sh -dm \"netflix\"` (Matches `netflix.com`, `nflxso.net`, etc.)\n* `./pihole_stats.sh -edm \"my-work-vpn.com\"` (Exact match only)\n\n\u003e **💡 The Insight**\n\u003e You might find that while your global average is **20ms**, specific queries are hitting **Tier 8 (\u003e1000ms)**, indicating a routing timeout.\n\n### 4. Long-Term Health Monitoring\n\nSpot trends before they become problems by automating data collection.\n\n* **The Setup:** Add the script to Cron to run nightly.\n* `./pihole_stats.sh -24h -j -f \"daily_stats.json\" -rt 30`\n\n* **The Insight:**\n   * **JSON Output:** Ingest this into **Home Assistant**, **Grafana**, or **Node-RED** to visualize latency over weeks.\n  * **Auto-Retention (`-rt`):** Keeps your disk clean by automatically deleting reports older than 30 days.\n\n---\n\n## 📖 Full Documentation\n\nDetailed information on CLI flags, automation, and advanced tuning can be found here:\n\n### 👉 [Detailed Usage \u0026 Command Guide](https://github.com/panoc/pihole-latency-stats/blob/main/docs/USAGE.md)\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoc%2Fpihole-latency-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanoc%2Fpihole-latency-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoc%2Fpihole-latency-stats/lists"}