[Dnsmasq-discuss] Feature request = block-conf
Simon Kelley
simon at thekelleys.org.uk
Sat Feb 5 11:32:44 UTC 2022
Let's try thinking out of the box here. Given the motivation to save
storage, I was wondering if there could be a way to use compression,
gzip etc to save more space.
Building a decompressor into dnsmasq seems ugly, but then I came up with
the option of --conf-script=/path/to/script.
Analogous to --conf-file, except that the standard output of the script
is used as the configuration.
So you could just have a script which consisted of
#!/bin/sh
set -e
gunzip block-domains.gz | sed -e "s:^:address=/:" -e "s:$:/#:"
The sed stuff might not be necessary: a decent compression algo should
hide the repeated information pretty successfully itself.
That solves you problem, and is more generally useful: It's also pretty
trivial to implement.
Opinions, all?
Simon.
On 04/02/2022 09:46, Ercolino de Spiacico wrote:
> I have a feature request.
>
> Since dnsmasq is extremely popular on embedded devices with limited
> resources (e.g. router) it would be a huge improvement to have a new
> directive to block a list of domains.
>
> Practical example:
> We currently need to add an external file to the main config (preferred)
> e.g.:
>
> conf-file=/etc/dnsmasq.adblock
>
> and define the syntax in a relatively long way
>
> address=/baddomain.com/#
> address=/baddomain2.com/#
>
>
> Suggestion -
>
> Could we please have a new directive e.g. block-file
>
> block-conf=/etc/dnsmasq.adblock
>
> where only domains are needed in the mapped file?
>
> baddomain.com
> baddomain2.com
>
>
> This would reduce drastically the demand on storage (so memory). Some of
> the public adblock lists are huge hence having the adblock file
> literally 1/2 of the original size would be amazing.
>
> Thanks
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list