Blocky: Difference between revisions

From NixOS Wiki
imported>TAKYON
Blocky is a DNS proxy and ad-blocker for the local network written in Go.
 
imported>TAKYON
m Correcting formatting errors
Line 4: Line 4:


== Configuration Examples ==
== Configuration Examples ==
<code>services.blocky = {
<syntaxHighlight lang=nix>
services.blocky = {
     enable = true;
     enable = true;
     settings = {
     settings = {
Line 31: Line 32:
       };
       };
     };
     };
   };</code>
   };
</syntaxHighlight>




Line 37: Line 39:
To add a cache of DNS Requests and Prefetching add:
To add a cache of DNS Requests and Prefetching add:


<code>caching = {
<syntaxHighlight lang=nix>
caching = {
   minTime = "5m";
   minTime = "5m";
   maxTime = "30m"
   maxTime = "30m"
   prefetching = true;
   prefetching = true;
};</code>
};
</syntaxHighlight>

Revision as of 16:14, 19 July 2023

Blocky is a DNS proxy and ad-blocker for the local network written in Go. It provides network wide adblocking similar to Pi-hole while offering additional features (and it's in nixpkgs).


Configuration Examples

services.blocky = {
    enable = true;
    settings = {
      port = 53; # Port for incoming DNS Queries.
      upstream.default = [
        "https://one.one.one.one/dns-query" # Using Cloudflare's DNS over HTTPS server for resolving queries.
      ];
      # For initially solving DoH/DoT Requests when no system Resolver is available.
      bootstrap.Dns = {
        upstream = "https://one.one.one.one/dns-query";
        ips = [ "1.1.1.1" "1.0.0.1" ];
      };
      #Enable Blocking of certian domains.
      blocking = {
        blackLists = {
          #Adblocking
          ads = ["https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"];
          #Another filter for blocking adult sites
          adult = ["https://blocklistproject.github.io/Lists/porn.txt"];
          #You can add additional categories
      };
      #Configure what block categories are used
      clientGroupsBlock = {
        default = [ "ads" ];
        kids-ipad = ["ads" "adult"];
      };
    };
  };


Adding Additional Functionality

To add a cache of DNS Requests and Prefetching add:

caching = {
  minTime = "5m";
  maxTime = "30m"
  prefetching = true;
};