[Dnsmasq-discuss] support binary format of addn-hosts?

Petr Menšík pemensik at redhat.com
Tue Sep 1 15:43:43 BST 2020


Hi Gordon,

no, there is no tree implementation for any similar purpose implemented
in dnsmasq. It either iterates over list of records (linear complexity)
or uses hashing in the best case.

As almost all DNS servers, it loads configuration into memory and no
longer uses files on disk. I haven't seen any memory mapping, which may
help in some way.

Memory usage is already as minimal as it can get. It cannot read any
preprocessed files, similar to BIND's raw zones.

Unless it is possible to reduce number of sites to more general
patterns, I doubt there would be easy solution.

How many records are we speaking about?

Was it measured somehow, what is difference before these filters and
after loading them? In terms of used memory or CPU usage per request?

If there are too many records, I think using bigger DNS servers may
provide faster service in the end. dnsmasq is great, because it is smart
and small. But it does not scale very well.

Cheers,
Petr

On 8/26/20 6:10 PM, Gordon Shawn wrote:
> there are some real large hosts files to filter ads sites, which can be
> added to dnsmasq via addn-hosts.
> 
> is it possible for addn-hosts supporting binary format of these hosts
> files, basically making them a binary tree of some sort, to minimize its
> memory and disk usage, I can see those additional host files will increase
> in size over time?
> 
> Thanks,
> Gordon
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik at redhat.com
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB




More information about the Dnsmasq-discuss mailing list