Subject: | Net::DNS 1.01 creates new packets with RD=0 |
Date: | Tue, 14 Jul 2015 16:57:35 +0100 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Adam Sampson <ats [...] offog.org> |
Hi Net::DNS maintainers,
I've just upgraded Net::DNS from 0.83 to 1.01, and found suddenly
SpamAssassin can't do outgoing RBL queries any more.
After a bit of debugging, this appears to be because
Net::DNS::Packet::new sets the "recursion desired" bit by default in
0.83 ("$self->header->rd(1);"), but it doesn't do so in 1.01.
With 0.83:
$ perl -MNet::DNS -e '$p = new Net::DNS::Packet("example.org", "IN", "A"); print $p->string'
;; HEADER SECTION
;; id = 35567
;; qr = 0 aa = 0 tc = 0 rd = 1 opcode = QUERY
;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0
;; do = 0
With 1.01:
$ perl -MNet::DNS -e '$p = new Net::DNS::Packet("example.org", "IN", "A"); print $p->string'
;; HEADER SECTION
;; id = 64343
;; qr = 0 aa = 0 tc = 0 rd = 0 opcode = QUERY
;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0
;; do = 0
Since SpamAssassin doesn't explicitly set (or clear) rd, my recursive
nameserver then rejects all its queries, resulting in lots of errors
like this in SpamAssassin's log:
info: dns: a likely matching query: 19367/IN/TXT/9.202.137.198.bl.spamcop.net
... and also resulting in lots of spam in my inbox!
This change isn't mentioned in CHANGES, so I assume it's accidental.
I'd guess other software will probably break for the same reason, so it
would probably be best to revert this change to maintain compatibility
with older versions of Net::DNS?
Thanks very much,
--
Adam Sampson <ats@offog.org> <http://offog.org/>