notracking/hosts-blocklists

Unbound.conf size optimization suggestion

HuKoTuH opened this issue · 3 comments

Hi. Seems it's my first comment on github, so sorry if something I'm doing wrong.

I have a suggestion about unbound conf file size optimization: for each domain you are using 2 lines with redirect and 0 IP address, but instead of this you can use only one line with "always_refuse" parameter.

Example:
Your config:

local-zone: "0--0.gq." redirect
local-data: "0--0.gq. IN A 0.0.0.0"

What I'm doing with this on my Raspberry Pi to decrease file size and speedup the unbound daemon restart:

local-zone: "0--0.gq." always_refuse

So my file size after this is only 16M and all works fine.

Hope this will help,
Regards,
HuKoTuH

Just wanted to suggest that, either to put always_refuse or always_nxdomain.

Convert adblock format to unbound:

cat <"$header" >"$unbound"
echo "server:" >>"$unbound"
cat <"$adblock" | grep -Ev '^\s*$|^#|^!' | sed 's/||//' | sed 's/[\^]//g' | awk '{print "local-zone: \""$1".\" always_nxdomain"}' >>"$unbound"

Yes, just fixed this! Thanks. Changed format to local-zone: "0--0.ml." always_null