Blocky: Difference between revisions

From NixOS Wiki
Mirquee (talk | contribs)
Added upstream groups as it was added to the original project. See their doc https://0xerr0r.github.io/blocky/v0.23/configuration/#upstream-groups
Raboof (talk | contribs)
m fix typo
(2 intermediate revisions by 2 users not shown)
Line 8: Line 8:
     enable = true;
     enable = true;
     settings = {
     settings = {
       port = 53; # Port for incoming DNS Queries.
       ports.dns = 53; # Port for incoming DNS Queries.
       upstreams.groups.default = [ # You can define as many upstream groups as you want.
       upstreams.groups.default = [ # You can define as many upstream groups as you want.
         "https://one.one.one.one/dns-query" # Using Cloudflare's DNS over HTTPS server for resolving queries.
         "https://one.one.one.one/dns-query" # Using Cloudflare's DNS over HTTPS server for resolving queries.
Line 17: Line 17:
         ips = [ "1.1.1.1" "1.0.0.1" ];
         ips = [ "1.1.1.1" "1.0.0.1" ];
       };
       };
       #Enable Blocking of certian domains.
       #Enable Blocking of certain domains.
       blocking = {
       blocking = {
         blackLists = {
         blackLists = {
Line 46: Line 46:
};
};
</syntaxHighlight>
</syntaxHighlight>
[[Category:Server]]
[[Category:Cookbook]]

Revision as of 12:56, 2 May 2024

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 = {
      ports.dns = 53; # Port for incoming DNS Queries.
      upstreams.groups.default = [ # You can define as many upstream groups as you want.
        "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.
      bootstrapDns = {
        upstream = "https://one.one.one.one/dns-query";
        ips = [ "1.1.1.1" "1.0.0.1" ];
      };
      #Enable Blocking of certain 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;
};