[Dnsmasq-discuss] [Request for Comments] Optimized Nearest-Domain Lookup

Jason A. Donenfeld Jason at zx2c4.com
Wed Feb 20 12:57:11 GMT 2013


Hi Simon & Folks,

Currently when dnsmasq processes server=/.../, address=/.../, local=/.../,
ipset=/.../, and similar, it find the nearest match for a domain name by
iterating through all the keys, and keeping track of which one had the
largest match length. This gets the job done and is fairly, simple. But it
also could be optimized quite a bit.

This might be a bit verbose for dnsmasq's tastes, and maybe the notion
smells a bit too much of "My First Computer Science Data Structure" kind of
thing, but perhaps this might be a welcome optimization. I present you with
domain-lookup-tree, a simple set of C functions that store domain names in
a tree structure:

http://git.zx2c4.com/domain-lookup-tree/about/

It should be relatively straightforward. I wrote it specifically with
dnsmasq in mind, so if you're interested, I'd be thrilled to see it replace
the current nieve matching technique.

Thoughts? Comments? Ideas?

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20130220/b112b068/attachment.html>


More information about the Dnsmasq-discuss mailing list