summaryrefslogtreecommitdiff
path: root/src/resolve
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-12-03 21:26:19 +0100
committerTom Gundersen <teg@jklm.no>2015-12-10 17:06:26 +0100
commitc3cb6dc20be2bc2b7ee8b9384c6452dc6030fc29 (patch)
tree6c27ebdb4f3419b6b171c36d632a2fe0f50d6a52 /src/resolve
parent71e136699ce8882d5749b794add7cbb9d282adaa (diff)
resolved: cache - improve logging
Some DNS servers will hand out negative answers without SOA records, these can not be cached, so log about that fact.
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-dns-cache.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 9ffbf1d1a6..a2cbdd8259 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -443,8 +443,17 @@ int dns_cache_put(
dns_cache_remove(c, key);
}
- if (!answer)
+ if (!answer) {
+ _cleanup_free_ char *key_str = NULL;
+
+ r = dns_resource_key_to_string(key, &key_str);
+ if (r < 0)
+ return r;
+
+ log_debug("Not caching negative entry without a SOA record: %s", key_str);
+
return 0;
+ }
for (i = 0; i < answer->n_rrs; i++)
dns_cache_remove(c, answer->items[i].rr->key);