3 @@ -25,6 +25,7 @@ extern void log_nxdomain(const char *,co
4 extern void log_nodata(const char *,const char *,const char *,unsigned int);
5 extern void log_servfail(const char *);
6 extern void log_lame(const char *,const char *,const char *);
7 +extern void log_ignore_referral(const char *,const char *,const char *);
9 extern void log_rr(const char *,const char *,const char *,const char *,unsigned int,unsigned int);
10 extern void log_rrns(const char *,const char *,const char *,unsigned int);
13 @@ -197,6 +197,13 @@ void log_lame(const char server[4],const
17 +void log_ignore_referral(const char server[4],const char * control, const char *referral)
19 + string("ignored referral "); ip(server); space();
20 + name(control); space(); name(referral);
24 void log_servfail(const char *dn)
26 const char *x = error_str(errno);
29 @@ -828,6 +828,18 @@ static int doit(struct query *z,int stat
32 if (!dns_domain_suffix(d,referral)) goto DIE;
34 + /* In strict "forwardonly" mode, we don't, as the manual states,
35 + ** contact a chain of servers according to "NS" resource records.
36 + ** We don't obey any referral responses, therefore. Instead, we
37 + ** eliminate the server from the list and try the next one.
39 + if (flagforwardonly) {
40 + log_ignore_referral(whichserver,control,referral);
41 + byte_zero(whichserver,4);
45 control = d + dns_domain_suffixpos(d,referral);
46 z->control[z->level] = control;
47 byte_zero(z->servers[z->level],64);