[Pdns-users] CNAME confusion?!

Wiebren Braakman info at lzn.info
Wed Jan 26 13:31:26 UTC 2005


The patch does not work yes. My test zone:

wiebren.nl.             86400   IN      SOA     ...
wiebren.nl.             86400   IN      NS      localhost
test.wiebren.nl.        86400   IN      A       2.2.2.2
*.wiebren.nl.           86400   IN      CNAME   wiebren.nl.
wiebren.nl.             86400   IN      A       1.1.1.1

The results with "PowerDNS $Id: packethandler.cc 266 2005-01-11 19:41:11Z
ahu $"

dig @localhost test.wiebren.nl A 
	test.wiebren.nl.             86400   IN      A       2.2.2.2 (OK)
dig @localhost test.wiebren.nl CNAME
	No result (OK)
dig @localhost test.wiebren.nl ANY
	NO result (Not OK)

So I changed it now I have the results I need:

dig @localhost test.wiebren.nl A 
	test.wiebren.nl.             86400   IN      A       2.2.2.2 (OK)
dig @localhost test.wiebren.nl CNAME
	No result (OK)
dig @localhost test.wiebren.nl ANY
	test.wiebren.nl.             86400   IN      A       2.2.2.2 (OK)

The diff to "PowerDNS $Id: packethandler.cc 266 2005-01-11 19:41:11Z ahu $"
is:

367a368,372
>         if (p->qtype.getCode()==QType::ANY){
>       //      some more stuff here??? like rfound=true; or found=true; ???
>               r->addRecord(rr);
>         }
>

But I am totally unsure if this is all that needs to be changed or that
something is broken now.

Mvg,

Wiebren Braakman

info at lzn.info

-----Original Message-----
From: bert hubert [mailto:ahu at ds9a.nl] 
Sent: zaterdag 15 januari 2005 15:28
To: Andreas Mimz; pdns-users at mailman.powerdns.com; info at lzn.info
Subject: Re: [Pdns-users] CNAME confusion?!

Ok, that probably won't work (patch issues, subversion migration leftover),
and a thinko.

Try replacing packethandler.cc in pdns 2.9.17 by the attached version.


On Sat, Jan 15, 2005 at 03:08:11PM +0100, 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) {
> 
> 
> -- 
> http://www.PowerDNS.com      Open source, database driven DNS Software 
> http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO



More information about the Pdns-users mailing list