ref: 718e8852262951b2af34ca1e021cd0b37e9a5649
parent: 3384b1e35a288f2e197d9ab75942cb5aa74fb5fc
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 26 16:28:26 EDT 2023
ndb/dns: hack for the caching server for delegated nameservers This is a hack for a delegation to a nameservers that simply do not answer with authorative replies. This results in us asking some higher up nameserver when no answer is returned, but because the ns record is itself already authorative, it wont be able to update any new info (rrattach()). Instead, we cut the search short if the nameserver ns record is set as authorative in ndb (with soa=). it is a unfortunate hack because this behaviour cannot be implemented for non-caching server as it does not load the authorative areas (inmyarea()).
--- a/sys/src/cmd/ndb/dnresolve.c
+++ b/sys/src/cmd/ndb/dnresolve.c
@@ -337,6 +337,10 @@
if(nsrp){
rrfreelistptr(&dbnsrp);
+ /* hack: stop search if ns is authoritative in db */
+ if(cfg.cachedb && nsrp->db && nsrp->auth)
+ cp = "";
+
/* query the name servers found in cache */
if(netqueryns(qp, depth+1, nsrp) > Answnone)
return rrlookup(qp->dp, qp->type, OKneg);
--
⑨