[Pdns-users] Possible Wildcard CNAME Bug

Owen Borseth owen at domainsite.com
Wed Sep 29 19:16:20 UTC 2004


I'm not sure if this fixes the root of the problem, but this seems to 
fix the issue that I am having. In the PacketHandler::doWildcardRecords 
method of packethandler.cc I moved the following line of code:

    r->addRecord(rr);  // and add

after the following block of code:

        if(rr.qtype.getCode()==QType::CNAME) {
          if(target==rr.content) {
            L<<Logger::Error<<"Ignoring wildcard CNAME '"<<rr.qname<<"' 
pointing at itself"<<endl;
            r->setRcode(RCode::ServFail);
            continue;
          }

Recompile and this seems to clear up the issue.

For some reason B.lookup was returning records for both the actual 
domain I queried and the host that the CNAME pointed to.

Thanks,
Owen Borseth

Owen Borseth wrote:

> When I query certain domain names with a wildcard pointing to a CNAME 
> I get some strange behavior that I do not get with other domain names 
> with identical records. I have tested this in versions 2.8 and 2.9.16. 
> The only pattern I can find is that it seems to only affect domain 
> names that begin with the number 1, but not all of them, and it only 
> affects the wildcard. If I remove the wildcard on the offending 
> domain, I can then query it and get back a valid response.
>
> Here are the records in the DB for a domain that is showing this bug:
>
> +--------+-----------+----------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
> | id     | domain_id | name           | type  | 
> content                         | ttl  | prio | change_date | 
> create_date         |
> +--------+-----------+----------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
> | 359250 |     47074 | *.15orfree.com | CNAME | 
> pool.domainsite.com             |  300 | NULL |        NULL | 
> 2004-09-29 10:46:17 |
> | 283383 |     47074 | 15orfree.com   | CNAME | 
> pool.domainsite.com             |  300 | NULL |        NULL | 
> 2004-09-24 01:15:58 |
> | 359241 |     47074 | 15orfree.com   | NS    | 
> ns1.name.com                    |  300 | NULL |        NULL | 
> 2004-09-29 10:31:57 |
> | 359242 |     47074 | 15orfree.com   | NS    | 
> ns2.name.com                    |  300 | NULL |        NULL | 
> 2004-09-29 10:31:57 |
> | 359254 |     47074 | 15orfree.com   | NS    | 
> ns3.name.com                    |  300 | NULL |        NULL | 
> 2004-09-29 10:47:46 |
> | 359255 |     47074 | 15orfree.com   | NS    | 
> ns4.name.com                    |  300 | NULL |        NULL | 
> 2004-09-29 10:47:51 |
> | 359240 |     47074 | 15orfree.com   | SOA   | ns1.name.com 
> support.name.com 1 |  300 | NULL |        NULL | 2004-09-29 10:31:57 |
> +--------+-----------+----------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
>
> Here are the records for one that is not:
>
> +--------+-----------+-------------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
> | id     | domain_id | name              | type  | 
> content                         | ttl  | prio | change_date | 
> create_date         |
> +--------+-----------+-------------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
> | 353816 |     57162 | *.waydagohits.com | CNAME | 
> pool.domainsite.com             |  300 | NULL |        NULL | 
> 2004-09-24 01:16:21 |
> | 353815 |     57162 | waydagohits.com   | CNAME | 
> pool.domainsite.com             |  300 | NULL |        NULL | 
> 2004-09-24 01:16:21 |
> | 353811 |     57162 | waydagohits.com   | NS    | 
> ns1.name.com                    |  300 | NULL |        NULL | 
> 2004-09-27 13:43:22 |
> | 353812 |     57162 | waydagohits.com   | NS    | 
> ns2.name.com                    |  300 | NULL |        NULL | 
> 2004-09-27 13:43:22 |
> | 353813 |     57162 | waydagohits.com   | NS    | 
> ns3.name.com                    |  300 | NULL |        NULL | 
> 2004-09-27 13:43:22 |
> | 353814 |     57162 | waydagohits.com   | NS    | 
> ns4.name.com                    |  300 | NULL |        NULL | 
> 2004-09-27 13:43:22 |
> | 353810 |     57162 | waydagohits.com   | SOA   | ns1.name.com 
> support.name.com 1 |  300 | NULL |        NULL | 2004-09-27 13:43:22 |
> +--------+-----------+-------------------+-------+---------------------------------+------+------+-------------+---------------------+ 
>
>
> When I dig for the CNAME on www.15orfree.com I get the following:
>
> ; <<>> DiG 9.2.1 <<>> @ns1.name.com www.15orfree.com CNAME
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 42594
> ;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
>
> ;; QUESTION SECTION:
> ;www.15orfree.com.              IN      CNAME
>
> ;; ANSWER SECTION:
> www.15orfree.com.       300     IN      CNAME   pool.domainsite.com.
> pool.domainsite.com.    300     IN      CNAME   pool.domainsite.com.
>
> ;; Query time: 4 msec
> ;; SERVER: 66.17.140.20#53(ns1.name.com)
> ;; WHEN: Wed Sep 29 11:00:38 2004
> ;; MSG SIZE  rcvd: 110
>
>
> When I dig for the CNAME on www.waydagohits.com I get the following:
>
> ; <<>> DiG 9.2.1 <<>> @ns1.name.com www.waydagohits.com CNAME
> ;; global options:  printcmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45672
> ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
>
> ;; QUESTION SECTION:
> ;www.waydagohits.com.           IN      CNAME
>
> ;; ANSWER SECTION:
> www.waydagohits.com.    300     IN      CNAME   pool.domainsite.com.
>
> ;; Query time: 4 msec
> ;; SERVER: 66.17.140.20#53(ns1.name.com)
> ;; WHEN: Wed Sep 29 11:01:24 2004
> ;; MSG SIZE  rcvd: 67
>
> Note the strange additional CNAME for pool.domainsite.com in the 
> answer section for www.15orfree.com. There is no CNAME for 
> pool.domainsite.com. Anyone else see anything like this? I'm at a loss.
>
> Thanks,
> Owen Borseth
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users



More information about the Pdns-users mailing list