I already installed the resolver-debug package in the past so I just started it. Detailed log messages from kresd can then be seen in /var/log/messages
.
I run the dig command with different domain names to do some tests. Here is an example of domain name resolution that failed:
2018-12-16 16:50:00 info kresd[12772]: [ 0][plan] plan 'forum.turris.cz.' type 'A'
2018-12-16 16:50:00 info kresd[12772]: [14463][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 16:50:00 info kresd[12772]: [14463][cach] => skipping exact packet: rank 025 (min. 020), new TTL -5629
2018-12-16 16:50:00 info kresd[12772]: [14463][cach] => skipping unfit CNAME RR: rank 060, new TTL -227
2018-12-16 16:50:00 info kresd[12772]: [14463][cach] => skipping unfit NS RR: rank 040, new TTL -3683
2018-12-16 16:50:00 info kresd[12772]: [14463][cach] => no NSEC* cached for zone: cz.
2018-12-16 16:50:00 info kresd[12772]: [14463][cach] => skipping zone: cz., NSEC, hash 0;new TTL -1234304552, ret -2
2018-12-16 16:50:00 info kresd[10213]: Last message '[14463][cach] => s' repeated 1 times, suppressed by syslog-ng on turris
2018-12-16 16:50:00 info kresd[12772]: [14463][resl] => going insecure because there's no covering TA
2018-12-16 16:50:00 info kresd[12772]: [14463][zcut] found cut: cz. (rank 002 return codes: DS 0, DNSKEY 0)
2018-12-16 16:50:00 info kresd[12772]: [60103][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 16:50:00 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.12.1, score 1900
2018-12-16 16:50:00 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.13.1, score 1900
2018-12-16 16:50:00 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.14.1, score 1900
2018-12-16 16:50:00 info kresd[12772]: [60103][resl] => querying: '193.29.206.1' score: 1334 zone cut: 'cz.' qname: 'tURrIs.CZ.' qtype: 'NS' proto: 'udp'
2018-12-16 16:50:00 info kresd[12772]: [60103][iter] <= loaded 4 glue addresses
2018-12-16 16:50:00 info kresd[12772]: [60103][iter] <= rcode: NOERROR
2018-12-16 16:50:00 info kresd[12772]: [60103][iter] <= retrying with non-minimized name
2018-12-16 16:50:00 info kresd[12772]: [60103][cach] => not overwriting A b.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [60103][cach] => not overwriting A c.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [60103][cach] => not overwriting A d.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [60103][cach] => not overwriting A a.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [60103][resl] <= server: '193.29.206.1' rtt: 24 ms
2018-12-16 16:50:00 info kresd[12772]: [41054][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 16:50:00 info kresd[12772]: [41054][resl] => querying: '193.29.206.1' score: 679 zone cut: 'cz.' qname: 'foRUm.TURRIs.Cz.' qtype: 'A' proto: 'udp'
2018-12-16 16:50:00 info kresd[12772]: [41054][iter] <= loaded 4 glue addresses
2018-12-16 16:50:00 info kresd[12772]: [41054][iter] <= rcode: NOERROR
2018-12-16 16:50:00 info kresd[12772]: [41054][iter] <= lame response: non-auth sent negative response
2018-12-16 16:50:00 info kresd[12772]: [41054][cach] => not overwriting A b.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [41054][cach] => not overwriting A d.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [41054][cach] => not overwriting A a.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [41054][cach] => not overwriting A c.ns.nic.cz.
2018-12-16 16:50:00 info kresd[12772]: [41054][resl] => server: '193.29.206.1' flagged as 'bad'
2018-12-16 16:50:00 info kresd[12772]: [31144][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 16:50:00 info kresd[12772]: [31144][resl] => no valid NS left
2018-12-16 16:50:00 info kresd[12772]: [28800][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 16:50:00 info kresd[12772]: [28800][resl] => no valid NS left
2018-12-16 16:50:00 info kresd[12772]: [ 0][resl] AD: request NOT classified as SECURE
2018-12-16 16:50:00 info kresd[12772]: [28800][resl] finished: 0, queries: 1, mempool: 16392 B
You can see the message server '193.29.206.1' flagged as 'bad
. However, when the vpn is turned off, there is no such message for that IP address:
2018-12-16 17:01:33 info kresd[12772]: [ 0][plan] plan 'forum.turris.cz.' type 'A'
2018-12-16 17:01:33 info kresd[12772]: [41846][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 17:01:33 info kresd[12772]: [41846][cach] => skipping exact packet: rank 025 (min. 020), new TTL -6322
2018-12-16 17:01:33 info kresd[12772]: [41846][cach] => skipping unfit CNAME RR: rank 020, new TTL 1601
2018-12-16 17:01:33 info kresd[12772]: [41846][cach] => skipping unfit NS RR: rank 040, new TTL -4376
2018-12-16 17:01:33 info kresd[12772]: [41846][cach] => no NSEC* cached for zone: cz.
2018-12-16 17:01:33 info kresd[12772]: [41846][cach] => skipping zone: cz., NSEC, hash 0;new TTL 116, ret -2
2018-12-16 17:01:33 info kresd[10213]: Last message '[41846][cach] => s' repeated 1 times, suppressed by syslog-ng on turris
2018-12-16 17:01:33 info kresd[12772]: [41846][resl] => going insecure because there's no covering TA
2018-12-16 17:01:33 info kresd[12772]: [41846][zcut] found cut: cz. (rank 002 return codes: DS 0, DNSKEY 0)
2018-12-16 17:01:33 info kresd[12772]: [64790][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 17:01:33 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.12.1, score 1900
2018-12-16 17:01:33 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.13.1, score 1900
2018-12-16 17:01:33 info kresd[12772]: [ ][nsre] probing timeouted NS: 194.0.14.1, score 1900
2018-12-16 17:01:33 info kresd[12772]: [64790][resl] => querying: '193.29.206.1' score: 34 zone cut: 'cz.' qname: 'tuRRIS.cZ.' qtype: 'NS' proto: 'udp'
2018-12-16 17:01:33 info kresd[12772]: [64790][iter] <= rcode: NOERROR
2018-12-16 17:01:33 info kresd[12772]: [64790][iter] <= continuing with qname minimization
2018-12-16 17:01:33 info kresd[12772]: [64790][resl] <= server: '193.29.206.1' rtt: 31 ms
2018-12-16 17:01:33 info kresd[12772]: [58600][iter] 'forum.turris.cz.' type 'A' id was assigned, parent id 0
2018-12-16 17:01:33 info kresd[12772]: [58600][resl] => querying: '193.29.206.1' score: 32 zone cut: 'turris.cz.' qname: 'ForUM.tuRrIS.cz.' qtype: 'A' proto: 'udp'
2018-12-16 17:01:33 info kresd[12772]: [58600][iter] <= rcode: NOERROR
2018-12-16 17:01:33 info kresd[12772]: [58600][cach] => not overwriting A proxy.turris.cz.
2018-12-16 17:01:33 info kresd[12772]: [58600][cach] => not overwriting CNAME forum.turris.cz.
2018-12-16 17:01:33 info kresd[12772]: [58600][resl] <= server: '193.29.206.1' rtt: 34 ms
2018-12-16 17:01:33 info kresd[12772]: [ 0][resl] AD: request NOT classified as SECURE
2018-12-16 17:01:33 info kresd[12772]: [58600][resl] finished: 0, queries: 1, mempool: 16392 B
So why this bad flag when the vpn is on? I don’t know enough how DNS servers work to understand the problem. Is it related to the score value?
Edit: disabling DNSSEC in Foris does not solve the problem.