Hi Simon & Folks,<div><br></div><div>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.</div>
<div><br></div><div>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:</div>
<div><br></div><div><a href="http://git.zx2c4.com/domain-lookup-tree/about/">http://git.zx2c4.com/domain-lookup-tree/about/</a></div><div><br></div><div>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.</div>
<div><br></div><div>Thoughts? Comments? Ideas?</div><div><br></div><div>Jason</div>