{"id":13683522,"url":"https://github.com/mueller-ma/block-ads-via-dns","last_synced_at":"2025-04-13T13:26:47.209Z","repository":{"id":90823787,"uuid":"82309995","full_name":"mueller-ma/block-ads-via-dns","owner":"mueller-ma","description":"Block ads and malware via local DNS server","archived":false,"fork":false,"pushed_at":"2022-10-29T09:13:38.000Z","size":21,"stargazers_count":85,"open_issues_count":0,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-27T04:33:17.668Z","etag":null,"topics":["debian-server","dns-server","malware"],"latest_commit_sha":null,"homepage":null,"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/mueller-ma.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}},"created_at":"2017-02-17T15:24:06.000Z","updated_at":"2025-03-01T15:58:22.000Z","dependencies_parsed_at":"2024-01-14T16:10:20.121Z","dependency_job_id":null,"html_url":"https://github.com/mueller-ma/block-ads-via-dns","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/mueller-ma%2Fblock-ads-via-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mueller-ma%2Fblock-ads-via-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mueller-ma%2Fblock-ads-via-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mueller-ma%2Fblock-ads-via-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mueller-ma","download_url":"https://codeload.github.com/mueller-ma/block-ads-via-dns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248719625,"owners_count":21150774,"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":["debian-server","dns-server","malware"],"created_at":"2024-08-02T13:02:14.351Z","updated_at":"2025-04-13T13:26:47.178Z","avatar_url":"https://github.com/mueller-ma.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Block ads and malware via local DNS server\n\n# Installation\n## Debian, Raspbian \u0026 Ubuntu\n- Install DNS Server: `sudo apt install bind9`\n- Go to the bind directory: `cd /etc/bind/`\n- Add this to /etc/bind/named.conf: `include \"/etc/bind/named.conf.blocked\";`\n- Create db.blocked and add this (taken from [here](http://www.deer-run.com/~hal/sysadmin/dns-advert.html)):\n````\n$TTL 24h\n\n@       IN SOA server.yourdomain.com. hostmaster.yourdomain.com. (\n               2003052800  86400  300  604800  3600 )\n\n@       IN      NS   server.yourdomain.com.\n@       IN      A    0.0.0.0\n*       IN      A    0.0.0.0\n````\n- Your /etc/bind/named.conf.options should look like this:\n````\noptions {\n    directory \"/var/cache/bind\";\n\n    // If there is a firewall between you and nameservers you want\n    // to talk to, you may need to fix the firewall to allow multiple\n    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113\n\n    // If your ISP provided one or more IP addresses for stable\n    // nameservers, you probably want to use them as forwarders.\n    // Uncomment the following block, and insert the addresses replacing\n    // the all-0's placeholder.\n\n    forwarders {\n        8.8.8.8;\n        8.8.4.4;\n    };\n\n    //========================================================================\n    // If BIND logs error messages about the root key being expired,\n    // you will need to update your keys.  See https://www.isc.org/bind-keys\n    //========================================================================\n    dnssec-validation auto;\n\n    auth-nxdomain no;    # conform to RFC1035\n    listen-on-v6 { any; };\n    check-names master ignore;\n    check-names slave ignore;\n    check-names response ignore;\n};\n````\n- Replace the forwarders entries with other dns server if you do not want to use Google DNS\n- cd to your home directory `cd ~`\n- Download generate-zonefile.sh `wget https://raw.githubusercontent.com/mueller-ma/block-ads-via-dns/master/generate-zonefile.sh`\n- Make it executable `chmod +x generate-zonefile.sh`\n- Run generate-zonefile.sh `./generate-zonefile.sh`\n\n## Router / DHCP Server\n- Give your Debian server a static IP\n- Change DNS Server in the DHCP settings to the IP of your Debian Server. If you are asked for a second DNS server enter the same IP twice.\n\n## Optional\n- Add local blacklist and whitelist\n- Create cronjob\n- Change the URL to StevenBlack GitHub Hosts in `generate-zonefile.sh`\n\n# Limitations\n- The db.blocked will cause some errors on bind start\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmueller-ma%2Fblock-ads-via-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmueller-ma%2Fblock-ads-via-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmueller-ma%2Fblock-ads-via-dns/lists"}