[Pdns-users] Duplicated MX records

Roderick Groesbeek powerdns at roderick.triple-it.nl
Sat Mar 6 23:18:27 UTC 2004


> From: Roderick Groesbeek
>
> Hello,
>
> Info:
> ===
> I'm testing Pdns 2.9.16 and I am seeing some undesired behaviour.
> Duplicated MX records does not get shown.
>
>
>
> mysql> select name,type,content,prio from records where domain_id=174 and
type='MX' and name='triple-it.com';
> +---------------+------+-----------------------+------+
> | name          | type | content               | prio |
> +---------------+------+-----------------------+------+
> | triple-it.com | MX   | mail.triple-it.com    |   10 |
> | triple-it.com | MX   | mx1colo2.triple-it.nl |   50 |
> | triple-it.com | MX   | mx1colo3.triple-it.nl |   50 |
> | triple-it.com | MX   | mail.triple-it.com    |  100 |
> +---------------+------+-----------------------+------+
>
> [rgroesb at shix01 rgroesb]$ dig  @localhost triple-it.com mx  +short
> 10 mail.triple-it.com.
> 50 mx1colo2.triple-it.nl.
> 50 mx1colo3.triple-it.nl.
> [rgroesb at shix01 rgroesb]$
>
>  Is this by design?

Had some spare time.. went down the rabbit-hole, and the following patch
fixes my problem.

DNSPacket::addRecord did not honour the priority and so skipped the adding
of the record.


~~
00:01:56 root at calypso:/usr/local/src/pdns-2.9.16> diff -ub
pdns/dnspacket.cc.orig pdns/dnspacket.cc
--- pdns/dnspacket.cc.orig      Sat Mar  6 23:53:58 2004
+++ pdns/dnspacket.cc   Sat Mar  6 23:55:56 2004
@@ -230,7 +230,8 @@
 {
   if(d_compress)
     for(vector<DNSResourceRecord>::const_iterator
i=rrs.begin();i!=rrs.end();++i)
-      if(rr.qname==i->qname && rr.qtype==i->qtype &&
rr.content==i->content)
+      if(rr.qname==i->qname && rr.qtype==i->qtype && rr.content==i->content
+        && rr.priority == i->priority) //[Unk] check priority also for e.g
MX records
        return;

   rrs.push_back(rr);
00:01:59 root at calypso:/usr/local/src/pdns-2.9.16>
~~





Vriendelijke Groet,

Roderick
--
Pettemerstraat 12A                                  T r I p l e
1823 CW Alkmaar                                         T
Tel. +31 (0)72-5129516
fax. +31 (0)72-5129520                              Automatisering
www.triple-it.nl                                 "Laat uw Net Werken



More information about the Pdns-users mailing list