This diff should do the trick...
Index: lib/Net/DNS/Resolver/Base.pm
=========================================================
==========
--- lib/Net/DNS/Resolver/Base.pm (revision 736)
+++ lib/Net/DNS/Resolver/Base.pm (working copy)
@@ -107,7 +107,8 @@
persistent_udp => 0,
dnssec => 0,
udppacketsize => 0, # The actual default is lower bound by Net::DNS::PACKETSZ
- cdflag => 1, # this is only used when {dnssec} == 1
+ cdflag => 0, # this is only used when {dnssec} == 1
+ adflag => 1, # this is only used when {dnssec} == 1
force_v4 => 0, # force_v4 is only relevant when we have
# v6 support available
ignqrid => 0, # normally packets with non-matching ID
@@ -1069,7 +1070,10 @@
print ";; Adding EDNS extention with UDP packetsize $self->{'udppacketsize'} and DNS
OK bit set\n"
if $self->{'debug'};
- my $optrr = Net::DNS::RR->new(
+
+ $packet->header->cd($self->{'cdflag'});
+ $packet->header->cd($self->{'adflag'});
+ my $optrr = Net::DNS::RR->new(
Type => 'OPT',
Name => '',
Class => $self->{'udppacketsize'}, # Decimal UDPpayload
Index: lib/Net/DNS/Resolver.pm
=========================================================
==========
--- lib/Net/DNS/Resolver.pm (revision 724)
+++ lib/Net/DNS/Resolver.pm (working copy)
@@ -612,9 +612,22 @@
$res->cdflag(1);
Sets or gets the CD bit for a dnssec query. This bit is always zero
-for non dnssec queries. When the dnssec is enabled the flag can be set
+for non dnssec queries. When the dnssec is enabled the flag defaults to
+0 can be set to 1.
+
+
+
+=head2 adflag
+
+ print "checking disabled flag: ", $res->dnssec, "\n";
+ $res->dnssec(1);
+ $res->adflag(1);
+
+Sets or gets the AD bit for a dnssec query. This bit is always zero
+for non dnssec queries. When the dnssec is enabled the flag defaults
to 1.
+
=head2 udppacketsize
print "udppacketsize: ", $res->udppacketsize, "\n";
Index: Changes
=========================================================
==========
--- Changes (revision 735)
+++ Changes (working copy)
@@ -5,8 +5,14 @@
=============================
*** NOT RELEASED YET
+Fix rt.cpan.org #38390 and 37089
+ Added CD and AD bit control to the resolver.
+ The CD flag defaults to 0 and the AD bit is set by default
+ whenever DNSSEC is available.
+
+