[Pdns-users] FW: Bug in PDNS

Wiebren Braakman info at lzn.info
Wed Sep 15 14:02:53 UTC 2004


If you have a zone like this:

test.nl.                 3600    IN      SOA     ns1.dns.nl.
hostmaster.dns.nl. 2004091500 10800 3600 604800 3600
localhost.test.nl.       86400   IN      A       127.0.0.1
test.nl.                 86400   IN      MX      10 mail.test.nl.
test.nl.                 86400   IN      NS      ns1.dns.nl.
mail.test.nl.            86400   IN      A       4.3.2.1
test.nl.                 86400   IN      A       1.2.3.4
test.nl.                 86400   IN      NS      ns1.dns.nl.
*.test.nl.               86400   IN      CNAME   test.nl.


It is likeley that a lot of mail server will deliver the mail on 1.2.3.4,
this is because when the MX record is looked up it points to mail.test.nl
because en cant be an ip address. 

Then the mail server query's mail.test.nl there are 3 cases:
1: dig @ns1.dns.nl mail.test.nl ANY
	this wil return 4.3.2.1 : correct

2: dig @ns1.dns.nl mail.test.nl A
	this wil return 4.3.2.1 : correct

3: dig @ns1.dns.nl mail.test.nl CNAME
	this wil return test.nl : incorrect

When the CNAME is query'd it shoud not return a CNAME because there is a A
recrord whith the same name.

The sql query's executed by the gsql backend:
1: 	select content,ttl,prio,type,domain_id,name from records where
name='mail.test.nl'

2: 	select content,ttl,prio,type,domain_id,name from records where
name='mail.test.nl'

3: 	select content,ttl,prio,type,domain_id,name from records where
name='mail.test.nl'
	select content,ttl,prio,type,domain_id,name from records where
type='SOA' and name='mail.test.nl'
	select content,ttl,prio,type,domain_id,name from records where
type='SOA' and name='test.nl'
	select content,ttl,prio,type,domain_id,name from records where
name='*.test.nl'

I think that when the record is query'd in the database and the record
exists but the type is incorrect it shoud not look for an *.test.nl record
but return the same as when the record does not exist. I tested it on an
tinydns server where the output was correct when the CNAME was query'd.

Met vriendelijke groet,

Wiebren Braakman






More information about the Pdns-users mailing list