[Pdns-users] CNAME confusion?!

Andreas Mimz dnsadmin at kos2.de
Sat Jan 15 14:53:12 UTC 2005


bert hubert wrote:

>Can you try this patch? It is entirely untested, but it might solve the
>problem. Wiebren, your problem too I think.
>
>Index: packethandler.cc
>===================================================================
>--- packethandler.cc	(revision 276)
>+++ packethandler.cc	(working copy)
>@@ -154,7 +154,7 @@
>   DNSResourceRecord rr;
> 
>   if (p->qclass == 3 && p->qtype.getName() == "HINFO") {
>-    rr.content = "PowerDNS $Id: packethandler.cc,v 1.27 2005/01/11 19:41:11 ahu Exp $";
>+    rr.content = "PowerDNS $Id$";
>     rr.ttl = 5;
>     rr.qname=target;
>     rr.qtype=13; // hinfo
>@@ -174,7 +174,7 @@
>   const string mode=arg()["version-string"];
>   if(p->qtype.getCode()==QType::TXT && target=="version.bind") {// TXT
>     if(mode.empty() || mode=="full") 
>-      rr.content="Served by POWERDNS "VERSION" $Id: packethandler.cc,v 1.27 2005/01/11 19:41:11 ahu Exp $";
>+      rr.content="Served by POWERDNS "VERSION" $Id$";
>     else if(mode=="anonymous") {
>       r->setRcode(RCode::ServFail);
>       return 1;
>@@ -353,8 +353,9 @@
>     B.lookup(QType(QType::ANY),target,p);
>         
>     bool shortcut=p->qtype.getCode()!=QType::SOA && p->qtype.getCode()!=QType::ANY;
>-
>+    unsigned hits=0;
>     while(B.get(rr)) {
>+       hits++;
>       if(!rfound && rr.qtype.getCode()==QType::CNAME) {
> 	found=true;
> 	r->addRecord(rr);
>@@ -365,7 +366,7 @@
> 	r->addRecord(rr);
>       }
>     }
>-    if(rfound)
>+    if(hits || rfound)
>       return 1; // ANY lookup found the right answer immediately
> 
>     if(found) {
>
>
>  
>


Hmm the patch didn't work :-( ... same problem! But I'm now not quite 
sure if it's really a problem from the nameserver...

If I do a "dig vbox.yavo.net AAAA @ns2.sk1.net" for example, I get this 
result,

;; QUESTION SECTION:
;vbox.yavo.net.                 IN      AAAA

;; ANSWER SECTION:
vbox.yavo.net.          86400   IN      CNAME   home.yavo.net.
home.yavo.net.          60      IN      CNAME   yavo.net.

;; AUTHORITY SECTION:
yavo.net.               86400   IN      SOA     ns1.sk1.net. 
dnsadmin.sk1.net. 2004121601 10800 3600 604800 86400


so when I open my browser at the office and open vbox.yavo.net, the 
nameserver of the office does an AAAA question first (I don't know for 
what reason), and then the client machine where I'm sitting knows 
already that vbox.yavo.net is an CNAME for home.yavo.net and 
home.yavo.net is an CNAME for yavo.net (which is not correct!!!!). The 
client machine then asks the nameserver only for the A record for 
yavo.net. so the CNAME loop (that's in makeCanonic(), isn't it?) should 
stop if there's an A-Record if I'm asking for an AAAA Record and other 
way round. That would explain why it does work sometimes and why it 
doesn't... because If I'm at home or at a friend the local nameserver 
sends an A-question for vbox.yavo.net, and that's where it gets the 
correct answer.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: question2.txt
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20050115/69c2ef36/attachment-0001.txt>


More information about the Pdns-users mailing list