[Dnsmasq-discuss] Feature request = block-conf
Ercolino de Spiacico
bellocarico at hotmail.com
Thu Mar 24 09:28:53 UTC 2022
>
> I've just added it to 2.87test8
>
> Please test and report back.
Ok after a first implementation on my test environment this is my feedback:
A- Great feature! the scripting + gzip + zcat is a godsend. Yes it
pushed the CPU up a bit, yes the the script takes longer to execute
(although this is once/day in the early morning so not important), but
most importantly the RAM demand decreased drastically.
B- Since conf-file and conf-script make dnsmasq fail if they are defined
but the target file doesn't exist I have found a simple workaround to
just touch the all the target files at the top of my adblock script and
that does the job nicely.
Now the potential further points of improvements I could identify are:
1- Within the conf-script target file I map the list of domains as
discussed e.g.:
address=/ + $domain + /
For some reason a condition like this:
[ -f list.of.domain ] && { create the formatted configuration }
would always fail at dnsmasq level if the list.of.domains doesn't exist
despite the file existence condition defined. I'm not sure this is meant
to be and/or if there's a smart workaround that can be used.
2- I have tried to push this into the million of records and I can
confirm it still perform very well. There one down side though, the time
needed to restart dnsmasq increased visibly. Somehow it takes too long.
I guess the conf-script is run at every restart or relevant SIGHUP
given. Suppose I'm aware the scripting part is not modified is it worthy
allowing an extra parameter to the conf-script to retain this specific
part of the config? e.g.
script-conf=0,populate-config.sh # do not recreate as part of dnsmasq
restart
script-conf=1,populate-config.sh # (or "1," not defined) always recreate
as part of restart
This somehow also introduced a new minor feature request like allowing
to detach the conf-script directive (creation of) from any SIGHUP and
allow them to fully run in async. So that we could reload the dnsmasq
config without necessarily run the script or all the way around
regenerate the script manually simply asking dnsmasq to reload the
(pre-generated) scripted config.
I'm not so much concerned about the adblock script as this ideally will
run once/day; but I'm rather concerned about external factors triggering
a dnsmasq restart multiple times/day. This potentially can be very
disruptive. If this point 2) of mine is a possibility I see that as a
perfect solution as there's full control on what to trigger and when
without noticeable dnsmasq downtime.
Thanks
More information about the Dnsmasq-discuss
mailing list