MiniDNS / minidns

DNS library for Android and Java SE
Other
220 stars 61 forks source link

Add support for negative caching #55

Open ppanero opened 7 years ago

ppanero commented 7 years ago

Add support for negative caching. I offer myself to implement this feature, but I would like to have a chat in order to discuss possible implementations (Gitter?)

Flowdalic commented 7 years ago

MiniDNS should already cache negative responses. Or am I missing someting?

The main discussion venue for MiniDNS is the #smack IRC channel at Freenode.

ppanero commented 7 years ago

In this case:

    val client = new DNSClient(new LRUCache(3));
    val resolver = new ResolverApi(client)
    //client.getCache.asInstanceOf[LRUCache].getMissCount
    val result = resolver.resolve("www.asdasd.co.uk", classOf[A])
    val result2 = resolver.resolve("www.asdasd.co.uk", classOf[A])

Shouldn't the second one have been cached as a negative entry? Same should happen for an IP that give NX_DOMAIN in every DNS server. Right?

Flowdalic commented 7 years ago

Sorry, I was wrong. MiniDNS does not yet cache negative results.

ppanero commented 7 years ago

@Flowdalic Is anyone working on this? If not, do you want me to do it?

Flowdalic commented 7 years ago

@Flowdalic Is anyone working on this? If not, do you want me to do it?

I'm not aware of anyone working on it. And I certainly will not you stop from doing so :) Is this regarding of GSOC or so?

ppanero commented 7 years ago

@Flowdalic Nope. We would like to use it for some project at CERN. I will try to do it then. Any special thing to have into account?

Flowdalic commented 7 years ago

@Flowdalic Nope. We would like to use it for some project at CERN. I will try to do it then. Any special thing to have into account?

When I worked on MiniDNS's cache I found that correctly caching DNS information is harder that I expected. It's not just as simple as a key/value key, although one may think so. It gets even more complicated if you want to use the information found in DNS replies to synthesize answers for other questions. I'm happy to support you whenever I can, but ideally not via this github issue. So feel encouraged to start an conversation with me in the Smack's IRC channel (#smack, freenode).

Flowdalic commented 5 years ago

From #85

This mostly includes caching of NX_DOMAIN and optionally, if DNSSEC is used, NSEC and NSEC3 proofs of non-existence. Probably not trivial to implement.

ppanero commented 5 years ago

Hello @Flowdalic , I do not longer work on the project that was using this library. I can try contact them. Nonetheless, from my side, if not needed for you, it can be closed. Cheers!

Flowdalic commented 5 years ago

No need to close this issue until negative caching is implemented.