1034 Resolver Algo Question

William Stacey staceyw at mvps.org
Thu Aug 19 01:59:11 UTC 2004


I also have questions on 4c of 5.3.3
         "c. if the response shows a CNAME and that is not the
            answer itself, cache the CNAME, change the SNAME to the
            canonical name in the CNAME RR and go to step 1."

1) Why does it say "and that is not the answer itself"?  If it was the
answer, 4a would have returned it already - no?

2) It does not say anything about saving the CNAME rr anywhere.  You change
the Sname to the canonical name in the RR and start at step 1 again.  What
happens to the CNAME we just processed?  Lost?  Or do you keep building an
answer section in a tmp reply structure until done or error?

Thanks again.

-- 
William Stacey

"William Stacey" <staceyw at mvps.org> wrote in message
news:cg0eo3$qb0$1 at sf1.isc.org...
> Trying to do some pseudocode to get my head around resolver process
better.
> Is this close or could you please change or add to fix?  TIA.
>
> ///
> /// 5.3.3 Algorithm Pseudocode
> ///
> Step1:
>     reply = IsLocal(question);
>     if ( reply != null )
>         return reply;
>
> Step2:
>     slist = FindBestServers(question)
>
> Step3:
>     reply = slist.Ask(question)
>
> Step4:
>     if ( reply.Header.RCode == RCode.NoError )
>     {
>         if ( reply.AnswerSection.Count > 0 )
>         {
>             if ( answersection answers the question ? ) // 4a.
>             {
>                 CacheReply(reply);
>                 return reply;
>             }
>             if ( answer is CNAME ? ) // 4c.
>             {
>                 CacheCName(reply);
>                 question.SName = GetCName(reply);
>                 goto Step1;
>             }
>         }
>         if ( reply.AuthoritySection.Count > 0 ) // 4b.
>         {
>             CacheNS(reply);
>             goto Step2;
>         }
>         else
>             // nxrrset ? - noerror + noAnswers + noDelegations
>             Error("bad reply"); // Not sure this is needed or what to do
> here.
>     }
>     else if ( nxdomain ) // Part of 4a.
>     {
>         CacheNX(reply);
>         return reply;
>     }
>     else // 4d.
>     {
>        slist.RemoveCurrentServer();
>        goto Step3;
>     }
> /// Done
>
> -- 
> William Stacey
>
>
>



More information about the bind-users mailing list