Ted Lemon <ted.le...@nominum.com> wrote:
>
> I have no idea how you would implement this efficiently with a hashed
> cache:

There's an easy way which I think is a clear optimization:

When there is a cache miss, before recursing, search the cache for a
parent NXDOMAIN entry. If you find one, add an NXDOMAIN cache entry for
the QNAME, and return that, otherwise recurse as usual.

This uses the same memory for the cache as it would without nxdomain-cut,
and requires the same quantity of hash lookups (one) when there is a cache
hit.

Note that when recursing you have to search up the cache anyway, to find
the authoritative servers that can answer this query. So you can combine
the NXDOMAIN search with the NS search, so it doesn't cost any more CPU.

When you get an NXDOMAIN response at a parent of existing cache entries,
don't clean the cache eagerly, allow normal TTL cleaning to deal with
them lazily.

Tony.
-- 
f.anthony.n.finch  <d...@dotat.at>  http://dotat.at/
Dover, Wight, Portland, Plymouth: East or northeast 4 or 5, increasing 6 at
times. Slight or moderate. Mainly fair. Moderate or good, occasionally poor.

_______________________________________________
DNSOP mailing list
DNSOP@ietf.org
https://www.ietf.org/mailman/listinfo/dnsop

Reply via email to