{"id":34837440,"url":"https://github.com/workdone0/pi-gate","last_synced_at":"2026-05-21T13:02:25.165Z","repository":{"id":278387969,"uuid":"933540354","full_name":"workdone0/pi-gate","owner":"workdone0","description":"pi-gate is a lightweight DNS sinkhole for blocking ads, trackers, and malware. Optimized for Raspberry Pi Zero, it runs as a background service with configurable blocklists and a simple CLI for control.","archived":false,"fork":false,"pushed_at":"2025-03-15T19:57:19.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T20:19:16.736Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/workdone0.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":"2025-02-16T07:53:27.000Z","updated_at":"2025-03-15T19:57:23.000Z","dependencies_parsed_at":"2025-02-19T14:40:27.693Z","dependency_job_id":null,"html_url":"https://github.com/workdone0/pi-gate","commit_stats":null,"previous_names":["workdone0/pi-gate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/workdone0/pi-gate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workdone0%2Fpi-gate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workdone0%2Fpi-gate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workdone0%2Fpi-gate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workdone0%2Fpi-gate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workdone0","download_url":"https://codeload.github.com/workdone0/pi-gate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workdone0%2Fpi-gate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28032425,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-25T16:09:59.946Z","updated_at":"2025-12-25T16:11:05.711Z","avatar_url":"https://github.com/workdone0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-gate: A Lightweight DNS Sinkhole\n\n**pi-gate** is a lightweight DNS sinkhole designed to block unwanted URLs, such as advertisements, malware sites, and trackers. It operates as a DNS server, filtering traffic at the network level to enhance privacy and security. Built for efficiency, it is optimized for low-resource devices like the Raspberry Pi Zero.\n\n---\n\n## Features\n\n### ✅ Current Features\n- **DNS Sinkhole Functionality**: Blocks unwanted domains by intercepting DNS queries.\n- **Lightweight \u0026 Fast**: Designed to run efficiently on minimal hardware.\n- **Logging System**: Logs DNS queries to track blocked and allowed domains.\n- **Configurable Blocklists**: Supports loading custom blocklists for domain filtering.\n- **Command-Line Interface (CLI)**: `pi-gate start` and `pi-gate stop` commands for easy control.\n- **Background Execution**: Runs as a background service using Poetry.\n\n### 🚀 Upcoming Features\n- **Optimized AsyncIO Handling**: Improve efficiency in DNS request processing.\n- **Dashboard Enhancements**:\n  - View DNS logs in real-time.\n  - Whitelist management: Allow specific domains.\n  - IP Management: Block/allow specific IPs if required.\n- **Multiprocessing Support**: Enhance performance for handling multiple requests simultaneously.\n- **Better Deployment Support**: Simplified installation and setup.\n\n---\n\n## How It Works\n\nA DNS sinkhole intercepts DNS queries and returns a null response (or a specific IP) for blocked domains. Instead of reaching the actual malicious or ad-serving server, the request is stopped at the DNS level, preventing unwanted content from loading.\n\n## DNS Sinkhole Diagram\n\n\n\n### 📌 DNS Sinkhole Workflow\n1. Device requests a domain (e.g., `example.com`).\n2. `pi-gate` checks its blocklist.\n   - If blocked, returns a null IP (`0.0.0.0` or `127.0.0.1`).\n   - If allowed, forwards the request to the upstream DNS (e.g., Google DNS, Cloudflare).\n3. The response is logged and returned to the client.\n4. Blocked domains do not load, improving security and privacy.\n\n---\n\n## Installation \u0026 Usage\n\n### 📥 Prerequisites\n- Python 3.8+\n- Poetry (for dependency management)\n\n### 🔧 Installation\n```bash\n# Clone the repository\ngit clone https://github.com/workdone0/pi-gate.git\ncd pi-gate\n\n# Install dependencies\npoetry install\n```\n\n### ▶️ Running pi-gate\n```bash\n# Start the DNS sinkhole\npoetry run pi-gate start\n\n# Stop the service\npoetry run pi-gate stop\n```\n\n---\n\n## Contributing\nContributions are welcome! Feel free to open issues or submit pull requests to enhance `pi-gate`.\n\n---\n\n## License\n[MIT License](LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkdone0%2Fpi-gate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkdone0%2Fpi-gate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkdone0%2Fpi-gate/lists"}