[dnsdist] Caching reverse lookups
Jon Radel
radelj at folioinvesting.com
Tue Mar 19 20:51:35 UTC 2019
To add a bit more information: It turns out to matter how I do the
query. If I do the query using dig 9.11.3 as shipped with Ubuntu, it
doesn't get cached. If I do the query with host, it does get cached.
Which lead me to the thought that being a bit less clever with dig
options might help. With the +noedns flag, bind queries are also cached.
I'd love an explanation of why this is.
Thanks.
--Jon Radel
Sr. Network Engineer
Folio Financial, Inc.
8180 Greensboro Drive, 8th Floor
McLean, VA 22102
(T) 703-245-4844
(M) 703-861-5128
(E) radelj at folioinvesting.com
www.folioinvesting.com
On 3/19/19 2:59 PM, Jon Radel wrote:
> Tested with both dnsdist 1.2.1 and 1.3.3 under Ubuntu 18.04, I can't
> get dnsdist to cache reverse lookups of IPv4 addresses.
>
> I would expect:
>
> rfc1918Cache = newPacketCache(4000, 3600)
> getPool("rfc1918"):setCache(rfc1918Cache)
> newServer({address="65.216.248.10", pool="rfc1918"})
> newServer({address="216.239.145.208", pool="rfc1918"})
> addAction({'10.in-addr.arpa'}, PoolAction("rfc1918"))
>
> to cache lookups of addresses in 10.0.0.0/8. It doesn't appear to do so:
>
> > getPool("rfc1918"):getCache():printStats()
> Entries: 32/4000
> Hits: 0
> Misses: 32
> Deferred inserts: 0
> Deferred lookups: 0
> Lookup Collisions: 0
> Insert Collisions: 0
> TTL Too Shorts: 0
>
> are the stats of doing the same lookup 32 times in a row.
>
> On the other hand:
>
> foliofnCache = newPacketCache(5000, 3600)
> getPool("foliofn.corp"):setCache(foliofnCache)
> getPool("eap.foliofn.corp"):setCache(foliofnCache)
> newServer({address="10.80.7.78", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> newServer({address="10.80.44.81", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> newServer({address="10.80.54.41", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> newServer({address="10.80.7.79", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> newServer({address="10.80.23.79", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> newServer({address="10.80.44.21", checkType="SOA",
> checkName="foliofn.corp", mustResolve=true, pool="foliofn.corp"})
> addAction({'foliofn.corp'}, PoolAction("foliofn.corp"))
>
> appears to cache just fine:
>
> > getPool("foliofn.corp"):getCache():printStats()
> Entries: 1/5000
> Hits: 21
> Misses: 1
> Deferred inserts: 0
> Deferred lookups: 0
> Lookup Collisions: 0
> Insert Collisions: 0
> TTL Too Shorts: 0
> >
>
> is the result of doing the same lookup in foliofn.corp 22 times in a row.
>
> Am I missing something?
>
More information about the dnsdist
mailing list