retrieve DNS response from cache

This commit is contained in:
Daniel Gultsch 2023-10-24 19:16:47 +02:00
parent 97acd16422
commit 1da9d42065
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -70,6 +70,9 @@ public class AndroidDNSClient extends AbstractDNSClient {
for (final DNSServer dnsServer : getDNSServers()) {
final QuestionServerTuple cacheKey = new QuestionServerTuple(dnsServer, question);
final DNSMessage cachedResponse = queryCache(cacheKey);
if (cachedResponse != null) {
return cachedResponse;
}
final DNSMessage response = this.networkDataSource.query(question, dnsServer);
if (response == null) {
continue;