{"id":13775812,"url":"https://github.com/oznu/docker-dns-ad-blocker","last_synced_at":"2025-05-11T08:33:26.929Z","repository":{"id":75135679,"uuid":"72978007","full_name":"oznu/docker-dns-ad-blocker","owner":"oznu","description":"A lightweight dnsmasq DNS server to block traffic to known ad servers with optional DNSCrypt support. Supports x86_64 and Raspberry Pi (armhf).","archived":true,"fork":false,"pushed_at":"2020-06-22T07:56:52.000Z","size":50,"stargazers_count":80,"open_issues_count":0,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-17T10:40:21.311Z","etag":null,"topics":["aarch64","ad-block","ad-blocker","alpine-linux","arm64","armhf","blacklist","blocker","cross-platform","dns-server","dnscrypt","dnscrypt-proxy","dnsmasq","docker","privacy","x86-64"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/oznu/dns-ad-blocker/","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/oznu.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}},"created_at":"2016-11-06T09:17:04.000Z","updated_at":"2024-02-13T22:35:45.000Z","dependencies_parsed_at":"2023-06-05T11:31:22.430Z","dependency_job_id":null,"html_url":"https://github.com/oznu/docker-dns-ad-blocker","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/oznu%2Fdocker-dns-ad-blocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oznu%2Fdocker-dns-ad-blocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oznu%2Fdocker-dns-ad-blocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oznu%2Fdocker-dns-ad-blocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oznu","download_url":"https://codeload.github.com/oznu/docker-dns-ad-blocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253540373,"owners_count":21924521,"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":["aarch64","ad-block","ad-blocker","alpine-linux","arm64","armhf","blacklist","blocker","cross-platform","dns-server","dnscrypt","dnscrypt-proxy","dnsmasq","docker","privacy","x86-64"],"created_at":"2024-08-03T17:01:50.864Z","updated_at":"2025-05-11T08:33:26.426Z","avatar_url":"https://github.com/oznu.png","language":"Dockerfile","funding_links":[],"categories":["\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"6381920f17576b07cc87a8dc619123aa\"\u003e\u003c/a\u003eDNS"],"readme":"[![Travis](https://img.shields.io/travis/oznu/docker-dns-ad-blocker.svg)](https://travis-ci.org/oznu/docker-dns-ad-blocker) [![Docker Pulls](https://img.shields.io/docker/pulls/oznu/dns-ad-blocker.svg)](https://hub.docker.com/r/oznu/dns-ad-blocker/)\n\n# oznu/dns-ad-blocker\n\nA simple, lightweight, dnsmasq DNS server to block traffic to known ad servers.\n\n## Image Variants\n\n| Image Tag             | Architecture  | OS            | Size   |\n| :-------------------- | :-------------| :------------ | :----  |\n| latest                | x64           | Alpine Linux  | [![](https://images.microbadger.com/badges/image/oznu/dns-ad-blocker.svg)](https://microbadger.com/images/oznu/dns-ad-blocker) |\n| armhf          | arm32v6       | Alpine Linux  | [![](https://images.microbadger.com/badges/image/oznu/dns-ad-blocker:armhf.svg)](https://microbadger.com/images/oznu/dns-ad-blocker:armhf) |\n| aarch64         | arm64       | Alpine Linux  | [![](https://images.microbadger.com/badges/image/oznu/dns-ad-blocker:aarch64.svg)](https://microbadger.com/images/oznu/dns-ad-blocker:aarch64) |\n\n\n## Usage\n\nQuick Setup:\n\n```\ndocker run -d -p 53:53/tcp -p 53:53/udp oznu/dns-ad-blocker\n```\n\nRaspberry Pi:\n\n```\ndocker run -d -p 53:53/tcp -p 53:53/udp oznu/dns-ad-blocker:armhf\n```\n\nYou can now set your devices to use the Docker Host's IP Address as the primary DNS resolver,\nif you are using [Docker for Windows](https://docs.docker.com/docker-for-windows/) or [Docker for Mac](https://docs.docker.com/docker-for-mac/) this will be 127.0.0.1.\n\nAutomatic blacklist updates are enabled by default.\n\n## Parameters\n\n```shell\ndocker run --restart=always \\\n  -p 53:53/tcp -p 53:53/udp \\\n  -e DEBUG=0 \\\n  -e NS1=1.1.1.1 -e NS2=1.0.0.1 \\\n  -e AUTO_UPDATE=1 \\\n  -e BRANCH=master \\\n  -e DNSCRYPT=0 \\\n  -v \u003c/path/to/config\u003e:/config \\\n  oznu/dns-ad-blocker\n```\n\nThe parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side.\n\n* `--restart=always` - ensure the container restarts automatically after host reboot.\n* `-p 53:53/tcp -p 53:53/udp` - expose port 53 on TCP and UDP to the host, **required**.\n* `-e DEBUG` - enables debug mode if set to `-e DEBUG=1`. For verbose logging (including source IP) set `-e DEBUG=2`.\n* `-e NS1 -e NS2` - override the default forward lookup servers. Defaults to Cloudflares's DNS servers (1.1.1.1, 1.0.0.1).\n* `-e AUTO_UPDATE` - to disable automatic updates to the blacklist set `-e AUTO_UPDATE=0`. Automatic updates are enabled by default.\n* `-e BLACKLIST_URL` - the url where the blacklist should be downloaded from, useful if you want to lock the blacklist to a specific branch.\n* `-e WHITELIST` - a list of domains to exclude from the blacklist (comma separated, no spaces) eg. `-e WHITELIST=www.oz.nu,hub.docker.com`\n* `-e DNSCRYPT=1` - enable [DNSCrypt](https://dnscrypt.info/), disabled by default. See below for more details.\n* `-v /config` - any files with the `.conf` suffix included in the mounted volume will be included in the dnsmasq config.\n\n## AD Blocking\n\nThis image is using the blacklists created by [oznu/dns-zone-blacklist](https://github.com/oznu/dns-zone-blacklist) and [StevenBlack/hosts](https://github.com/StevenBlack/hosts).\n\nThe DNS server works by returning ```NXDOMAIN``` when a DNS lookup is made by a browser or device to a blacklisted domain. This tells the browser the DNS record for domain name could not be found which means the browser won't even attempt a connection.\n\nIf you have found a host you think should be blacklisted please submit an issue on the upstream blacklist, [StevenBlack/hosts](https://github.com/StevenBlack/hosts/issues), as\nthe aim of this project is not to maintain yet another blacklist.\n\n## DNSCrypt\n\n[DNSCrypt](https://dnscrypt.org/) is a protocol that authenticates communications between a DNS client and a DNS resolver. It uses cryptographic signatures to verify that responses originate from the chosen DNS resolver and haven't been tampered with.\n\n*Note: Using DNSCrypt does not increase your privacy online and is not a replacement for a VPN. Even if you’re using HTTPS, your browser is sending the website hostname in plain text due to [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication).*\n\nThis image allows you to enable [DNSCrypt](https://dnscrypt.org/) for your entire local network or individual workstation without having to install any other client software.\n\n```\ndocker run  -d --restart=always -p 53:53/tcp -p 53:53/udp -e DNSCRYPT=1 oznu/dns-ad-blocker\n```\n\n* ```-e DNSCRYPT``` - To enable DNSCrypt set ```DNSCRYPT=1```. Disabled by default.\n* ```-e DNS_CRYPT_SERVERS``` - a comma seperated (no spaces) list of servers to use. Defaults to `cloudflare,cloudflare-ipv6`.\n\n**Enabling DNSCrypt will override the ```NS1``` and ```NS2``` forward lookup server options.**\n\nSee [the offical list of DNSCrypt resolvers](https://dnscrypt.info/public-servers) for alternative providers if you don't want to use Cloudflare DNS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foznu%2Fdocker-dns-ad-blocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foznu%2Fdocker-dns-ad-blocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foznu%2Fdocker-dns-ad-blocker/lists"}