Hi,
I'm looking at knot-1.6.1 after have experienced failure with sending
AXFR after a zone grew due to enabling DNSSEC, adding a lot of records.
I don't know much about iovecs, but isn't this a short write?
--8<---------------cut here---------------start------------->8---
libknot/internal/errcode.h:
enum knot_error {
...
KNOT_ECONNREFUSED = -ECONNREFUSED,
...
KNOT_ERROR_MIN = -1000,
...
KNOT_ERROR = KNOT_ERROR_MIN,
...
KNOT_ECONN,
...
};
libknot/internal/net.c:
int tcp_send_msg(int fd, const uint8_t *msg, size_t msglen)
{
...
int total_len = iov[0].iov_len + iov[1].iov_len;
int sent = writev(fd, iov, 2);
if (sent != total_len) {
return KNOT_ECONN;
}
...
}
knot/server/tcp-handler.c:
tcp_handle()
{
...
while (state & (NS_PROC_FULL|NS_PROC_FAIL)) {
uint16_t tx_len = tx->iov_len;
state = knot_process_out(tx->iov_base, &tx_len, &tcp->query_ctx);
/* If it has response, send it. */
if (tx_len > 0) {
if (tcp_send_msg(fd, tx->iov_base, tx_len) != tx_len) {
ret = KNOT_ECONNREFUSED;
break;
}
}
}
...
}
--8<---------------cut here---------------end--------------->8---
Happy to file a bug report if that's a more proper way of reporting
bugs.
This patch adds a new "forced generic" dump style which dumps resource
record types and data in the generic RFC 3597 representation format,
even for known resource record types. A corresponding +generic option to
kdig enables this dump style.
Generic representation format is very handy when dealing with older DNS
software that may not support a new resource record type, or with
systems where it is more convenient to use the generic format even with
known types. It is also a nice debugging / educational feature. (No need
to fire up Wireshark.)
---
man/kdig.1.in | 3 +++
src/libknot/rrset-dump.c | 10 +++++++++-
src/libknot/rrset-dump.h | 2 ++
src/utils/kdig/kdig_params.c | 13 +++++++++++++
4 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/man/kdig.1.in b/man/kdig.1.in
index 4772e27..b6f2286 100644
--- a/man/kdig.1.in
+++ b/man/kdig.1.in
@@ -178,6 +178,9 @@ Use EDNS version (default is 0).
Disable IDN transformation to ASCII and vice versa.
IDNA2003 support depends on libidn availability during project building!
.TP
+.BR +generic
+Use the generic representation format when printing resource record types and data.
+.TP
.BI +client= SUBN
Set EDNS client subnet SUBN=IP/prefix.
.TP
diff --git a/src/libknot/rrset-dump.c b/src/libknot/rrset-dump.c
index dd4625d..2f503c1 100644
--- a/src/libknot/rrset-dump.c
+++ b/src/libknot/rrset-dump.c
@@ -1774,6 +1774,10 @@ int knot_rrset_txt_dump_data(const knot_rrset_t *rrset,
return ret;
}
+ if (style->generic) {
+ return dump_unknown(&p);
+ }
+
switch (rrset->type) {
case KNOT_RRTYPE_A:
ret = dump_a(&p);
@@ -1941,7 +1945,11 @@ int knot_rrset_txt_dump_header(const knot_rrset_t *rrset,
}
// Dump rrset type.
- if (knot_rrtype_to_string(rrset->type, buf, sizeof(buf)) < 0) {
+ if (style->generic) {
+ if (snprintf(buf, sizeof(buf), "TYPE%u", rrset->type) < 0) {
+ return KNOT_ESPACE;
+ }
+ } else if (knot_rrtype_to_string(rrset->type, buf, sizeof(buf)) < 0) {
return KNOT_ESPACE;
}
if (rrset->rrs.rr_count > 0) {
diff --git a/src/libknot/rrset-dump.h b/src/libknot/rrset-dump.h
index 4519159..e44cca3 100644
--- a/src/libknot/rrset-dump.h
+++ b/src/libknot/rrset-dump.h
@@ -46,6 +46,8 @@ typedef struct {
bool human_ttl;
/*!< Format timestamp as YYYYMMDDHHmmSS. */
bool human_tmstamp;
+ /*!< Force generic data representation. */
+ bool generic;
/*!< ASCII string to IDN string transformation callback. */
void (*ascii_to_idn)(char **name);
} knot_dump_style_t;
diff --git a/src/utils/kdig/kdig_params.c b/src/utils/kdig/kdig_params.c
index ec7ec9f..6fafb22 100644
--- a/src/utils/kdig/kdig_params.c
+++ b/src/utils/kdig/kdig_params.c
@@ -54,6 +54,7 @@ static const style_t DEFAULT_STYLE_DIG = {
.empty_ttl = false,
.human_ttl = false,
.human_tmstamp = true,
+ .generic = false,
.ascii_to_idn = name_to_idn
},
.show_query = false,
@@ -551,6 +552,15 @@ static int opt_noidn(const char *arg, void *query)
return KNOT_EOK;
}
+static int opt_generic(const char *arg, void *query)
+{
+ query_t *q = query;
+
+ q->style.style.generic = true;
+
+ return KNOT_EOK;
+}
+
static int opt_nsid(const char *arg, void *query)
{
query_t *q = query;
@@ -805,6 +815,8 @@ static const param_t kdig_opts2[] = {
/* "idn" doesn't work since it must be called before query creation. */
{ "noidn", ARG_NONE, opt_noidn },
+ { "generic", ARG_NONE, opt_generic },
+
{ "client", ARG_REQUIRED, opt_client },
{ "time", ARG_REQUIRED, opt_time },
@@ -1363,6 +1375,7 @@ static void kdig_help(void)
" +[no]nsid Request NSID.\n"
" +[no]edns=N Use EDNS (=version).\n"
" +noidn Disable IDN transformation.\n"
+ " +generic Use generic representation format.\n"
" +client=SUBN Set EDNS client subnet IP/prefix.\n"
" +time=T Set wait for reply interval in seconds.\n"
" +retry=N Set number of retries.\n"
--
2.1.4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi,
does Knot have a feature like "rndc stats" in BIND or "nsd-control
stats" that allows you to get some statistics about how many queries
were handled and what their result were (like SERVFAIL etc.)?
Julian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJU8zytAAoJECLcYT6QIdBtLg8P/2wF5gwHQigZ5dI5S2pztM0C
ryKAV5h6mqSuO91S+qA7IAP3GpAlzs5GrNYW9kGXspo+w9mwb/D5+mNhDSOGyoW9
iItT16TATzwpNK89Gw2uRhVJ2BhYTuQTmrp3WwAYHAe6wYGOQdBtZoel5UzSrm5e
I//3DFgmpGHSwITRcxOBl2MYhRpHEhiBQdUjk2MmTcy/L3GF1HMlY2oHuy4sFZk+
lL6x9N/NX/6K5OspF8p8eoNQ7LIBIA6OKNhz08SdsAKSe1F76pL+FPnb8iQUC6Ao
EXkdeFftxOxocL+TTSpAhqEF86IXvRsiNSic8wjYXt9blsMcOAJQFNgU25Bs5+IV
u8EtZgcusq5SbHD0Dp5wYkNV4BYYmjU2omzjxMtqV4MFZG9V8XFlXbfVwC64fsUe
YfYjvK071EK2hVHTrui637tnS8uEcTJa0X8lpCEgYsy+6/EGyQ3H/8eyu77jZT57
yeZnfG4Ai/QrgS6w3jEu3+uk+kwds2wYHqHbIIw3o0GQ8awQ0kPC6tKg0dXI7aFN
tlYBM0mycQv3hFSk7x6jxJ1UPWVxdIOrNg8Vgg8FsgWnXu+JHJJxEV7uoj5DogTJ
PaSFOQccTrVoa1vwJgiHLmOALdY/5FDb9cddN1GBgj2wqcUkS/hR8tSRNXkLShhX
BTijrkJTR8qeiEEFgthp
=bPR2
-----END PGP SIGNATURE-----
Hello everyone,
on behalf of CZ.NIC Labs, I would like to announce Knot DNS 1.6.2. The
patch release contains one new feature and a few small bug fixes.
With the new version, a number of concurrent TCP clients connected to
the server can be limited. The limit is set using the 'max-tcp-clients'
configuration option in the 'system' section. Purpose of this setting is
to avoid resource exhaustion when the server is under a load. And the
default value for the option is 100.
When the limit is hit, new connections are not being accepted for a few
seconds. Active connections are not affected. Please note, that we have
also slightly lowered defaults for TCP idling timeouts.
As for the bug fixes: A possible file descriptor leak when terminating
inactive TCP clients was fixed. Scheduled events for zones switched from
slave mode to master mode are handled correctly. And compilation of
Dnstap features on FreeBSD works now.
Full changelog:
https://gitlab.labs.nic.cz/labs/knot/blob/v1.6.2/NEWS
Sources:
https://secure.nic.cz/files/knot-dns/knot-1.6.2.tar.xzhttps://secure.nic.cz/files/knot-dns/knot-1.6.2.tar.gz
GPG signatures:
https://secure.nic.cz/files/knot-dns/knot-1.6.2.tar.xz.aschttps://secure.nic.cz/files/knot-dns/knot-1.6.2.tar.gz.asc
Thank you for using Knot DNS.
Best Regards,
Jan
--
Jan Včelák, Knot DNS
CZ.NIC Labs https://www.knot-dns.cz
--------------------------------------------
Milešovská 5, 130 00 Praha 3, Czech Republic
WWW: https://labs.nic.czhttps://www.nic.cz
Hello everyone!
After months of keeping our secrets, we would like to share with you a preview
of a new DNSSEC implementation in Knot DNS. The new DNSSEC will be one of the
key features for the upcoming Knot DNS 2.0.
If you are watching our source repository, you may have noticed a tag v1.99.0
appearing silently at the end of 2014. At that time, Knot DNS was already
using the newly implemented DNSSEC, but the only visible change was a
different key format. And internally, GnuTLS/Nettle was replaced OpenSSL for
cryptographic operations.
Today, CZ.NIC Labs releases Knot DNS 1.99.1. The next step towards the 2.0.
Knot DNS 1.99.1 adds initial support for DNSSEC KASP (Key And Signature
Policy). This is our vision of real-world DNSSEC deployment. Essentially, you
define a policy (used algorithm, key sizes, key lifetime, signature lifetime,
etc.) and the server will do the heavy lifting. It will generate keys and
publish/roll them correctly, so you don't have to compute and set timing
meta-data on private keys manually.
At the moment, the KASP support is quite limited: Single algorithm, single
KSK, and single ZSK can be specified in the policy. The server is able to
generate initial keys and perform ZSK rollovers (key pre-publish method).
More features are coming soon.
A documentation on KASP [1] is currently available on the project wiki,
including the reference manual for a new management utility keymgr [2].
[1] https://gitlab.labs.nic.cz/labs/knot/wikis/kasp-setup
[2] https://gitlab.labs.nic.cz/labs/knot/wikis/kasp-keymgr-reference
Source archives are available as usual:
https://secure.nic.cz/files/knot-dns/knot-1.99.1.tar.xzhttps://secure.nic.cz/files/knot-dns/knot-1.99.1.tar.gz
Please note, that Knot DNS 1.99.1 is not ready to replace Knot DNS 1.6.x.
We are looking forward to hear some feedback from you. And we are happy to
answer all your questions and concerns.
Best regards,
Jan
--
Jan Včelák, Knot DNS
CZ.NIC Labs https://www.knot-dns.cz
--------------------------------------------
Milešovská 5, 130 00 Praha 3, Czech Republic
WWW: https://labs.nic.czhttps://www.nic.cz
Good evening,
I don't seem to be able to configure Knot 1.6.1 to sign a zone it slaves
in:
example.com {
file "/usr/local/etc/knot/aa/example.com.zone";
xfr-in home;
dnssec-keydir "/usr/local/etc/knot/aa";
dnssec-enable on;
}
If I omit the two 'dnssec-*' parameters, the zone is slaved in. Adding
them, however, results in no transfer; log shows:
notice: [example.com] automatic DNSSEC signing enabled, disabling incoming XFRs
Is it currently possible with Knot to sign a slaved zone?
Regards,
-JP
Hi,
> How would one go about converting from PowerDNS to KnotDNS on an active
> realtime AnyCast DNS network with maximum seamless efficiency or minimal temporary
> disruption of services to existing DNS users?
>
If it's truly anycast it should only be easier, I would simply:
- stop announcing the anycasted prefix at node #1
- once you see no queries anymore: convert and test
- after finishing: switch on routing
- repeat untill node #last
Unless you have bizarre performance complications, above would be more safe than converting an active node.
Did I maybe misunderstand the question? Or did you mean:
"how to convert from pdns with a transactional SQL backend to a conventional DNS setup with Knot" ..?
Leo
Hello All,
I've decided to use Knot DNS as secondary nameserver for my local zone.
I have several subnets connected via VPN and they have their own
nameservers. So, there are records in my zone
zu-gw.vpn.mithril. 3600 IN A 172.19.0.6
zu.mithril. 3600 IN NS zu-gw.vpn.mithril.
and I want to resolve domain in zu.mithril:
BIND (master):
# dig @tessa.mithril melissa.zu.mithril
; <<>> DiG 9.8.3-P4 <<>> @tessa.mithril melissa.zu.mithril
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7626
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;melissa.zu.mithril. IN A
;; ANSWER SECTION:
melissa.zu.mithril. 0 IN A 172.19.3.1
;; AUTHORITY SECTION:
zu.mithril. 3600 IN NS zu-gw.vpn.mithril.
;; ADDITIONAL SECTION:
zu-gw.vpn.mithril. 3600 IN A 172.19.0.6
;; Query time: 143 msec
;; SERVER: 172.19.37.1#53(172.19.37.1)
;; WHEN: Wed Jan 14 19:24:27 2015
;; MSG SIZE rcvd: 92
KNOT (secondary):
# dig @mira.mithril melissa.zu.mithril
; <<>> DiG 9.8.3-P4 <<>> @mira.mithril melissa.zu.mithril
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10182
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;melissa.zu.mithril. IN A
;; AUTHORITY SECTION:
zu.mithril. 3600 IN NS zu-gw.vpn.mithril.
;; ADDITIONAL SECTION:
zu-gw.vpn.mithril. 3600 IN A 172.19.0.6
;; Query time: 0 msec
;; SERVER: 172.19.38.2#53(172.19.38.2)
;; WHEN: Wed Jan 14 19:24:51 2015
;; MSG SIZE rcvd: 76
I understand that it's happening because of recursion in bind, but how
can I solve this problem in knot?
--
With best regards,
Eugene Bolshakoff
How would one go about converting from PowerDNS to KnotDNS on an active realtime AnyCast DNS network with maximum seamless efficiency or minimal temporary disruption of services to existing DNS users?