diff --git a/sys/src/cmd/ndb/dnresolve.c b/sys/src/cmd/ndb/dnresolve.c index 6e2855a8e..eda7a716f 100644 --- a/sys/src/cmd/ndb/dnresolve.c +++ b/sys/src/cmd/ndb/dnresolve.c @@ -1227,9 +1227,10 @@ udpqueryns(Query *qp, int fd, uchar *pkt) for(rp = qp->nsrp; rp; rp = rp->next) rp->marker = 0; - /* request recursion only for local dns servers */ + /* request recursion only for local/override dns servers */ flag = Oquery; - if(strncmp(qp->nsrp->owner->name, "local#", 6) == 0) + if(strncmp(qp->nsrp->owner->name, "local#", 6) == 0 + || strncmp(qp->nsrp->owner->name, "override#", 9) == 0) flag |= Frecurse; /* pack request into a udp message */ diff --git a/sys/src/cmd/ndb/dnsdebug.c b/sys/src/cmd/ndb/dnsdebug.c index a733bbfd7..614c8adbe 100644 --- a/sys/src/cmd/ndb/dnsdebug.c +++ b/sys/src/cmd/ndb/dnsdebug.c @@ -170,15 +170,27 @@ logrequest(int id, int depth, char *send, uchar *addr, char *sname, char *rname, RR* getdnsservers(int class) { - RR *rr; + uchar ip[IPaddrlen]; + DN *nsdp; + RR *rp; if(servername == nil) return dnsservers(class); - - rr = rralloc(Tns); - rr->owner = dnlookup("local#dns#servers", class, 1); - rr->host = idnlookup(servername, class, 1); - return rr; + if(parseip(ip, servername) == -1){ + nsdp = idnlookup(servername, class, 1); + } else { + nsdp = dnlookup("local#dns#server", class, 1); + rp = rralloc(isv4(ip) ? Ta : Taaaa); + rp->owner = nsdp; + rp->ip = ipalookup(ip, class, 1); + rp->db = 1; + rp->ttl = 10*Min; + rrattach(rp, Authoritative); + } + rp = rralloc(Tns); + rp->owner = dnlookup("override#dns#servers", class, 1); + rp->host = nsdp; + return rp; } int