summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-cache.c
AgeCommit message (Collapse)Author
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-09-16resolved: cache - cache what we can of negative redirect chainsTom Gundersen
When a NXDATA or a NODATA response is received for an alias it may include CNAME records from the redirect chain. We should cache the response for each of these names to avoid needless roundtrips in the future. It is not sufficient to do the negative caching only for the canonical name, as the included redirection chain is not guaranteed to be complete. In fact, only the final CNAME record from the chain is guaranteed to be included. We take care not to cache entries that redirects outside the current zone, as the SOA will then not be valid.
2015-09-16resolved: cache - handle CNAME redirectionTom Gundersen
CNAME records are special in the way they are treated by DNS servers, and our cache should mimic that behavior: In case a domain name has an alias, its CNAME record is returned in place of any other. Our cache was not doing this despite caching the CNAME records, this entailed needless lookups to re-resolve the CNAME.
2015-09-16resolved: cache - only allow putting a single question key at a timeTom Gundersen
Only one key is allowed per transaction now, so let's simplify things and only allow putting one question key into the cache at a time.
2015-09-16resolved: cache - clarify loggingTom Gundersen
2015-09-09tree-wide: drop {} from one-line if blocksLennart Poettering
Patch via coccinelle.
2015-08-26resolved: dump cache and zone contents to syslog on SIGUSR1Lennart Poettering
2015-08-25resolved: allow dns_cache_put() without a questionDaniel Mack
Currently, dns_cache_put() does a number of things: 1) It unconditionally removes all keys contained in the passed question before adding keys from the newly arrived answers. 2) It puts positive entries into the cache for all RRs contained in the answer. 3) It creates negative entries in the cache for all keys in the question that are not answered. Allow passing q = NULL in the parameters and skip 1) and 3), so we can use that function for mDNS responses. In this case, the question is irrelevant, we are interested in all answers we got.
2015-08-21resolved: only maintain one question RR key per transactionLennart Poettering
Let's simplify things and only maintain a single RR key per transaction object, instead of a full DnsQuestion. Unicast DNS and LLMNR don't support multiple questions per packet anway, and Multicast DNS suggests coalescing questions beyond a single dns query, across the whole system.
2015-08-21resolved: add reference to negative caching RFCLennart Poettering
2015-08-21resolved: rework synthesizing logicLennart Poettering
With this change we'll now also generate synthesized RRs for the local LLMNR hostname (first label of system hostname), the local mDNS hostname (first label of system hostname suffixed with .local), the "gateway" hostname and all the reverse PTRs. This hence takes over part of what nss-myhostname already implemented. Local hostnames resolve to the set of local IP addresses. Since the addresses are possibly on different interfaces it is necessary to change the internal DnsAnswer object to track per-RR interface indexes, and to change the bus API to always return the interface per-address rather than per-reply. This change also patches the existing clients for resolved accordingly (nss-resolve + systemd-resolve-host). This also changes the routing logic for queries slightly: we now ensure that the local hostname is never resolved via LLMNR, thus making it trustable on the local system.
2015-08-17resolved: cache - add more detailed cache debug loggingTom Gundersen
2015-08-03resolved: cache - use clock_boottime_or_monotonic()Tom Gundersen
We cannot rely on CLOCK_BOOTTIME being supported by the kernel, so fallack to CLOCK_MONOTONIC if the former is not supported.
2015-05-18resolved: fix crash when shutting downLennart Poettering
Reported by Cristian Rodríguez http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-08-11resolved: implement full LLMNR conflict detection logicLennart Poettering
2014-08-11resolved: properly check return value of dns_resource_record_equal()Lennart Poettering
2014-08-01resolved: don't bother caching negative RRs when the SOA TTL is 0 anywayLennart Poettering
2014-08-01resolved: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC when aging caches ↵Lennart Poettering
and timeing out transactions That way the cache doens't get confused when the system is suspended.
2014-07-30resolved: properly handle adding empty replies to cacheLennart Poettering
2014-07-30resolved: never cache ANY lookupsLennart Poettering
2014-07-30resolved: only cache answer RRs, never additional or authoritative RRs of ↵Lennart Poettering
responses
2014-07-29resolve: add llmnr responder side for UDP and TCPLennart Poettering
Name defending is still missing.
2014-07-23resolved: implement negative cachingLennart Poettering
2014-07-23resolved: rework logic so that we can share transactions between queries of ↵Lennart Poettering
different clients
2014-07-18resolved: various bad memory access fixes to the cacheLennart Poettering
2014-07-17resolved: add DNS cacheLennart Poettering