Knot Resolver issueshttps://gitlab.nic.cz/knot/knot-resolver/-/issues2020-08-20T10:05:40+02:00https://gitlab.nic.cz/knot/knot-resolver/-/issues/578test aggressive cache on NSEC3PARAM rotation2020-08-20T10:05:40+02:00Vladimír Čunátvladimir.cunat@nic.cztest aggressive cache on NSEC3PARAM rotationI don't think we have any tests on that in particular, though the code's been deployed for a long time. Still, most of possible failures I can imagine should only lead to insufficient caching.
Hints around how the implementation works:...I don't think we have any tests on that in particular, though the code's been deployed for a long time. Still, most of possible failures I can imagine should only lead to insufficient caching.
Hints around how the implementation works:
- NSEC3PARAM is the [data collected](https://tools.ietf.org/html/rfc5155#section-4.2) but it's taken from NSEC3 records directly.
- For this purpose, using NSEC is like one more possible NSEC3PARAM configuration.
- Reading from cache is designed to consider the last two NSEC3PARAMs that's been written for that zone.
- Code reference: identifiers containing `nsec_p`.https://gitlab.nic.cz/knot/knot-resolver/-/issues/573net.tls() allow usage of multiple certificates2020-10-08T11:43:59+02:00Tomas Krizeknet.tls() allow usage of multiple certificatesECC certificates provide superior performance to RSA keys of comparable security. Supporting multiple certificate files in `net.tls()` could lead to improved DNS-over-TLS performance without sacrificng compatibility with older clients, i...ECC certificates provide superior performance to RSA keys of comparable security. Supporting multiple certificate files in `net.tls()` could lead to improved DNS-over-TLS performance without sacrificng compatibility with older clients, if both ECC and RSA certificates could be used simulataneously.https://gitlab.nic.cz/knot/knot-resolver/-/issues/569clarify respdiff job names in CI2020-10-19T11:16:35+02:00Petr Špačekclarify respdiff job names in CIMostly note for myself:
especially forwarding scenarios have confusing names
Find better naming structure and fix it.
Rename will break a lot of stuff so schedule this when we have time for it.Mostly note for myself:
especially forwarding scenarios have confusing names
Find better naming structure and fix it.
Rename will break a lot of stuff so schedule this when we have time for it.https://gitlab.nic.cz/knot/knot-resolver/-/issues/568Some cases of DNS resolution from lua fail if OS provides only IPv6 resolvers2020-04-24T10:04:07+02:00Vladimír Čunátvladimir.cunat@nic.czSome cases of DNS resolution from lua fail if OS provides only IPv6 resolversConditions:
- `resolv.conf` only containing IPv6 nameservers. Mix works OK. I believe that very few people have IPv6-only there, luckily.
- Use DNS resolution based on `lua-cqueues`, e.g. `prefill` module or root trust anchors bootst...Conditions:
- `resolv.conf` only containing IPv6 nameservers. Mix works OK. I believe that very few people have IPv6-only there, luckily.
- Use DNS resolution based on `lua-cqueues`, e.g. `prefill` module or root trust anchors bootstrapping – both only after !894 (kresd >= 5.0.0).
Result example:
```
[prefill] fetch of `https://www.internic.net/domain/root.zone` failed: HTTP client library error: A non-recoverable error occurred when attempting to resolve the name (-1684960053)), will retry root zone download in 09 minutes 59 seconds
```
This is a problem in lua libraries that we've chosen to use: https://github.com/wahern/dns/issues/23https://gitlab.nic.cz/knot/knot-resolver/-/issues/551client retry logic on TCP/TLS connection closure2020-10-22T13:58:57+02:00Vladimír Čunátvladimir.cunat@nic.czclient retry logic on TCP/TLS connection closureWhen remote server closes a connection without answering a part of our queries, the corresponding requests get failed too aggressively (perhaps? TODO: details, etc.)
Most interesting parts of standards is [7766](https://tools.ietf.org/h...When remote server closes a connection without answering a part of our queries, the corresponding requests get failed too aggressively (perhaps? TODO: details, etc.)
Most interesting parts of standards is [7766](https://tools.ietf.org/html/rfc7766#section-6.2.4):
> DNS clients SHOULD retry unanswered queries if the connection closes before receiving all outstanding responses.
On the other hand servers SHOULD not close the connections early, without reasons for the particular case... so hopefully this won't happen that often in practice; [FRITZ!](https://forum.turris.cz/t/dns-over-tcp-just-a-single-transaction/12003/11) seems a notable case. _I'll keep copying the important points from that discussion to here._https://gitlab.nic.cz/knot/knot-resolver/-/issues/537module API redesign2020-11-30T17:52:59+01:00Petr Špačekmodule API redesignProblem statement
-----------------
- Current module API is not well defined and does not provide sufficient abstraction
- As a result, modules are not isolated and must know about internals of other modules (e.g. modules resetting reque...Problem statement
-----------------
- Current module API is not well defined and does not provide sufficient abstraction
- As a result, modules are not isolated and must know about internals of other modules (e.g. modules resetting request state must also reset `req.*_selected` arrays)
- Mixing wire-format-generating modules with modules relying on `req.*_selected` arrays leads to weird bugs (one example: !842, !851, !859)
- Lua modules seem to be slow (because of the way how C code calls Lua?)
Related tickets
---------------
- #363 Modules need generic way to persist own state
- #432 Modules need ability to not respond at all (for response rate limiting)
- #483 Modules currently cannot generate answer if no NS is responding
- #447 New server selection system should expose and use API instead of being hard-wired
- #396 SERVFAIL answer can still contain bogus RRsets
- #471 low-level protocol stuff is hard-coded (incorrectly)
- #36 make sure new API does not get in the way when implementing parallel queries
- #527 modules need a way to cooperate with fine-grained logging
- #418 engine object access - I don't know if this requirement will be still valid after redesign, but let's think about it
- #264 error reporing from modules sucks
- #234 a way to cooperate between modules??? e.g. for DNAME support???
- attempt to move `reorder_RR()` into module, ideally in a form of policy action so it can be triggered on per-client basis - what API would be necessary?
Objective
---------
Design a new API for modules in a way which prevents bugs stemming from bad API usage from ever repeating again.
Implementation is expected to be a long-term project, but we need proper design first. Hopefully #447, #535 and other tasks planned for 2020 will provide us sufficient experience for better API design.2020 Q4https://gitlab.nic.cz/knot/knot-resolver/-/issues/535declarative policy module and other user-supplied DNS data2024-02-28T12:15:39+01:00Petr Špačekdeclarative policy module and other user-supplied DNS dataCurrent problem
---------------
Our current imperative policy module is using chain of Lua functions: This is quite slow and hard to use for non-programmers.
Proposal
--------
Design a new method to configure "policies", preferably in a...Current problem
---------------
Our current imperative policy module is using chain of Lua functions: This is quite slow and hard to use for non-programmers.
Proposal
--------
Design a new method to configure "policies", preferably in a declarative way. By "policies" I mean a generic way to influence resolving and inject user-supplied data into DNS tree or block other stuff.
A declarative way should be more intuitive to use than writing Lua functions, and also faster if we design it right.
Here is incomplete list of stuff we might want to express.
- [x] ability to also block sub-queries, e.g. when following CNAMEs (#217)
- [ ] ability to block RR data - e.g. rebinding protection, blacklist of NS names etc. (#523)
- [x] ACLs (including negative ACLs, #370)
- [x] merge views with other policies (see also #445)?
- [x] redirecting specific zones to user-configured servers (#428, !651)
- [ ] beware that we need also port number, not just IP address
- [x] theoretical "helper" NS+glue records from kresd config should not be retrievable from outside
- FORWARDing
- TLS forwarding has many knobs and might need even more: #481
- do we still need STUB policy? If so see #218
- FORWARDing might need exceptions for some subtrees (see e.g. https://lists.nlnetlabs.nl/pipermail/unbound-users/2019-December/006560.html)
- generally special EDNS tricks: #314, #303; also improve #657
- special cache semantics (do not cache this sub-tree, limit TTL in this sub-tree)
- maybe DNS64 module should be merged with policies and ACLs: #368
- [x] maybe hints module should be merged in as well (see also #205, #349)
- [x] maybe also a way to provide other user-supplied data - #540
* (well, more ways can always be added)
- maybe prefill module should be merged as well (see also #417)
- think of interaction with daf module (beware of #183)
* `@vcunat` would prefer to deprecate DAF,
but theoretically we could think of translating DAF rules into the new policy rules
- design should be able to support full strength of RPZ (example of a problem: #194)
* the most common features are in 6.0.x – CNAME redirection in particular, and interacting well with other rules (multiple rules of different kinds can trigger when jumping through CNAME chains)
- design needs to support efficient mechanism which mimicks RPZ with zone transfer including IXFR(!) (#195)
- build mechanism for better visibility into policies (#364)
- it needs to work with huge lists (apparently users want to have long block lists, see https://lists.nlnetlabs.nl/pipermail/unbound-users/2019-December/006559.html)
* improved in 6.0.x: shared inside LMDB across all processes, but efficiency of restarts/reloads/updates could be significantly improved (as of 6.0.6)
- [x] open question: at which stage should the module kick in? Can it be e.g. used to implement `ignore-cd-flag` policy as seen in Unbound?
* the `view:` part can be used to set such options, though there's no ignore-cd in particular so far
- per-domain setting for rate-limits e.g. like `ratelimit-below-domain`, `ratelimit-for-domain` etc. like in Unbound
* [ ] first per-user changes in rate-limits in `views:` (when we have any rate-limiting)
- [x] special handling for reserved and local-only names: see #205 and think it through2020 Q2https://gitlab.nic.cz/knot/knot-resolver/-/issues/534CI: test server selection algorithm2019-12-18T19:41:28+01:00Petr ŠpačekCI: test server selection algorithmImplement https://gitlab.labs.nic.cz/knot/maze/ into Knot Resolver's CI.
Ideas:
- Gitlab shell executor in a VM with sudo access (yuck!)
- shell executor to a VM with a systemd build which contains https://github.com/systemd/systemd/pul...Implement https://gitlab.labs.nic.cz/knot/maze/ into Knot Resolver's CI.
Ideas:
- Gitlab shell executor in a VM with sudo access (yuck!)
- shell executor to a VM with a systemd build which contains https://github.com/systemd/systemd/pull/138232020 Q1Štěpán BalážikŠtěpán Balážikhttps://gitlab.nic.cz/knot/knot-resolver/-/issues/532OCSP stapling for client side2019-12-18T15:28:32+01:00Petr ŠpačekOCSP stapling for client sideFor client side (TLS_FORWARD) we could get inspired by [`kdig +tls-ocsp-stapling`](https://github.com/CZ-NIC/knot/pull/13).For client side (TLS_FORWARD) we could get inspired by [`kdig +tls-ocsp-stapling`](https://github.com/CZ-NIC/knot/pull/13).https://gitlab.nic.cz/knot/knot-resolver/-/issues/517OCSP stapling for server side2019-12-18T15:28:32+01:00Vladimír Čunátvladimir.cunat@nic.czOCSP stapling for server sideOCSP stapling seems to make much sense for server side as well, at least at a quick look.OCSP stapling seems to make much sense for server side as well, at least at a quick look.https://gitlab.nic.cz/knot/knot-resolver/-/issues/511Add VRF support2020-02-05T14:57:09+01:00krombelAdd VRF supportI try to run knot-resolver in a vrf.
I want the /metric endpoint to be accessible only internally but resolving DoH/DoT over a vrf-interface which is meant to be for external requests.I try to run knot-resolver in a vrf.
I want the /metric endpoint to be accessible only internally but resolving DoH/DoT over a vrf-interface which is meant to be for external requests.https://gitlab.nic.cz/knot/knot-resolver/-/issues/488can't reliably fetch stats when using SO_REUSEPORT2020-06-15T09:35:13+02:00Jean-Danielcan't reliably fetch stats when using SO_REUSEPORTI'm using knot resolver with systemd, and want to use the stats module + http module to fetch stats in prometheus format.
My problem is that if I start more that one instance (kresd@1, kresd@2, …), stats fetching requests are distribute...I'm using knot resolver with systemd, and want to use the stats module + http module to fetch stats in prometheus format.
My problem is that if I start more that one instance (kresd@1, kresd@2, …), stats fetching requests are distributed among the instances and returns only the stats from the answering instance.
I can't get a reliable way to fetch the stats in such configuration.
Workaround:
I can fetch and aggregate individual workers stats from the controls sockets, but the control socket is very unreliable (it is not able to properly parse 2 successives queries properly and often try to interpret them as a single query).https://gitlab.nic.cz/knot/knot-resolver/-/issues/483DNS64 does not synthesise if AAAA query fails but A query works2019-12-18T19:56:41+01:00Petr ŠpačekDNS64 does not synthesise if AAAA query fails but A query worksQuery for `internetbanken.privat.nordea.se. AAAA` ends up with SERVFAIL because it is broken on the authoritative side, but query `internetbanken.privat.nordea.se. A` succeeds.
https://tools.ietf.org/html/rfc6147#section-5.1.2 seems to ...Query for `internetbanken.privat.nordea.se. AAAA` ends up with SERVFAIL because it is broken on the authoritative side, but query `internetbanken.privat.nordea.se. A` succeeds.
https://tools.ietf.org/html/rfc6147#section-5.1.2 seems to specify (using pretty convoluted language), that any failure in AAAA resolving should trigger A subquery and DNS64 synthesis.
This was reported during RIPE 78 meeting because some people were not able to reach their bank website.
I can see two problems with current DNS64 module (as in Knot Resolver 4.0.0):
- Failed AAAA query does not trigger synthesis, e.g. if we get SERVFAIL. This should be easy to fix.
- AAAA query which fails because of all NS servers do not respond for AAAA query will not call `consume()` layer in module, and thus DNS64 module does not get a chance to do A query and synthesis. This will be harder to fix.https://gitlab.nic.cz/knot/knot-resolver/-/issues/481FORWARD/TLS_FORWARD: support forwarding to hostname, DANE2019-12-18T19:15:02+01:00Tomas KrizekFORWARD/TLS_FORWARD: support forwarding to hostname, DANEThe `FORWARD` / `TLS_FORWARD` policies currently require an IP address as a target. Instead, a hostname could be provided. However, the initial bootstrap + handling TTL could be quite complex.
If the bootstrap + TTL problem would be sol...The `FORWARD` / `TLS_FORWARD` policies currently require an IP address as a target. Instead, a hostname could be provided. However, the initial bootstrap + handling TTL could be quite complex.
If the bootstrap + TTL problem would be solved, `TLS_FORWARD` could also support DANE [RFC8310#section8.2](https://tools.ietf.org/html/rfc8310#section-8.2)https://gitlab.nic.cz/knot/knot-resolver/-/issues/479NOERROR from pre-RFC 2308 servers is treated as lame2019-05-23T16:40:41+02:00Petr ŠpačekNOERROR from pre-RFC 2308 servers is treated as lameKnot Resolver 4.0.0 does not accept NOERROR answers from pre-RFC 2308 auths, i.e. auths which do not send SOA RR in AUTHORITY section of NOERROR answer.
Example from live Internet:
```
resolve('blogs.cisco.com', kres.type.AAAA, kres.c...Knot Resolver 4.0.0 does not accept NOERROR answers from pre-RFC 2308 auths, i.e. auths which do not send SOA RR in AUTHORITY section of NOERROR answer.
Example from live Internet:
```
resolve('blogs.cisco.com', kres.type.AAAA, kres.class.IN, {}, function(pkt) print(pkt) end)
```
...
```
[65537.22][iter] 'blogs.glb-ext.cisco.com.' type 'AAAA' new uid was assigned .25, parent uid .00
[65537.25][resl] => id: '43849' querying: '72.163.5.22#00053' score: 10 zone cut: 'glb-ext.cisco.com.' qname: 'BLogS.glb-eXT.CiscO.Com.' qtype: 'AAAA' proto: 'udp'
[65537.25][iter] <= answer received:
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 43849
;; Flags: qr cd QUERY: 1; ANSWER: 0; AUTHORITY: 0; ADDITIONAL: 1
;; EDNS PSEUDOSECTION:
;; Version: 0; flags: do; UDP size: 1280 B; ext-rcode: Unused
;; QUESTION SECTION
blogs.glb-ext.cisco.com. AAAA
[65537.25][iter] <= rcode: NOERROR
[65537.25][iter] <= lame response: non-auth sent negative response
```
This seems to be caused by `is_authoritative()` in lib/layer/iterate.c.https://gitlab.nic.cz/knot/knot-resolver/-/issues/475daemon: support AF_UNIX for Do53 and DoT sockets?2020-11-24T16:29:44+01:00Vladimír Čunátvladimir.cunat@nic.czdaemon: support AF_UNIX for Do53 and DoT sockets?I split that away from [AF_UNIX for the other sockets](https://gitlab.labs.nic.cz/knot/knot-resolver/merge_requests/811), because I saw some assumptions in worker and/or session code, and there's been no demand so far. In particular, a ...I split that away from [AF_UNIX for the other sockets](https://gitlab.labs.nic.cz/knot/knot-resolver/merge_requests/811), because I saw some assumptions in worker and/or session code, and there's been no demand so far. In particular, a different libuv handle type would have to be used for AF_UNIX (third case added to UDP and TCP).https://gitlab.nic.cz/knot/knot-resolver/-/issues/473validate: NSEC proofs can confuse NXDOMAIN with NODATA2019-04-30T12:39:49+02:00Vladimír Čunátvladimir.cunat@nic.czvalidate: NSEC proofs can confuse NXDOMAIN with NODATA[Real-life example](https://gitlab.labs.nic.cz/knot/knot-resolver/issues/462#note_104852).
The records get into aggressive cache that doesn't suffer from this bug, so only the first answer can be wrong. So far I can see no security imp...[Real-life example](https://gitlab.labs.nic.cz/knot/knot-resolver/issues/462#note_104852).
The records get into aggressive cache that doesn't suffer from this bug, so only the first answer can be wrong. So far I can see no security implications of exchanging NODATA with NXDOMAIN.https://gitlab.nic.cz/knot/knot-resolver/-/issues/471FORMERR for bad packets2020-10-02T11:06:36+02:00Vladimír Čunátvladimir.cunat@nic.czFORMERR for bad packetsCurrently a request from client is either accepted or _ignored_. We should return `FORMERR` for packets where header looks like DNS.Currently a request from client is either accepted or _ignored_. We should return `FORMERR` for packets where header looks like DNS.https://gitlab.nic.cz/knot/knot-resolver/-/issues/459maintenance daemon2022-05-08T12:13:54+02:00Petr Špačekmaintenance daemonKnot Resolver has bunch of tasks which need to be done only once, so it does not make much sense to do them from all workers independently.
Examples:
- [x] cache cleanup - #257
- [ ] cache import - `zimport` into cache
- [ ] TLS certif...Knot Resolver has bunch of tasks which need to be done only once, so it does not make much sense to do them from all workers independently.
Examples:
- [x] cache cleanup - #257
- [ ] cache import - `zimport` into cache
- [ ] TLS certificate maintenance (DNS-over-TLS, HTTP module)
- [ ] TLS ticket rotation
- [ ] RFC 5011
- [ ] TA bootstrap
... and possibly others.
In long term we might create a "maintenance" daemon which could take care of these tasks so they would not block worker threads (it would also avoid duplication of tasks).
This would require means to communicate between maintenance daemon and workers.https://gitlab.nic.cz/knot/knot-resolver/-/issues/455ugly uv_foo_t * casts all over the place2019-03-12T12:47:18+01:00Vladimír Čunátvladimir.cunat@nic.czugly uv_foo_t * casts all over the placeThe following discussion from !786 should be addressed:
- [ ] @pspacek started a [discussion](https://gitlab.labs.nic.cz/knot/knot-resolver/merge_requests/786#note_100831): (+2 comments)
> Wondering out loud: Would it be nicer if ...The following discussion from !786 should be addressed:
- [ ] @pspacek started a [discussion](https://gitlab.labs.nic.cz/knot/knot-resolver/merge_requests/786#note_100831): (+2 comments)
> Wondering out loud: Would it be nicer if we used union for this? That would avoid explicit retyping all over the place ...