{"id":17219262,"url":"https://github.com/dev-ritik/pihole-docker","last_synced_at":"2026-07-06T04:31:11.894Z","repository":{"id":69334861,"uuid":"328226479","full_name":"dev-ritik/Pihole-Docker","owner":"dev-ritik","description":"Pihole+Cloudflared: DNS sinkhole + DNS over HTTPS over Docker","archived":false,"fork":false,"pushed_at":"2021-01-09T19:04:47.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T13:26:08.747Z","etag":null,"topics":["cloudflareddns","dns","dns-over-https","dnssinkhole","pihole"],"latest_commit_sha":null,"homepage":"https://ritikk.medium.com/dns-and-privacy-d50c59428cb2","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dev-ritik.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":"2021-01-09T19:03:45.000Z","updated_at":"2021-02-15T10:21:54.000Z","dependencies_parsed_at":"2024-02-23T04:00:35.780Z","dependency_job_id":null,"html_url":"https://github.com/dev-ritik/Pihole-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FPihole-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FPihole-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FPihole-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-ritik%2FPihole-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-ritik","download_url":"https://codeload.github.com/dev-ritik/Pihole-Docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245484572,"owners_count":20623110,"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":["cloudflareddns","dns","dns-over-https","dnssinkhole","pihole"],"created_at":"2024-10-15T03:49:30.272Z","updated_at":"2025-10-27T15:16:45.961Z","avatar_url":"https://github.com/dev-ritik.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pihole Docker\nThis repo has the Docker environment for Pihole (DNS sinkhole and DHCP Server) + Cloudflared (DNS over HTTPS proxy).\n\n## Use Case\nI don't want to bother my ISP with handling my DNS queries! \\\nOhh... And that Pihole thing is jff! (Helps me filter out useless advertisements)\n\n## Bash function\n```bash\ndns_pihole() {\n\t# Pihole DNS controls\n\tif [ $@ = \"on\" ]; then\n\t\t# Use Pihole DNS\n\t\tsudo sed -r -i.orig '/nameserver.*$/ d' /run/systemd/resolve/resolv.conf \u0026\u0026 echo 'nameserver 127.0.0.1' | sudo tee -a /run/systemd/resolve/resolv.conf\n\t\tdocker start pihole\n\telif [ $@ = \"off\" ]; then\n\t\t# Stop Pihole DNS and use plain DNS\n\t\tsudo sed -r -i.orig '/nameserver.*$/ d' /run/systemd/resolve/resolv.conf \u0026\u0026 echo 'nameserver 8.8.8.8' | sudo tee -a /run/systemd/resolve/resolv.conf\n\t\tdocker stop pihole\n\telif [ $@ = \"start\" ]; then\n\t\t# Start Pihole and setup DNS\n\t\tsudo killall -9 dnsmasq\n\t\tcd ~/proj/pihole;\n\t\tdocker-compose up -d;\n\t\tsudo sed -r -i.orig '/nameserver.*$/ d' /run/systemd/resolve/resolv.conf \u0026\u0026 echo 'nameserver 127.0.0.1' | sudo tee -a /run/systemd/resolve/resolv.conf\n\telif [ $@ = \"status\" ]; then\n\t\t# Print Debug info on Pihole and DNS\n\t\techo \"-----------------Nameserver--------------\"\n\t\tcat /etc/resolv.conf | grep nameserver;\n\t\techo \"------------------Docker-----------------\"\n\t\tdocker ps --filter \"name=pihole\";\n\t\techo \"\"\n\t\tdocker logs --tail 10 pihole\n\t\techo \"\"\n\t\techo \"-----------------Netstat-----------------\"\n\t\t# 67: DHCP, 53: DNS, 5053: Cloudflared DoH\n\t\tsudo netstat -ltnpu | egrep ':67\\s|:53\\s|:5053'\n\tfi\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-ritik%2Fpihole-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-ritik%2Fpihole-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-ritik%2Fpihole-docker/lists"}