Marek Vavrusa [Wed, 11 May 2016 07:40:35 +0000 (00:40 -0700)]
daemon/worker: deduplicate inbound queries
many clients do frequent retransmits of the query
to avoid network losses and get better service,
but then fail to work properly when a resolver
answers SERVFAIL to some of them because of the
time limit and some of them NOERROR.
it's also a good idea to avoid wasting time
tracking pending tasks to solve the same thing.
Marek Vavrusa [Wed, 11 May 2016 00:45:12 +0000 (17:45 -0700)]
daemon: do not modify task for outgoing queries
if the upstream TCP query timeouted or the connection
was severed, it would dissociate the handle from
original query, so the query would be solved
but the requestor wouldn't see the answer unless
he requeried
Marek Vavrusa [Fri, 6 May 2016 06:40:28 +0000 (23:40 -0700)]
lib: cleanup servfail soft-fails
* simplified soft-fail per-ns limit to per-query
limit, each query gets 4 tries at resolving
* instead of locking at single servfailing NS,
penalise it and run reelection, this may or
may not try other servers but avoids pathologic
case when single NS is servfailing while others
are good but never probed
* added new nsrep update mode (addition)
Marek Vavrusa [Wed, 4 May 2016 00:17:53 +0000 (17:17 -0700)]
lib/validate: fixed memory bug
this code used memory pool of source packet instead
of the answer, this could result in invalidated
memory read if the memory occupied by source
packet was rewritten
Marek Vavrusa [Tue, 3 May 2016 06:56:20 +0000 (23:56 -0700)]
daemon: out-of-order processing for TCP
* daemon now processes messages over TCP stream
out-of-order and concurrently
* support for TCP_DEFER_ACCEPT
* support for TCP Fast-Open
* there are now deadlines for TCP for idle/slow
streams (to prevent slowloris; pruning)
* there is now per-request limit on timeouts
(each request is allowed 4 timeouts before bailing)
* faster request closing, unified retry/timeout timers
* rare race condition in timer closing fixed
Marek Vavrusa [Mon, 18 Apr 2016 03:34:31 +0000 (20:34 -0700)]
daemon: mode(strict|normal|permissive)
the daemon has now three modes of strictness
checking from strict to permissive.
it reflects the tradeoff between resolving the
query in as few steps as possible and security
for insecure zones
Marek Vavrusa [Mon, 18 Apr 2016 00:32:17 +0000 (17:32 -0700)]
engine: clear bad scorers from RTT every 5 minutes
an internal timer walks RTT timer periodically and
clears entries with bad results every 5 minutes.
this means that a timeouted entry penalty is
capped to that interval, making sure that the
bad reputation doesn't last forever
Marek Vavrusa [Mon, 18 Apr 2016 00:29:41 +0000 (17:29 -0700)]
engine: throttle outbound queries only when busy
resolver will always attempt to contact upstreams
known to be bad if it's not busy.
this fixes a problem on low-volume resolvers
where a short connection outage could make
resolvers deny resolving queries even after the
connection is restored
Marek Vavrusa [Fri, 15 Apr 2016 07:03:13 +0000 (00:03 -0700)]
lib/iterate: QUERY_PERMISSIVE mode
in permissive mode, resolver is free to use
(but not cache) non-mandatory glue records even
if they're not resolvable. this is great as a
workaround for broken child-side zones, but
not great for security of, well, insecure
delegations. it's off by default.
Marek Vavrusa [Tue, 8 Mar 2016 17:26:19 +0000 (17:26 +0000)]
daemon: track case when all upstreams fail
previously full timeout led to reset of the evaluated
address list and no upstream server was penalised
for not answering the query, this penalises all of
tried servers with TIMEOUT
Marek Vavrusa [Wed, 24 Feb 2016 06:40:17 +0000 (22:40 -0800)]
modules/graphite: support for Graphite/TCP
graphite module now supports sending over TCP,
if the connection is severed it will attempt to
reconnect periodically. the stats module is now
optional, if not loaded only core built-in stats
will be transmitted
Marek Vavrusa [Mon, 8 Feb 2016 01:36:48 +0000 (01:36 +0000)]
lib/validate: scrubbed extra rrs in NS were checked
the validator module should ignore any data that
will be scrubbed, that includes non-authoritative
data outside current bailiwick. previously,
validator attempted to ignore these records only
for answer section and had a special case for NS
records.
cache: non-authoritative NS records are always
unchecked and must be treated as insecure
affected: www.iana.org trying to provide
delegation information for CNAME target, which is
moot with CNAME target explicit-fetch policy unless
the the resolver already knows DNSKEY with which
is could verify the records
Marek Vavrusa [Fri, 22 Jan 2016 23:59:40 +0000 (15:59 -0800)]
daemon/lua: rrset printing, new flags
this is a temporary change until luajit-kdns is
merged-in with complete functionality,
this will break the API later and will require a
couple changes in several modules and trust anchors
Marek Vavrusa [Fri, 22 Jan 2016 07:48:58 +0000 (23:48 -0800)]
scripts: kresd-query.lua (new)
this is a boilerplate for a CLI utility to resolve
names and execute script on query response
in another words, "a jq for resolver answers"
this is a scaffolding for alternative tools like
'host' or a plug-in part for scripting around it.
it basically starts a kresd instance, but doesn't
bind to any interface or read configuration,
then a query + callback is sent to kresd standard
input, and it quits after the execution
Marek Vavrusa [Fri, 22 Jan 2016 07:42:17 +0000 (23:42 -0800)]
lib/resolve: new flag ALWAYS_CUT
when raised, a response zone cut will be recovered
even if the response came from cache. this is
normally not needed (and incurs additional cache
lookups), but it may be useful for
inspection
Marek Vavrusa [Tue, 19 Jan 2016 20:27:23 +0000 (12:27 -0800)]
lib/iterate: ignore out-of-bailiwick NSs for positive answers
there are broken resolution chains where a zone cut is advertised,
but it doesn't exist and the final NS answers from its parent's
zone cut, which is an attempt to escape bailiwick
example:
resolving A ab.cd.ef
NS ef responds:
- ab.cd.ef NS X ; adverises ab.cd.ef zone cut
X responds:
- A ab.cd.ef A 1.2.3.4
- cd.ef NS X ; escapes previously advertised cut
on the other hand, it is important to fail early for referrals as
it signifies a lame answer
Marek Vavrusa [Tue, 19 Jan 2016 20:27:23 +0000 (12:27 -0800)]
lib/iterate: ignore out-of-bailiwick NSs for positive answers
there are broken resolution chains where a zone cut is advertised,
but it doesn't exist and the final NS answers from its parent's
zone cut, which is an attempt to escape bailiwick
example:
resolving A ab.cd.ef
NS ef responds:
- ab.cd.ef NS X ; adverises ab.cd.ef zone cut
X responds:
- A ab.cd.ef A 1.2.3.4
- cd.ef NS X ; escapes previously advertised cut
on the other hand, it is important to fail early for referrals as
it signifies a lame answer
Pavel Valach [Tue, 12 Jan 2016 22:13:02 +0000 (23:13 +0100)]
Updated README.md Docker info
Updated Docker run command, because without -it (interactive) switch, kresd would freeze upon startup on [system] interactive mode. That may as well be a defect, but adding -it helps in all cases.
Also updated the URL to the correct address (you'd get redirected automatically, but still).